大家好,我是程序员超超。
此前发布的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
照片:宽敞明亮的中学教室里,大熊猫正在讲课,它在黑板上写字,黑板上写着“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多秒:
但考虑到一次性成功的几率提高了,速度慢似乎也可以接受?
文章涉及的网址:
FLUX的Github页面:
https://github.com/black-forest-labs/flux
ComfyUI的Github页面:
https://github.com/comfyanonymous/ComfyUI
写在最后
AIGC技术的未来发展前景广阔,随着人工智能技术的不断发展,AIGC技术也将不断提高。未来,AIGC技术将在游戏和计算领域得到更广泛的应用,使游戏和计算系统具有更高效、更智能、更灵活的特性。同时,AIGC技术也将与人工智能技术紧密结合,在更多的领域得到广泛应用,对程序员来说影响至关重要。未来,AIGC技术将继续得到提高,同时也将与人工智能技术紧密结合,在更多的领域得到广泛应用。
感兴趣的小伙伴,赠送全套AIGC学习资料和安装工具,包含AI绘画、AI人工智能等前沿科技教程,模型插件,具体看下方。
一、AIGC所有方向的学习路线
AIGC所有方向的技术点做的整理,形成各个领域的知识点汇总,它的用处就在于,你可以按照下面的知识点去找对应的学习资源,保证自己学得较为全面。
二、AIGC必备工具
工具都帮大家整理好了,安装就可直接上手!
三、最新AIGC学习笔记
当我学到一定基础,有自己的理解能力的时候,会去阅读一些前辈整理的书籍或者手写的笔记资料,这些笔记详细记载了他们对一些技术点的理解,这些理解是比较独到,可以学到不一样的思路。
四、AIGC视频教程合集
观看全面零基础学习视频,看视频学习是最快捷也是最有效果的方式,跟着视频中老师的思路,从基础到深入,还是很容易入门的。
五、实战案例
纸上得来终觉浅,要学会跟着视频一起敲,要动手实操,才能将自己的所学运用到实际当中去,这时候可以搞点实战案例来学习。
在这里插入图片描述
若有侵权,请联系删除