comfy-edit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ComfyUI Workflow Editing

ComfyUI工作流编辑

Edit workflow JSON files using the VibeComfy CLI.
When working in the repo, see CLAUDE.md for full command reference.
使用VibeComfy CLI编辑工作流JSON文件。
在仓库中工作时,可查看CLAUDE.md获取完整命令参考。

CLI Commands

CLI命令

All edit commands require
-o output.json
. Use
--dry-run
to preview changes.
CommandPurpose
trace WF NODE
Show node inputs/outputs with slot names
upstream WF NODE
Find nodes feeding into target
downstream WF NODE
Find nodes fed by source
wire WF SRC_ID SRC_SLOT DST_ID DST_SLOT -o OUT
Connect nodes
copy WF NODE -o OUT
Duplicate a node
set WF NODE key=val -o OUT
Set widget values
delete WF NODE -o OUT
Remove nodes
create WF TYPE -o OUT
Create new node
batch WF SCRIPT -o OUT
Multi-step edits
submit WF
Run workflow in ComfyUI
Tip: Use
trace
first to find slot numbers, then
wire
to connect.
所有编辑命令都需要
-o output.json
参数。使用
--dry-run
参数可预览更改。
命令用途
trace WF NODE
显示带插槽名称的节点输入/输出
upstream WF NODE
查找为目标节点提供数据的上游节点
downstream WF NODE
查找由源节点提供数据的下游节点
wire WF SRC_ID SRC_SLOT DST_ID DST_SLOT -o OUT
连接节点
copy WF NODE -o OUT
复制节点
set WF NODE key=val -o OUT
设置组件值
delete WF NODE -o OUT
删除节点
create WF TYPE -o OUT
创建新节点
batch WF SCRIPT -o OUT
多步骤编辑
submit WF
在ComfyUI中运行工作流
提示:先使用
trace
命令查找插槽编号,再使用
wire
命令连接节点。

Adding Nodes Workflow

添加节点的工作流

  1. Find the node:
    comfy_search("controlnet")
    (use comfy-registry skill)
  2. Get the spec:
    comfy_spec("ControlNetLoader")
    - see inputs/outputs
  3. Understand the flow:
    python we_vibin.py trace workflow.json <ksampler_id>
  4. Create and wire:
bash
python we_vibin.py create workflow.json ControlNetLoader -o step1.json
python we_vibin.py trace step1.json <new_node_id>  # Find the slot numbers
python we_vibin.py wire step1.json <src_id> <src_slot> <dst_id> <dst_slot> -o step2.json
Or use batch scripts for multi-step edits (slot names work in batch mode):
bash
create ControlNetLoader as $cn
wire $cn:control_net -> 15:control_net
  1. 查找节点
    comfy_search("controlnet")
    (使用comfy-registry技能)
  2. 获取规格
    comfy_spec("ControlNetLoader")
    - 查看输入/输出信息
  3. 理解流程
    python we_vibin.py trace workflow.json <ksampler_id>
  4. 创建并连接
bash
python we_vibin.py create workflow.json ControlNetLoader -o step1.json
python we_vibin.py trace step1.json <new_node_id>  # 查找插槽编号
python we_vibin.py wire step1.json <src_id> <src_slot> <dst_id> <dst_slot> -o step2.json
或者使用批处理脚本进行多步骤编辑(批处理模式支持使用插槽名称):
bash
create ControlNetLoader as $cn
wire $cn:control_net -> 15:control_net

Common Patterns

常见模式

What nodes go together. See references/PATTERNS.md for details.
节点组合方式详情请查看references/PATTERNS.md

Image Generation

图像生成

PatternFlow
txt2imgCheckpoint → CLIP (x2) → EmptyLatent → KSampler → VAEDecode → Save
img2imgLoadImage → VAEEncode → KSampler (denoise<1) → VAEDecode → Save
inpaintLoadImage + Mask → VAEEncodeForInpaint → KSampler → VAEDecode
模式流程
txt2imgCheckpoint → CLIP(×2)→ EmptyLatent → KSampler → VAEDecode → 保存
img2imgLoadImage → VAEEncode → KSampler(降噪值<1)→ VAEDecode → 保存
inpaintLoadImage + 蒙版 → VAEEncodeForInpaint → KSampler → VAEDecode

Enhancements

增强功能

PatternFlow
ControlNetLoadControlNet → ControlNetApply → KSampler
LoRACheckpoint → LoraLoader → KSampler
UpscaleLoadUpscaleModel → ImageUpscaleWithModel → Save
IPAdapterLoadIPAdapter → IPAdapterApply → KSampler
模式流程
ControlNetLoadControlNet → ControlNetApply → KSampler
LoRACheckpoint → LoraLoader → KSampler
超分辨率LoadUpscaleModel → ImageUpscaleWithModel → 保存
IPAdapterLoadIPAdapter → IPAdapterApply → KSampler

Video

视频

PatternFlow
AnimateDiffCheckpoint → ADE_LoadAnimateDiff → ADE_Apply → KSampler → VHS_Combine
Wan t2vWanModelLoader → WanTextEncode → WanSampler → WanDecode
LTXLTXVLoader → LTXVTextEncode → LTXVSampler → LTXVDecode
v2vVHS_LoadVideo → VAEEncode → KSampler → VAEDecode → VHS_Combine
模式流程
AnimateDiffCheckpoint → ADE_LoadAnimateDiff → ADE_Apply → KSampler → VHS_Combine
Wan t2vWanModelLoader → WanTextEncode → WanSampler → WanDecode
LTXLTXVLoader → LTXVTextEncode → LTXVSampler → LTXVDecode
v2vVHS_LoadVideo → VAEEncode → KSampler → VAEDecode → VHS_Combine

Flux

Flux

PatternFlow
Flux txt2imgUNETLoader + DualCLIPLoader + VAELoader → FluxGuidance → KSampler
模式流程
Flux txt2imgUNETLoader + DualCLIPLoader + VAELoader → FluxGuidance → KSampler

Batch Scripts

批处理脚本

For multi-step edits, use batch scripts:
bash
undefined
对于多步骤编辑,可使用批处理脚本:
bash
undefined

Copy node, assign to variable

复制节点并赋值给变量

copy 1183 as $selector
copy 1183 as $selector

Set widgets

设置组件值

set $selector indexes="0:81"
set $selector indexes="0:81"

Wire using slot names

使用插槽名称连接

wire 1140:IMAGE -> $selector:image
wire 1140:IMAGE -> $selector:image

Delete nodes

删除节点

delete 1220 1228

Run with: `python we_vibin.py batch workflow.json script.txt -o out.json --dry-run`
delete 1220 1228

运行方式:`python we_vibin.py batch workflow.json script.txt -o out.json --dry-run`