工作流概述
工作流信息
- 工作流类型: LoRA增强
- 难度等级: 进阶
- 预计执行时间: 10-30秒
- 推荐模型: Stable Diffusion 1.5 + LoRA模型
- ComfyUI版本要求: >= 1.0
功能特点
- 添加特定风格
- 改善图像细节
- 定制生成效果
- 轻量级模型
- 可组合使用
适用场景
- 风格化生成
- 细节增强
- 特定效果
- 风格融合
工作流结构
LoRA使用指南
下图展示了LoRA的类型和强度设置建议:
这个图展示了: - 风格LoRA: 用于改变整体艺术风格(强度0.5-1.0) - 人物LoRA: 用于特定角色或人物(强度0.7-1.2) - 概念LoRA: 用于特定概念或效果(强度0.5-0.9) - 常见问题: 解决LoRA使用中的问题
节点流程图(Mermaid)
graph TD
A[CheckpointLoaderSimple] -->|MODEL| B[LoraLoader]
A -->|CLIP| B
B -->|MODEL| C[KSampler]
B -->|CLIP| D[CLIPTextEncode]
B -->|CLIP| E[CLIPTextEncode]
A -->|VAE| F[VAEDecode]
D -->|CONDITIONING| C
E -->|CONDITIONING| C
G[EmptyLatentImage] -->|LATENT| C
C -->|LATENT| F
F -->|IMAGE| H[SaveImage]
style A fill:#e1f5ff
style B fill:#fff4e1
style C fill:#fff4e1
style D fill:#ffe1f5
style E fill:#ffe1f5
style F fill:#e1ffe1
style G fill:#e1ffe1
style H fill:#ffe1e1
节点连接详解
graph LR
A[CheckpointLoaderSimple] -->|MODEL| B[LoraLoader]
A -->|CLIP| B
B -->|MODEL| C[KSampler]
B -->|CLIP| D[CLIPTextEncode]
style A fill:#e1f5ff
style B fill:#fff4e1
style C fill:#fff4e1
style D fill:#ffe1f5
graph LR
A[CheckpointLoaderSimple] -->|MODEL,CLIP| B[LoraLoader 1]
B -->|MODEL,CLIP| C[LoraLoader 2]
C -->|MODEL,CLIP| D[KSampler]
style A fill:#e1f5ff
style B fill:#fff4e1
style C fill:#fff4e1
style D fill:#fff4e1
graph LR
A[CLIPTextEncode] -->|CONDITIONING| B[KSampler]
C[CLIPTextEncode] -->|CONDITIONING| B
D[EmptyLatentImage] -->|LATENT| B
B -->|LATENT| E[VAEDecode]
E -->|IMAGE| F[SaveImage]
style A fill:#ffe1f5
style B fill:#fff4e1
style C fill:#ffe1f5
style D fill:#e1ffe1
style E fill:#e1ffe1
style F fill:#ffe1e1
核心节点说明
- 作用: 加载并融合LoRA模型
- 关键参数: lora_name(LoRA模型文件名)、strength_model(模型强度)、strength_clip(CLIP强度)
- 作用: 加载主模型
- 关键参数: ckpt_name(主模型文件名)
- CLIPTextEncode: 编码提示词
- KSampler: 执行采样
- VAEDecode: 解码潜在空间
- SaveImage: 保存图像
使用步骤
步骤1: 准备工作
- 下载LoRA模型
- 将LoRA模型放入
models/lora/目录 - 确保主模型已加载
步骤2: 加载工作流
- 打开ComfyUI
- 点击"Load"按钮
- 选择工作流JSON文件
步骤3: 配置参数
ckpt_name: v1-5-pruned-emaonly.ckpt
lora_name: detail_tweaker.safetensors
strength_model: 0.8
strength_clip: 0.8
text: beautiful landscape, mountains, sunset, 4k, detailed
text: ugly, blurry, low quality
seed: 123456789
steps: 20
cfg: 8
sampler_name: euler
scheduler: normal
denoise: 1.0
步骤4: 执行工作流
- 点击"Queue Prompt"按钮
- 等待执行完成
- 查看生成的图像
工作流JSON
单LoRA工作流
{
"3": {
"inputs": {
"seed": 123456789,
"steps": 20,
"cfg": 8,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1.0,
"model": ["11", 0],
"positive": ["6", 0],
"negative": ["7", 0],
"latent_image": ["5", 0]
},
"class_type": "KSampler"
},
"4": {
"inputs": {
"ckpt_name": "v1-5-pruned-emaonly.ckpt"
},
"class_type": "CheckpointLoaderSimple"
},
"5": {
"inputs": {
"width": 512,
"height": 512,
"batch_size": 1
},
"class_type": "EmptyLatentImage"
},
"6": {
"inputs": {
"text": "beautiful landscape, mountains, sunset, 4k, detailed",
"clip": ["11", 1]
},
"class_type": "CLIPTextEncode"
},
"7": {
"inputs": {
"text": "ugly, blurry, low quality",
"clip": ["11", 1]
},
"class_type": "CLIPTextEncode"
},
"8": {
"inputs": {
"samples": ["3", 0],
"vae": ["4", 2]
},
"class_type": "VAEDecode"
},
"9": {
"inputs": {
"filename_prefix": "lora_",
"images": ["8", 0]
},
"class_type": "SaveImage"
},
"11": {
"inputs": {
"lora_name": "detail_tweaker.safetensors",
"strength_model": 0.8,
"strength_clip": 0.8,
"model": ["4", 0],
"clip": ["4", 1]
},
"class_type": "LoraLoader"
}
}
多LoRA工作流
{
"3": {
"inputs": {
"seed": 123456789,
"steps": 20,
"cfg": 8,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1.0,
"model": ["16", 0],
"positive": ["6", 0],
"negative": ["7", 0],
"latent_image": ["5", 0]
},
"class_type": "KSampler"
},
"4": {
"inputs": {
"ckpt_name": "v1-5-pruned-emaonly.ckpt"
},
"class_type": "CheckpointLoaderSimple"
},
"5": {
"inputs": {
"width": 512,
"height": 512,
"batch_size": 1
},
"class_type": "EmptyLatentImage"
},
"6": {
"inputs": {
"text": "beautiful landscape, mountains, sunset, 4k, detailed",
"clip": ["16", 1]
},
"class_type": "CLIPTextEncode"
},
"7": {
"inputs": {
"text": "ugly, blurry, low quality",
"clip": ["16", 1]
},
"class_type": "CLIPTextEncode"
},
"8": {
"inputs": {
"samples": ["3", 0],
"vae": ["4", 2]
},
"class_type": "VAEDecode"
},
"9": {
"inputs": {
"filename_prefix": "lora_multi_",
"images": ["8", 0]
},
"class_type": "SaveImage"
},
"11": {
"inputs": {
"lora_name": "detail_tweaker.safetensors",
"strength_model": 0.6,
"strength_clip": 0.6,
"model": ["4", 0],
"clip": ["4", 1]
},
"class_type": "LoraLoader"
},
"16": {
"inputs": {
"lora_name": "add_more_details.safetensors",
"strength_model": 0.5,
"strength_clip": 0.5,
"model": ["11", 0],
"clip": ["11", 1]
},
"class_type": "LoraLoader"
}
}
LoRA类型
1. 细节增强类
- detail_tweaker: 增强细节
- add_more_details: 添加更多细节
- detail_slider: 细节滑块
- 用途: 提高图像细节质量
2. 风格化类
- 各种风格LoRA: 动漫、油画、水彩等
- 艺术家风格: 模仿特定艺术家
- 时代风格: 特定时代风格
- 用途: 添加特定艺术风格
3. 人物类
- 人物特征: 眼睛、头发等
- 服装风格: 各种服装
- 姿势: 特定姿势
- 用途: 优化人物生成
4. 场景类
- 建筑风格: 各种建筑风格
- 自然场景: 山水、森林等
- 室内设计: 各种室内风格
- 用途: 优化场景生成
参数配置指南
关键参数说明
- 0.3-0.5: 轻微影响
- 0.5-0.8: 标准强度
- 0.8-1.2: 强烈影响
- 1.2-2.0: 非常强烈的影响
- 通常与strength_model相同
- 可以单独调整
- 影响提示词理解
- 推荐: 0.5-1.0
- 总强度: 控制总强度不超过2.0
- 优先级: 主要LoRA强度高,次要LoRA强度低
- 测试: 测试不同组合的效果
示例结果
示例1: 细节增强
- LoRA: detail_tweaker
- strength: 0.8
- 提示词: beautiful landscape
- 结果: 细节更丰富的图像
示例2: 风格化
- LoRA: anime_style
- strength: 0.9
- 提示词: beautiful girl
- 结果: 动漫风格图像
示例3: 多LoRA组合
- LoRA1: detail_tweaker (0.6)
- LoRA2: add_more_details (0.5)
- 提示词: portrait, detailed
- 结果: 高细节肖像图像
LoRA组合策略
策略1: 主次分明
graph LR
A[主模型] --> B[主LoRA<br/>strength: 0.8] --> C[次LoRA<br/>strength: 0.5] --> D[采样器]
style A fill:#e1f5ff
style B fill:#fff4e1
style C fill:#fff4e1
style D fill:#fff4e1
策略2: 功能互补
graph LR
A[主模型] --> B[细节LoRA<br/>strength: 0.6] --> C[风格LoRA<br/>strength: 0.5] --> D[采样器]
style A fill:#e1f5ff
style B fill:#fff4e1
style C fill:#fff4e1
style D fill:#fff4e1
策略3: 渐进增强
graph LR
A[主模型] --> B[LoRA1<br/>strength: 0.5] --> C[LoRA2<br/>strength: 0.4] --> D[LoRA3<br/>strength: 0.3] --> E[采样器]
style A fill:#e1f5ff
style B fill:#fff4e1
style C fill:#fff4e1
style D fill:#fff4e1
style E fill:#fff4e1
优化建议
效果优化
- 调整strength: 根据效果调整strength值
- 选择合适LoRA: 根据需求选择LoRA
- 测试组合: 测试不同LoRA组合
- 记录配置: 记录有效的配置
性能优化
- 减少LoRA数量: 减少不必要的LoRA
- 降低strength: 降低不必要的强度
- 使用快速采样器: euler或lcm
质量优化
- 高质量LoRA: 使用高质量的LoRA
- 合理组合: 合理组合LoRA
- 改进提示词: 改进提示词配合LoRA
常见问题
Q1: LoRA strength设置多少合适?
A: 从0.8开始,根据效果调整,通常0.5-1.0之间。
Q2: 可以使用多个LoRA吗?
A: 可以,串联多个LoraLoader节点,但总强度不宜过高。
Q3: LoRA和主模型有什么区别?
A: LoRA是轻量级模型,用于增强主模型,不能单独使用。
Q4: 如何选择LoRA?
A: 根据需求选择,细节增强用detail类,风格化用风格类。
Q5: LoRA效果不明显怎么办?
A: 增加strength值,检查LoRA是否正确加载,尝试其他LoRA。
变体工作流
变体1: 单LoRA
- 使用一个LoRA
- strength: 0.8
- 用途: 基本增强
变体2: 双LoRA
- 使用两个LoRA
- strength1: 0.6, strength2: 0.5
- 用途: 组合效果
变体3: 多LoRA
- 使用多个LoRA
- 渐进降低strength
- 用途: 复杂组合
相关工作流
扩展阅读
更新日志
- 2026-01-26: 初始版本创建