【AI绘画】AI终于会画手了!最强开源工具FLUX测试与安装

此前发布的Stable Diffusion 3模型,因为过度审核,导致人体结构的生成能力“退步”,被喷得不轻。

现在一款优秀的平替出现了,那就是黑森林实验室的FLUX模型,该团队由Stability AI前核心成员组成。FLUX一经推出,好评如潮,被封为“最强开源文生图模型”。

先来感受一下FLUX的出图效果:

一位性感的中国女孩,黑色长发,一只手撩起头发,她穿着蓝色连衣裙,深v,她的胸口纹身是字母“fire”
A sexy Chinese girl with long black hair, one hand lifting her hair, wearing a blue dress, deep V-neck, and a tattoo on her chest with the letters “fire”

一个漂亮的中国女人,穿着牛仔裤和黑色毛衣,和她的狗躺在上海一套公寓的床上,全身照,Kawaii风格,K-pop偶像造型,祈祷姿势,赛博朋克氛围,90年代的复古发型,哥特时尚的影响,米舍尔的摄影作品,农场女孩的审美,淡紫色的室内装饰,窗外现代摩天大楼的素描。
A beautiful Chinese woman, wearing jeans and black sweater, lying on the bed with her dog in an apartment in Shanghai city, full body photo, Kawaii style, K-pop idol look, praying pose, cyberpunk vibe, 90s retro hairstyle, goth fashion influence, m Mishel’s photographic works, farm girl aesthetic, lilac-colored interior decor, sketching of modern skyscrapers outside the window.

一个美丽的南美女人,大胸,穿着细小的比基尼泳装,站在沙滩上,她弯着腰,抬头看着镜头,面带妩媚微笑,她手轻抚着胸口,她双腿修长
A beautiful South American woman, with big breasts and wearing a small bikini swimsuit, stood on the beach. She bent over, looked up at the camera, and had a charming smile on her face. Her hands gently caressed her chest, and her legs were long and slender

《龙与地下城》风格的电影:一位女法师、一位男游侠、一位铠甲圣骑士、一位女僧侣、一位男盗贼并排站着,他们都在笑,伸手竖起大拇指
Dungeons&Dragons style movie: A female mage, a male ranger, an armored paladin, a female monk, a male thief, standing side by side in a line, they are all laughing and reaching out a hand to give a thumbs up

上面主要测试人体结构表现。SD3容易崩坏的问题(尤其女性暴露身体较多的应用场景),在FLUX中都得到了解决。《龙与地下城》的图片上难度,同时绘制多个角色+多个手部,也顺利完成。


灭霸站在宇宙战舰甲板上自拍,背景是宇宙空间和地球
Thanos takes a selfie standing on the deck of a spaceship, with space and Earth in the background

特朗普和一个女性机器人跳舞,机器人全身金属材质,模特身材,周围有许多人在围观
Trump dances with a female robot, the robot is made of metal and has a model figure, surrounded by many people watching

哈利波特电影:哈利波特拿着枪,对着镜头,他表情严肃,背景是霍格沃茨城堡
Harry Potter movie: Harry Potter holding a gun, facing the camera, his expression serious, and the background being Hogwarts Castle

以上测试对知名IP形象(名人)的重现,好消息是审核不算很严格,坏消息是仍存在选择性审核(比如,哈利波特就不像演员本人)


芯片的3D插图,上面漂浮着全息文本“AI”,采用蓝色配色方案。背景以浅灰色和白色波浪为特色,融入了科技元素。该图像具有高分辨率、高质量、细节、锐度和对比度,具有电影风格。它是用辛烷渲染软件渲染的
3D illustration of the chip with holographic text “AI” floating above it, with a blue color scheme. The background features light gray and white waves with tech elements. The image has high resolution, quality, details, sharpness, and contrast, with a cinematic style. It was rendered with octane rendering software

这份完整版的AI绘画全套学习资料已经上传CSDN,朋友们如果需要可以微信扫描下方CSDN官方认证二维码免费领取【保证100%免费

照片:宽敞明亮的中学教室里,大熊猫正在讲课,它在黑板上写字,黑板上写着“I am a panda, i come from china, i like bamboo",一些学生正在听课
Photo: In a spacious and bright high school classroom, a giant panda is giving a lecture. It is writing on the blackboard, which reads “I am a panda, I come from China, I like bamboo”. Some students are listening to the lecture

以上测试文字生成能力,可以看到即使较长的句子(英文字符)也没问题。


日本动漫:全身镜头,一个戴墨镜的年轻金发女人,她有修长的腿,穿皮裤,前卫的靴子,背上背着一把巨剑,站在霓虹灯闪烁的赛博朋克城市街道
Japanese anime: Full body shot, a young blonde woman wearing sunglasses, with slender legs, leather pants, avant-garde boots, carrying a giant sword on her back, standing on a neon lit cyberpunk city street

