Skip to content

基础文生图工作流

最基础的文生图工作流。

工作流结构

┌─────────────┐    ┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│ CheckpointL │ →  │ CLIPTextEn  │ →  │ KSampler    │ →  │ VAEDecode   │
│ oader       │    │ code (+)    │    │             │    │             │
└─────────────┘    └─────────────┘    └─────────────┘    └─────────────┘
                         ↑                    ↑
                   ┌─────────────┐      ┌─────────────┐
                   │ CLIPTextEn  │      │ EmptyLatent │
                   │ code (-)    │      │ Image       │
                   └─────────────┘      └─────────────┘

节点说明

1. CheckpointLoader

加载模型:

模型路径: ComfyUI/models/checkpoints/
推荐模型: SD 1.5, SDXL

2. CLIP Text Encode (Positive)

编码正向提示词:

示例: a beautiful landscape, mountains, sunset, 8k

3. CLIP Text Encode (Negative)

编码负向提示词:

示例: blurry, low quality, distorted, ugly, bad anatomy

4. EmptyLatentImage

创建潜在空间:

参数说明
width图像宽度
height图像高度
batch_size批量数量

5. KSampler

采样器:

参数说明推荐值
seed随机种子随机
steps采样步数20-30
cfgCFG 强度7-8
sampler采样器DPM++ 2M
scheduler调度器normal

6. VAEDecode

解码图像:

输入: latent 潜在空间
输出: image 图像

完整配置

SD 1.5 配置

参数
模型v1-5-pruned-emaonly.safetensors
尺寸512x512
Steps20-30
CFG7-8
SamplerDPM++ 2M
调度normal

SDXL 配置

参数
模型sd_xl_base_1.0.safetensors
尺寸1024x1024
Steps30-50
CFG7-10
SamplerDPM++ 2M Karras

提示词示例

风景

正向: a beautiful landscape with mountains, sunset, golden hour lighting, cinematic, 8k resolution, highly detailed

负向: blurry, low quality, distorted, ugly, bad anatomy, watermark, text

人物

正向: 1girl, beautiful face, long flowing hair, blue eyes, elegant dress, standing in a flower garden, soft lighting, masterpiece, best quality

负向: blurry, low quality, distorted, ugly, bad anatomy, extra fingers, deformed hands

艺术风格

正向: oil painting of a sunset landscape, impressionist style, vibrant colors, thick brushstrokes, masterpiece

负向: blurry, low quality, cartoon, anime, photo

常见问题

Q: 生成结果不好

A:

  • 优化提示词
  • 增加步数
  • 调整 CFG

Q: 显存不足

A:

  • 减小图像尺寸
  • 使用较小模型
  • 关闭其他程序

Q: 如何提升质量

A:

  • 使用更好的模型
  • 增加采样步数
  • 添加质量标签
  • 使用负面提示词

下一步