[ComfyUI]Flux:写真新篇章!字节PuLID率先开启一致性风格迁移,无损画手和优质画面保持

前言

Flux:PuLID率先开启F1写真新篇章

所有的AI设计工具,模型和插件,都已经整理好了,👇获取~在这里插入图片描述

Flux PuLID简介

在Flux出来后短时间内,社区生态反响和发展足够的迅猛快速。至今为止,社区LORA模型的涌现,Flux底膜数据集缺少问题(特别中文元素)逐步解决。ControlNet可控性方面已有Xlabs和InstantX的几款ControlNet(目前已可用,但画质还有待进一步提升)也在加速训练和完善中。近日字节Pulid团队,在之前SDXL的Pulid版本沉淀基础上,再次出手推出了:PuLID-FLUX-v0.9.0模型发布,为FLUX.1-dev提供了一个无需调整的身份ID一致性和定制化解决方案,风格一致性保持一直是在人物写真、连续多图漫画展示和视频等领域作为核心问题之一。

更多关于PuLID简介文件可以参见之前文章:[SD必备知识系列三:PuLID面部特征一致性风格保持与迁移,轻松搞定私人写真摄影,风格迁移模型评比] 。更多风格一致性系列文章:

  • • [SD必备知识系列四:面部特征保持哪家强?人物一致性定量评估]

  • [•] [SD必备知识系列二:InstantID面部特征一致性风格保持与迁移,轻松搞定私人写真摄影,SDWebUI使用指南]

  • [] [SD必备知识系列一:IPAdapterFaceID面部特征一致性保持与迁移,轻松搞定私人写真摄影,SDWebUI使用指南]

  • 在线体验地址:https://huggingface.co/spaces/yanze/PuLID-FLUX

  • github地址:https://github.com/ToTheBeginning/PuLID

PuLID-FLUX推理

PuLID-FLUX刚出来,当前还未完成ComfyUI插件的支持,目前可以统一本地WebUI方式或在线体验。在线体验地址:https://huggingface.co/spaces/yanze/PuLID-FLUX。

WebUI部署

使用如下命令可实现本地部署体验:

# 环境设置  
# clone PuLID repo  
git clone https://github.com/ToTheBeginning/PuLID.git  
cd PuLID  
# create conda env  
conda create --name pulid python=3.10  
# activate env  
conda activate pulid  
# Install dependent packages  
pip install -r requirements.txt  
  
# 授权模型下载  
!pip install -U huggingface_hub  
!huggingface-cli login  
  
# 服务启动  
# start service  
python app_flux.py

视觉结果展示

实用技巧

有两个关键参数需要仔细设置:

    1. 开始插入ID的时间步:此参数控制ID插入的时机。如果设置为0,则ID从第一个时间步开始被插入到DIT中。越早插入,ID的保真度越高,但可编辑性可能会降低。越晚插入,对ID的忠实度越低,但可编辑性会增加,对原始模型行为的干扰也会更小。对于生成逼真图像,建议将其设置为4。如果发现ID的相似性不够高,可以尝试相应降低此参数。对于生成风格化图像,建议将其设置为0-1。

    1. 真正的CFG比例:FLUX.1-dev是一个指导蒸馏模型。原来的CFG过程,需要双倍的推理步骤,被蒸馏成一个指导比例,从而通过指导比例调制DIT,用一半的推理步骤模拟真正的CFG过程。在文档中将这被称为假CFG。PuLID-FLUX模型可以在假CFG设置下进行测试,指导比例可以设置为常用的值,比如4。然而,该模型也支持使用真正的CFG进行推理。研发团队在下面的逼真场景中比较了使用真正CFG和假CFG的结果。

如上图所示,在ID保真度方面,使用假CFG在大多数情况下与真正的CFG相似,除了在少数情况下,真正的CFG实现了更高的ID相似性。在图像审美和面部自然性方面,假CFG表现更好。然而,通过仔细调整超参数,真正的CFG的性能可能进一步提高。研发团队建议对逼真场景使用假CFG。如果对ID的忠实度不满意,可以尝试切换到真正的CFG。此外,如下图所示,发团队还发现在风格化场景中使用假CFG有时会导致ID相似性降低和风格响应变差,所以如果在风格化场景中遇到这两个问题,请考虑切换到真正的CFG。

3. 研发团队还提到:从MLP结构转向了Transformer结构作为ID编码器。受到Flamingo的启发,每隔几个DIT块插入额外的交叉注意力模块,以使ID特征与DIT图像特征相互作用。在Pulid中使用的加速方法(如SDXL-Lightning)是一种可选的加速技巧,但不是训练PuLID不可或缺的。

Flux PuLID一致性风格体验

在本文中将使用笔者LIBLIB分享的基础Flux文生图出图Pulid WebUI一致性组件出图实现风格保持一致性对比。另外,在体验过程中发觉Pulid实现比同类其他ControlNet模型更加优秀,不会对画面产生影响,保持优质画面同时能够保持Flux优秀画手能力。在下面的演示示例中,Flux直出图将启用不同的LORA测试,但Pulid暂未集成到ComfyUI,因此笔者使用中并未启用LORA效果。

Flux 文生图工作流

