【comfyui教程】ComfyUI图片修复进阶:掌握Flux局部修复Controlnet模型秘籍!

大家好我是AIGC阿道夫

前言

1.Flux 局部修复Controlnet模型

1-1: 模型介绍

该模型是阿里妈妈创意团队研究人员发布的针对FLUX.1-dev模型,实现局部重绘效果的ControlNet模型,该模型为非商业许可。

1-2:生成示例

  1. FLUX-Controlnet-Inpainting模型效果

  1. 与 SDXL-Inpainting 比较效果

从左到右:输入图像 | 蒙版图像 | SDXL 修复 | 阿里妈妈模型

_The image depicts a beautiful young woman sitting at a desk, reading a book. She has long, wavy brown hair and is wearing a grey shirt with a black cardigan. She is holding a pencil in her left hand and appears to be deep in thought. Surrounding her are numerous books, some stacked on the desk and others placed on a shelf behind her. A potted plant is also visible in the background, adding a touch of greenery to the scene. The image conveys a sense of serenity and intellectual pursuits._这幅画描绘了一位美丽的年轻女子坐在书桌前读书。她有一头长长的波浪形棕色头发,身穿灰色衬衫和黑色羊毛衫。她左手拿着一支铅笔,似乎陷入了沉思。她周围有许多书,一些堆放在桌子上,另一些放在她身后的架子上。背景中还可以看到一盆盆栽,为场景增添了一丝绿意。这幅画传达了一种宁静和追求知识的感觉。

A woman with blonde hair is sitting on a table wearing a blue and white long dress. She is holding a green phone in her hand and appears to be taking a photo. There is a bag next to her on the table and a handbag beside her on the chair. The woman is looking at the phone with a smile on her face. The background includes a TV on the left wall and a couch on the right. A chair is also present in the scene.

一名金发女子身穿蓝白相间的长裙,坐在桌子上。她手里拿着一部绿色手机,似乎正在拍照。她旁边的桌子上放着一个包,旁边的椅子上放着一个手提包。女子面带微笑地看着手机。背景包括左边墙上的电视和右边的沙发。场景中还有一把椅子。

_The image is an illustration of a man standing in a cafe. He is wearing a white turtleneck, a camel-colored trench coat, and brown shoes. He is holding a cell phone and appears to be looking at it. There is a small table with a cup of coffee on it to his right. In the background, there is another man sitting at a table with a laptop. The man is wearing a black turtleneck and a tie. There are several cups and a cake on the table in the background. The man sitting at the table appears to be typing on the laptop._图片描绘的是一名男子站在咖啡馆里。他身穿白色高领衫、驼色风衣和棕色鞋子。他拿着手机,似乎正在看手机。他的右边有一张小桌子,上面放着一杯咖啡。在背景中,还有一名男子坐在桌边,手里拿着一台笔记本电脑。这名男子身穿黑色高领衫和领带。背景中的桌子上放着几个杯子和一块蛋糕。坐在桌边的男子似乎正在用笔记本电脑打字。

_The image depicts a scene from the anime series Dragon Ball Z, with the characters Goku, Naruto, and a child version of Gohan sharing a meal of ramen noodles. They are all sitting around a dining table, with Goku and Gohan on one side and Naruto on the other. They are all holding chopsticks and eating the noodles. The table is set with bowls of ramen, cups, and bowls of drinks. The arrangement of the characters and the food creates a sense of camaraderie and shared enjoyment of the meal._图片描绘的是动漫《龙珠 Z》中的一个场景,其中悟空、鸣人和儿童版悟饭正在共享一顿拉面。他们都坐在餐桌旁,一边是悟空和悟饭,另一边是鸣人。他们都拿着筷子吃面条。桌子上摆满了拉面碗、杯子和饮料碗。人物和食物的摆放营造出一种友情和共享美食的感觉。

1-3:模型下载

所有的AI设计工具,安装包、模型和插件,都已经整理好了,👇获取~

请添加图片描述

  • 该模型在 12M laion2B 和内部源图像上进行训练,分辨率为 768x768。推理在此尺寸下表现最佳,其他尺寸则产生次优结果。

  • 建议的控制网条件尺度(controlnet_conditioning_scale)为 0.9 - 0.95。

  • 请注意:这只是训练过程中的 alpha 版本。我们准备好后会发布更新版本。

1-4:工作流下载

ComfyUI 现已支持阿里妈妈FLUX-Controlnet-Inpainting这个局部修复模型

ComfyUI 使用技巧

  • 使用t5xxl-FP8flux1-dev-fp8模型进行 28 步推理,GPU 内存使用量为 27GB,使用 时推理时间cfg=3.5为 27 秒,不使用 时推理时间cfg=1为 15 秒,Hyper-FLUX-lora可以用来加速推理。

  • 您可以尝试调整(降低)参数control-strength、、control-end-percentcfg以获得更好的效果。

  • 建议使用control-strength= 0.9 & control-end-percent= 1.0 & cfg= 3.5

1-5:工作流实操

  1. 更新ComfyUI到最新版,启动ComfyUI。

  1. 打开工作流文件,会提示缺失节点。

  1. 安装缺失节点

  1. 点击缺失节点INSTALL安装,安装完成后点击重启ComfyUI

  1. 下载模型,下载后建议更名为FLUX.1-dev-Controlnet-Inpainting-Alpha.safetensors,方便识别。
  • 模型存放位置:models\controlnet

  1. 第1组,红色框:加载FLUX大模型;绿色框:加载clip模型;蓝色框:加载VAE模型。

  1. 第2组,红色框:加载图片,图片右键遮罩编辑器打开,添加遮罩(就是需要重绘的区域),点击SAVE TO NODE;绿色框:加载阿里妈妈的局部重绘CONTROLNET模型。模型下载

  1. 第3组,红色框:填写提示词(提示词我完整描述了原画面,原画面有三个人,我将其中一位改成了Elon Musk,这样可以实现在遮罩区域出现Elon Musk);绿色框:设置步数;蓝色框:设置生成图片大小和数量;黄色框:设置采样器。

  1. 第4组,等待AI出图。


为了帮助大家更好地掌握 ComfyUI,我在去年花了几个月的时间,撰写并录制了一套ComfyUI的基础教程,共六篇。这套教程详细介绍了选择ComfyUI的理由、其优缺点、下载安装方法、模型与插件的安装、工作流节点和底层逻辑详解、遮罩修改重绘/Inpenting模块以及SDXL工作流手把手搭建。

由于篇幅原因,本文精选几个章节,详细版点击下方卡片免费领取

请添加图片描述

一、ComfyUI配置指南
  • 报错指南
  • 环境配置
  • 脚本更新
  • 后记

img

二、ComfyUI基础入门
  • 软件安装篇
  • 插件安装篇

img

三、 ComfyUI工作流节点/底层逻辑详解
  • ComfyUI 基础概念理解
  • Stable diffusion 工作原理
  • 工作流底层逻辑
  • 必备插件补全

img

四、ComfyUI节点技巧进阶/多模型串联
  • 节点进阶详解
  • 提词技巧精通
  • 多模型节点串联

img

五、ComfyUI遮罩修改重绘/Inpenting模块详解
  • 图像分辨率
  • 姿势

img

六、ComfyUI超实用SDXL工作流手把手搭建
  • Refined模型
  • SDXL风格化提示词
  • SDXL工作流搭建

img

由于篇幅原因,本文精选几个章节,详细版点击下方卡片免费领取

img

请添加图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值