火影 发表于 2024-8-21 01:27:16

Comfyui之Lora的利用

上一篇我们学会了图片高清放大,这一篇我们把握下一个重要的节点,就是Lora,我们知道大模型是通过非常多的图片训练出来的,而Lora就是通过一部分特定样式的图片训练出来的,LORA节点是为了增补大模型的,也可以说Lora就是大模型的一个外挂,想象一下,假如某10个G巨细的大模型文件,里面包罗了各种风格的训练数据,比如二次元,写实,水墨等等通通包罗,这个大模型,背面再接入一个汉服风格的Lora,那么这样出来的图片就会是偏汉服的。废话不多说,下面就一步步看看Comfyui中怎么利用Lora。
一、起手式基础文生图先搭建起来

https://i-blog.csdnimg.cn/direct/27f19d3c815a4a0c9601e7b106d5818f.png
二、修改大模型加载器为带说明的大模型加载器

 https://i-blog.csdnimg.cn/direct/f837587dc24a469fbb1ecb9fc02b23b4.png
今天利用的大模型为ForRealXl系列0.5版本,出的图非常的真实惊艳
模型地址是:https://civitai.com/models/432244/forrealxl?modelVersionId=518881
三、输入正面提示词,和负面提示词

今天创造一个火车从山川之间穿梭的图片
正面:futuristic and cinematic scene, an advanced train with a sleek transparent glass exterior, traveling through a breathtaking landscape, with mountains on distant, the train's interior is filled with vibrant green plants, creating a miniature greenhouse effect, The surrounding environment is bathed in soft ethereal light filtering through gaps in the dense foliage, casting a glow on the reflective water below, the atmosphere is serene and otherworldly, combining elements of nature and futuristic technology
负面:blurry, low quality, deformed, disfigured, anime, drawing, painting, illustration, cartoon
https://i-blog.csdnimg.cn/direct/2dfa588da7c840fcb273fa5b836081f5.png
四、设置空潜的宽高为1344x768,奔着桌面壁纸的尺寸比例去的

https://i-blog.csdnimg.cn/direct/7151a450e5ed4973bd3671add5d5b48f.png
五、设置采样器的参数,按照大模型的推荐参数来

步数:16步
CFG:1.5
采样器:ddpm
调度器:随便选一个karras
https://i-blog.csdnimg.cn/direct/2061fb8952ac44378e805329dcda2fb9.png
六、将生存图像节点,改为预览图像节点,先不生存,先跑起来看看结果

https://i-blog.csdnimg.cn/direct/e63cb6716330471d8c03af67c4d2b471.png
https://i-blog.csdnimg.cn/direct/b0ecaf277b3f44c6bc4c56bead49f179.png
第一张图就被惊艳到了,,,
七、添加第一个Lora

https://i-blog.csdnimg.cn/direct/fde912a33029488598bb39d04e77f750.png
https://i-blog.csdnimg.cn/direct/d917e09daebe462a8af7c391d9ec0158.png
第一个Lora选择MJ52,增加真实感
模型下载地址:https://civitai.com/models/251417/midjourney-mimic?modelVersionId=283697
八、将这个Lora融入工作流,注意看连接的位置

https://i-blog.csdnimg.cn/direct/d9788ec3d91042ac80509b4a3ba93f29.png
然后跑个图继续看看结果
https://i-blog.csdnimg.cn/direct/3528e2601aa94ed88622973a692f1fff.png
https://i-blog.csdnimg.cn/direct/5d6911a41c614a5790101948882d74eb.png
能看出来加入了MJ52这个Lora之后,出的图颜色变深了,看起来更明亮惊艳了
九、继续串联几个真实感的Lora,看下Lora是怎么团结串联的,也看看串起来后,出图有没有什么变革

https://i-blog.csdnimg.cn/direct/c5abd8e0d1334bc1b53c949150f70093.png
直接串连就行,选择了几个Lora分别是:
LORA模型1:MJ52,下载地址:https://civitai.com/models/251417/midjourney-mimic?modelVersionId=283697
LORA模型2:CinematicStyle_v1,下载地址:https://civitai.com/models/432586/stylexl-cinematic-shot?modelVersionId=481917
LORA模型3:SDXLFaeTastic2400,下载地址:https://civitai.com/models/134338/sdxl-faetastic-details?modelVersionId=293991
LORA模型4:zavy-cntrst-sdxl,下载地址:https://civitai.com/models/295530/zavys-dark-atmospheric-contrast-sdxl?modelVersionId=332071
在跑一个图看看结果
https://i-blog.csdnimg.cn/direct/c65cbf491f3f41a7bb76f841308e7350.png
看起来更真实了,固然我们这里只是为了教大家怎么把多个Lora串起来,实际利用时,按照出图须要酌情串联,肯定不是说串的越多就越好
十、大模型作者还发起利用时,串联一个SDXL的VAE模型,不要利用大模型自带的VAE,我们连一个试试看

https://i-blog.csdnimg.cn/direct/b5c9d8229be34361a976a3d94937396b.png
将从大模型哪里接入VAE解码器的线断开,添加一个独立的VAE加载器
https://i-blog.csdnimg.cn/direct/7c764e8cb7dc467786fa69c3bacf5ff0.png
这个sdxl_vae模型的下载地址是:下载地址
添加了这个VAE后,再跑一张图看看结果
https://i-blog.csdnimg.cn/direct/74ba7a5028d34add9afb93c94537fd8b.png
草木,水,远处的山,近景,远景都非常惊艳
十一、将上篇我们用到的图片放大节点串联进来,然后天生一个4k的壁纸留作纪念

https://i-blog.csdnimg.cn/direct/21ed08f3569749de998a01d338c18f30.png
这里用到了一个放大堆节点,比较好用,就是可以一次性选择多个放大模型,一次运行多次放大,比如我这里就是线放大1倍,再放大2倍
https://i-blog.csdnimg.cn/direct/80125c7e25ee4eb08003f7f66694421d.png
总结:本篇学习的是Lora节点的利用,除了单独利用一个Lora外,还可以多个Lora串连利用,Lora一样平常都是为了增强出图是在某片面的功能,比如我上面用到的就是增加真实感的,其他各种各样的Lora,可以在C站慢慢挨个下载体验,这几天国内出了一个kcolors的大模型,初步体验后,非常惊艳,号称国产之光,下一篇我们就来体验体验

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: Comfyui之Lora的利用