1920年的黑白照片:20多岁的女性历史学家站在一个满是古代文物的储藏室里,手里拿着一本书,她带着困惑的神情进行研究
Black and white photo from 1920: A female historian in her twenties stands in a storage room filled with ancient artifacts, holding a book and conducting research with a puzzled expression

海怪张着嘴游向镜头,正要吞下一个也面对镜头的潜水员
Kraken swimming towards camera with mouth open, about to swallow a scuba diver who is also facing the camera

聚焦森林中的木制舞台,以cinema4d风格呈现,舞台背景充满活力,平衡优雅,生态优美,色调优美
Focus on wooden stage in forest, rendered in cinema4d style, vibrant stage background, elegant balance, ecology, tones

梵高风格的一系列彩色渐变电脑背景
a series of colored gradient computer backgrounds but in style of van gogh

Facebook帖子风格的高细节写实照片,航拍中国一座绿草山的俯视图,上面雕刻着形状像头骨的巨大龙骨。这是一张非常奇怪但美丽的恐龙骨骼风格的写实照片。
high-detail realistic photograph in the style of a Facebook post, Aerial photography of the top view of a green grassy mountain in China carved with huge dragon bones shaped like a skull. It is a very strange but beautiful realistic photo in the style of dinosaur bones.

关于金合欢树的信息图细节,包括根系、古董环境笔记、素描、科学论文、咖啡渍。
Infographic details on a wattle (acacia) tree including root system, antique environmental notes, sketch, scientific paper, coffee stains.

漫画书页面,插图为身穿白色长袍的幻想精灵公主在夜晚穿过鲜花和藤蔓的神奇森林,地平线上的植物山,以Moebius的风格高度详细,4k
Comic book page with panels featuring fantasy elven princess in white robes walking through magical forest with flowers and vines at night, mountains of plants on the horizon, highly detailed in the style of Moebius, 4k

以上是各种风格图片的测试,主要考察对提示词的遵从性,相比头部闭源工具诸如Midjourney、DALLE,FLUX的表现依然可圈可点。


目前FLUX已支持ComfyUI图形用户界面,接下来介绍本地部署的方法:

第一步:安装ComfyUI的最新版本

1、进入下面网址:https://github.com/comfyanonymous/ComfyUI?tab=readme-ov-file#installing

2、点击Direct link to download下载大约1.5G的压缩包。

3、将压缩包解压到你指定的硬盘。

4、进入安装好的目录,运行run_nvidia_gpu.bat,接下来系统会自动下载必需的文件。

5、之后会自动弹出类似这样的网页,说明安装成功。

注意:这个后台窗口要保持开启,否则ComfyUI无法正常使用。


第二步:下载FLUX模型

1、进入FLUX的抱抱脸页面:https://huggingface.co/black-forest-labs/FLUX.1-dev/tree/main,点击Files按钮:

2、在文件列表中,下载主模型文件和VAE自编码器:
flux1-dev.sft:23.8 GB,将此文件放入ComfyUI/models/unet/ 目录下
ae.safetensors:335 MB,将此文件放入ComfyUI/models/vae/ 目录下

3、进入ComfyUI抱抱脸页面:https://huggingface.co/comfyanonymous/flux_text_encoders/tree/main

4、在文件列表中,下载CLIP预训练模型:
t5xxl_fp16.safetensors: 9.79 GB
t5xxl_fp8_e4m3fn.safetensors: 4.89 GB
clip_l.safetensors: 246 MB
以上文件均放入ComfyUI/models/clip/ 目录下,其中9GB和4GB的文件至少下载其中一个。

5、进入以下网址:https://openart.ai/workflows/maitruclam/comfyui-workflow-for-flux-simple/iuRdGnfzmTbOOzONIiVV,点击右边Download按钮下载工作流。

6、将工作流文件拖到ComfyUI页面上,得到下图的结果:

7、确保你选择了正确的模型和编码器(参考下图),然后就可以开始绘画了!

需要注意的是,FLUX对硬件要求较高。测试过程中,最高占用了近30G内存:

FLUX生图速度也较慢,即使用4090显卡,默认设置,生成一张1024x1024的图像,也要20多秒:

但考虑到一次性成功的几率提高了,速度慢似乎也可以接受?

关于AI绘画技术储备

学好 AI绘画 不论是就业还是做副业赚钱都不错,但要学会 AI绘画 还是要有一个学习规划。最后大家分享一份全套的 AI绘画 学习资料,给那些想学习 AI绘画 的小伙伴们一点帮助!

对于0基础小白入门:

如果你是零基础小白,想快速入门AI绘画是可以考虑的。

一方面是学习时间相对较短,学习内容更全面更集中。
二方面是可以找到适合自己的学习方案

包括:stable diffusion安装包、stable diffusion0基础入门全套PDF,视频学习教程。带你从零基础系统性的学好AI绘画!