Flux最近收到了很多模型爱好者的好评,出图质量超越SD3和MJ,许多人说Flux才是大家心目中的SD3,所以我也是非常好奇FLux的实力,顺便把安装的过程分享给大家
官网参考图:
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385845121072549405161742.png)
Flux官网首页:https://blackforestlabs.ai/
人工智能初创公司 Black Forest Labs成立公司并发布其首套文本转图像人工智能模型 FLUX.1。这家总部位于德国的公司由开发Stable Diffusion的研究人员创立,旨在为图像和视频创建先进的生成式人工智能。
模型一共分三款,包含pro版、dev版、schnell版。
Black Forest 的图表声称其 Pro 和 Dev 模型是迄今为止最好的图像生成器,而其功能较弱的 Schnell 排名介于 Midjourney v5 和 Ideogram 之间
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385845138439712688319249.png)
这三个版本说明:
- Pro版本效果最好,但是闭源,API收费的。
- Dev版本开源但是不可商用,至少需要24G显存运行。
- Schnell版本开源可商用
如果你想要在线体验,也有在线的网站:
schnell :https://replicate.com/black-forest-labs/flux-schnell
dev:https://replicate.com/black-forest-labs/flux-dev
pro:https://replicate.com/black-forest-labs/flux-pro
本地部署
目前ComfyUI最新版本已经兼容FLux模型了, 只需内核升级到最新即可体验。
所以我们首先把ComfyUI给更新了
如果你用的是官方的comfyUI整合包就点这个更新
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385845158438552196281126.png)
如果你用的是秋叶的启动器就按下图示例更新内核
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385845163045912553458481.png)
显存太低的机子本地估计运行估计很难,我这电脑配置还行,这里体验下schnell版本。
下载大模型:https://huggingface.co/black-forest-labs/FLUX.1-schnell/tree/main
该链接提供了23.8g的大模型和335MB的Vae模型,我们需要把这两个都下载
- 下载完成后将大模型放在:ComfyUI/models/unet/ 文件夹中。
- VAE应该放在您的 ComfyUI/models/vae/ 文件夹中。
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385845173694982814024076.png)
如果电脑配置一般的可以下载Flux-fp8精简版,只有11.9GB:https://huggingface.co/Kijai/flux-fp8/blob/main/flux1-dev-fp8.safetensors
Vae还是通用的ae.sft
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385845232351388529787976.png)
我们除了大模型和Vae还需要下载Clip模型:https://huggingface.co/comfyanonymous/flux_text_encoders/tree/main
这其实就是SD3的Clip模型,配置好我们选择fp16,配置一般我们选择fp8,clip_l是一定要下载的
下载完我们放在:ComfyUI\models\clip 该文件夹内
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385845258994235525887046.png)
以上的大模型,VAE,Clip都安装完成后我们就可以运行我们的工作流了,官网提供了一个简易的comfyUI工作流:https://comfyanonymous.github.io/ComfyUI_examples/flux/
我们把官网提供的图片保存下来
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385845287329986595183034.png)
再把图片拖进ComfyUI中即可,不想这么麻烦的也可以加入我们的交流群直接获取工作流
进入工作流我们确保模型加载没问题就可以点击加入队列等待生成了
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385845301020167173742454.png)
生图效果
提示词1:a bottle with a rainbow galaxy inside it on top of a wooden table on a table in the middle of a modern kitchen
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385845531449500936213809.png)
提示词2:photograph of a black board in an old classroom. On the black board in chalk are the words “Lets make some really pretty stuff together” with a red chalk heart after the words. Sunlight is streaming in from the window
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385846559651949701475283.png)
提示词3:filmic photo of a group of three women on a street downtown, they are holding their hands up the camera
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385846458834459701938165.png)
提示词4:macro photography of a miniature little village on top of a flower
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385846512252105976865614.png)
FP8版本,提示词5:close up fujifilm photo of a mans eye and fac
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385846539447214279980559.png)
提示词6:beautiful anime artwork, a cute anime girl standing alone at night darkness wearing an oversized black raincoat with a small bag. she is holding a black umbrella, the umbrella has multicolored LED hidden inside that shine down on her, small rose petals flutter through the air around her, anime screencap style, red eyes, medium hair
![image.png FLUX.1最强AI绘画开源新模型,本地部署教程!](https://scpic1.chinaz.net/Files/art/2024/0805/6385846551246325022526135.png)
总结
整体来说,测试下来效果还是很不错的,FLUX 比 SD3 强的多。