关于Flux模型本地ComfyUI工作流体验参见之前文章:[FLUX[续篇]:12B参数23G最大开源文生图模型,Dev版直出惊艳美图欣赏].本文涉及ComfyUI工作流和模型均可在LIBLIBAI上下载或在线运行体验:

  • • FLUX.1哩布在线可运行-黑暗森林工作室:https://www.liblib.art/modelinfo/488cd9d58cd4421b9e8000373d7da123

  • • 工作流-Flux文|图生图+LORA+CN+提示反推一键切换工作流:https://www.liblib.art/modelinfo/782aacd70f604da39e83368c696a02a8

  • Flux Pulid在线体验:https://huggingface.co/spaces/yanze/PuLID-FLUX

输入风格图

(网图侵删)

01. AGI Flux

Flux版本使用了墨幽自拍模型,详情参见:[[ComfyUI]Flux:超赞网图风格,高p高糊的反向真实质感]

a chinese woman holding sign with glowing green text "AGI Flux", Bright sunshine
Flux

Flux Pulid

02. 豪车

Flux版本使用了FLUX–细节质感提升–FLUX DETAILER模型,详情参见:[[ComfyUI]Flux:太赞了!细节质感增强,人物降油光写实,富有电影光线,丰富画面元素]

This is a high-resolution portrait of a modern style, featuring a young woman., In this dynamic display scene, a model stands in front of a beautifully designed high-end sports car with a posture that is both elegant and powerful, perfectly complementing the vehicle she is showcasing. The sports car catches everyone's eye with its streamlined design and dazzling body colors, while the model adds life to the moment with her charm and confidence. The car model wears a simple and fashionable dress that shows her professional image without losing her feminine beauty. Her clothing echoes the colors and designs of the sports car, creating a harmonious yet engaging visual effect. Her hair, gently combed and falling over her shoulders, set off against her delicate makeup, showing her elegance and sophistication. Her eyes are firm and confident, as if telling the story behind the sports car and the speed and passion it represents. She leaned gently in front of the car, one hand touching the front, the other hand drooping. This pose not only shows her familiarity and closeness to the car, but also her professionalism and pursuit of perfect presentation.
Flux

Flux Pulid

03. 厨房

Flux版本使用了墨幽自拍模型和Missa_F.1_花境模型,详情参见:[[ComfyUI]Flux:超赞网图风格,高p高糊的反向真实质感]、[Flux:手机摄影般超真实,真假难辨!Missa花境超逼真写实的庭院艺术,身临其境视觉体验]

d577,hj, Kitchen, beautiful Chinese girl, virtuous, beautiful and generous, The video shows a woman cooking in the kitchen. She is wearing a white shirt and beige apron, and is concentrating on placing food on a wooden cutting board. Her hair is black and falls on her shoulders. A modern kitchen with stainless steel appliances and wooden cabinets can be seen in the background. Various ingredients and kitchenware are placed on the countertop, including green vegetables, sliced meat, and other condiments. The lighting is warm and soft, creating a comfortable atmosphere. The style of the entire video is simple and natural, focusing on the cooking process and the details of preparing food.
Flux

Flux Pulid

04. 阿凡达

Flux版本使用功了AWP-FLLORA模型,详情参见:[[ComfyUI]Flux:超逼真质感!AWPFL极致构图和细节,精致逼真的皮肤和质感,报脸全球TOP榜]

Photography, photo, realistic,Chinese girl,20-old-years, Craft an image inspired by the characters from the movie 'Avatar,' featuring a subject with the distinct blue complexion of the Na'vi. Their skin is detailed with intricate, bioluminescent patterns that glow against the dark backdrop, mirroring the mystical flora of Pandora. The character's pointed ears, a hallmark of the Na'vi, protrude elegantly, and they wear a necklace with beads that seem to absorb the surrounding light. The makeup is designed to resemble the iridescent qualities of the Na'vi, with blue glitter and sparkles enhancing the facial features. The background remains intentionally out of focus, drawing all attention to the subject's vibrant and fantasy-inspired appearance, as if they are a real inhabitant of the alien world depicted in the film.
Flux

Flux Pulid

这里分享给大家一份Adobe大神整理的《AIGC全家桶学习笔记》,相信大家会对AIGC有着更深入、更系统的理解。

有需要的朋友,可以点击下方免费领取!

在这里插入图片描述

AIGC所有方向的学习路线思维导图

这里为大家提供了总的路线图。它的用处就在于,你可以按照上面的知识点去找对应的学习资源,保证自己学得较为全面。如果下面这个学习路线能帮助大家将AI利用到自身工作上去,那么我的使命也就完成了:
在这里插入图片描述

AIGC工具库

AIGC工具库是一个利用人工智能技术来生成应用程序的代码和内容的工具集合,通过使用AIGC工具库,能更加快速,准确的辅助我们学习AIGC
在这里插入图片描述

有需要的朋友,可以点击下方卡片免费领取!

在这里插入图片描述

精品AIGC学习书籍手册

书籍阅读永不过时,阅读AIGC经典书籍可以帮助读者提高技术水平,开拓视野,掌握核心技术,提高解决问题的能力,同时也可以借鉴他人的经验,结合自身案例融会贯通。

在这里插入图片描述

AI绘画视频合集

我们在学习的时候,往往书籍源码难以理解,阅读困难,这时候视频教程教程是就很适合了,生动形象加上案例实战,科学有趣才能更方便的学习下去。

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值