Skip to content

工作流是一个团队

最基础工作流

工作流源代码在本文最后👇

参考工作流的代码源文件附在本文最后,是一个json格式的文件,下载下来,直接拖拽进ComyUI就可以打开。

你可以先把整张图想成一条流水线:左边进原料,右边出成品。那些弯来弯去的线,就是「上一道工序把东西递给下一道」。

1)CheckpointLoaderSimple——选一个现成的「画师套餐」
节点名字直译就是「检查点加载(简化版)」,你只要记得:在这里选模型文件
它就是:今天请哪位画师、用什么画风打底;同一节点还会顺手把后面要用到的 CLIP(用来理解提示词)和 VAE(画师翻译器)一起接好。

2)两个 CLIPTextEncode——好话一句,坏话一句
你会看到两块写字的节点,通常标题会写成类似「Positive / Negative CLIP Text Encode」:一块写「我想要什么」,一块写「我不要什么」。
你不用纠结 CLIP 三个字,只要知道:这里还不是在画画,而是在把你的话翻译成机器听得懂的指令;翻好的这份东西叫 conditioning,后面 KSampler 全靠它。

3)EmptyLatentImage——先铺一张「隐形草稿纸」
名字里的 latent 可以先当成「还没变成图片的中间稿」。这个节点一般在定:宽、高、一次出几张
画面你还看不见,只是先把画布尺寸和批量摆好。

中间:KSampler——无情的“改稿机器”

Section titled “中间:KSampler——无情的“改稿机器””

KSampler(界面里常写作 KSampler / 采样器)
你可以当成「反复改稿的机器」:它接上模型、接上两段提示词encode 出来的 conditioning、再接上 EmptyLatentImage 给的 latent,从一团雪花噪声开始,一步一步往你喜欢的方向改。
你在节点里看到的 steps(步数),就像「让他改多少版」:多一点通常更干净,太多又费时,二三十步往往就够你先玩起来。

VAEDecode——VAE 解码,把中间稿变成真正的图
前面 KSampler 吐出来的还是 latent;VAE 在这里的工作就是:解码(Decode),把它还原成你能看的真实的图片。
颜色发灰、发闷、不通透时,常见原因之一是解码用的 VAE 和模型不配套——以后踩坑再细查。

SaveImage——落盘保存
最后一格就是把成品保存到硬盘,前缀文件名之类在这里定。

记一句就够(顺带对齐节点名)

Section titled “记一句就够(顺带对齐节点名)”

从左到右可以对上:CheckpointLoaderSimple → 两个 CLIPTextEncodeEmptyLatentImageKSamplerVAEDecodeSaveImage;旁边 Note 只是备忘条,不参与出图。
前面 入门概念 里把这套逻辑讲得更像故事;这里是同一条流水线在软件界面里的「施工图纸」。

{
"id": "e6e10079-1a89-4fe2-abb4-5b92c57dfea7",
"revision": 0,
"last_node_id": 8,
"last_link_id": 9,
"nodes": [
{
"id": 1,
"type": "CheckpointLoaderSimple",
"pos": [
26,
200
],
"size": [
315,
130.65625
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"slot_index": 0,
"links": [
1
]
},
{
"name": "CLIP",
"type": "CLIP",
"slot_index": 1,
"links": [
3,
5
]
},
{
"name": "VAE",
"type": "VAE",
"slot_index": 2,
"links": [
8
]
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"v1-5-pruned-emaonly-fp16.safetensors"
]
},
{
"id": 2,
"type": "CLIPTextEncode",
"pos": [
380,
100
],
"size": [
350,
116
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 3
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"slot_index": 0,
"links": [
4
]
}
],
"title": "Positive CLIP Text Encode (Prompt)",
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"test prompt"
]
},
{
"id": 3,
"type": "CLIPTextEncode",
"pos": [
378.6660166491872,
262.2430027530152
],
"size": [
350,
116
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"slot_index": 0,
"links": [
6
]
}
],
"title": "Negative CLIP Text Encode (Prompt)",
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
""
]
},
{
"id": 4,
"type": "EmptyLatentImage",
"pos": [
388.0533068956476,
427.8901333901416
],
"size": [
315,
144
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"slot_index": 0,
"links": [
2
]
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
512,
512,
1
]
},
{
"id": 5,
"type": "KSampler",
"pos": [
780,
200
],
"size": [
315,
317.328125
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 1
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 4
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 6
},
{
"name": "latent_image",
"type": "LATENT",
"link": 2
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"slot_index": 0,
"links": [
7
]
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
1,
"fixed",
20,
8,
"euler",
"normal",
1
]
},
{
"id": 6,
"type": "VAEDecode",
"pos": [
1150,
200
],
"size": [
225,
72
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 7
},
{
"name": "vae",
"type": "VAE",
"link": 8
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"slot_index": 0,
"links": [
9
]
}
],
"properties": {
"Node name for S&R": "VAEDecode"
},
"widgets_values": []
},
{
"id": 7,
"type": "SaveImage",
"pos": [
1400,
200
],
"size": [
415,
84
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 9
}
],
"outputs": [],
"properties": {
"Node name for S&R": "SaveImage"
},
"widgets_values": [
"ComfyUI"
]
},
{
"id": 8,
"type": "Note",
"pos": [
34.52708770319889,
391.9420719716832
],
"size": [
317.5625,
314.984375
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [],
"properties": {},
"widgets_values": [
"需要下载\nv1-5-pruned-emaonly-fp16.safetensors\n\n下载地址:\nhttps://huggingface.co/Comfy-Org/stable-diffusion-v1-5-archive/blob/main/v1-5-pruned-emaonly-fp16.safetensors"
],
"color": "#432",
"bgcolor": "#653"
}
],
"links": [
[
1,
1,
0,
5,
0,
"MODEL"
],
[
2,
4,
0,
5,
3,
"LATENT"
],
[
3,
1,
1,
2,
0,
"CLIP"
],
[
4,
2,
0,
5,
1,
"CONDITIONING"
],
[
5,
1,
1,
3,
0,
"CLIP"
],
[
6,
3,
0,
5,
2,
"CONDITIONING"
],
[
7,
5,
0,
6,
0,
"LATENT"
],
[
8,
1,
2,
6,
1,
"VAE"
],
[
9,
6,
0,
7,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.7906301824212272,
"offset": [
97.81842389879395,
366.150850485055
]
},
"frontendVersion": "1.44.15"
},
"version": 0.4
}