comfy-edit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseComfyUI 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 . Use to preview changes.
-o output.json--dry-run| Command | Purpose |
|---|---|
| Show node inputs/outputs with slot names |
| Find nodes feeding into target |
| Find nodes fed by source |
| Connect nodes |
| Duplicate a node |
| Set widget values |
| Remove nodes |
| Create new node |
| Multi-step edits |
| Run workflow in ComfyUI |
Tip: Use first to find slot numbers, then to connect.
tracewire所有编辑命令都需要参数。使用参数可预览更改。
-o output.json--dry-run| 命令 | 用途 |
|---|---|
| 显示带插槽名称的节点输入/输出 |
| 查找为目标节点提供数据的上游节点 |
| 查找由源节点提供数据的下游节点 |
| 连接节点 |
| 复制节点 |
| 设置组件值 |
| 删除节点 |
| 创建新节点 |
| 多步骤编辑 |
| 在ComfyUI中运行工作流 |
提示:先使用命令查找插槽编号,再使用命令连接节点。
tracewireAdding Nodes Workflow
添加节点的工作流
- Find the node: (use comfy-registry skill)
comfy_search("controlnet") - Get the spec: - see inputs/outputs
comfy_spec("ControlNetLoader") - Understand the flow:
python we_vibin.py trace workflow.json <ksampler_id> - 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.jsonOr 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- 查找节点:(使用comfy-registry技能)
comfy_search("controlnet") - 获取规格:- 查看输入/输出信息
comfy_spec("ControlNetLoader") - 理解流程:
python we_vibin.py trace workflow.json <ksampler_id> - 创建并连接:
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_netCommon Patterns
常见模式
What nodes go together. See references/PATTERNS.md for details.
节点组合方式详情请查看references/PATTERNS.md。
Image Generation
图像生成
| Pattern | Flow |
|---|---|
| txt2img | Checkpoint → CLIP (x2) → EmptyLatent → KSampler → VAEDecode → Save |
| img2img | LoadImage → VAEEncode → KSampler (denoise<1) → VAEDecode → Save |
| inpaint | LoadImage + Mask → VAEEncodeForInpaint → KSampler → VAEDecode |
| 模式 | 流程 |
|---|---|
| txt2img | Checkpoint → CLIP(×2)→ EmptyLatent → KSampler → VAEDecode → 保存 |
| img2img | LoadImage → VAEEncode → KSampler(降噪值<1)→ VAEDecode → 保存 |
| inpaint | LoadImage + 蒙版 → VAEEncodeForInpaint → KSampler → VAEDecode |
Enhancements
增强功能
| Pattern | Flow |
|---|---|
| ControlNet | LoadControlNet → ControlNetApply → KSampler |
| LoRA | Checkpoint → LoraLoader → KSampler |
| Upscale | LoadUpscaleModel → ImageUpscaleWithModel → Save |
| IPAdapter | LoadIPAdapter → IPAdapterApply → KSampler |
| 模式 | 流程 |
|---|---|
| ControlNet | LoadControlNet → ControlNetApply → KSampler |
| LoRA | Checkpoint → LoraLoader → KSampler |
| 超分辨率 | LoadUpscaleModel → ImageUpscaleWithModel → 保存 |
| IPAdapter | LoadIPAdapter → IPAdapterApply → KSampler |
Video
视频
| Pattern | Flow |
|---|---|
| AnimateDiff | Checkpoint → ADE_LoadAnimateDiff → ADE_Apply → KSampler → VHS_Combine |
| Wan t2v | WanModelLoader → WanTextEncode → WanSampler → WanDecode |
| LTX | LTXVLoader → LTXVTextEncode → LTXVSampler → LTXVDecode |
| v2v | VHS_LoadVideo → VAEEncode → KSampler → VAEDecode → VHS_Combine |
| 模式 | 流程 |
|---|---|
| AnimateDiff | Checkpoint → ADE_LoadAnimateDiff → ADE_Apply → KSampler → VHS_Combine |
| Wan t2v | WanModelLoader → WanTextEncode → WanSampler → WanDecode |
| LTX | LTXVLoader → LTXVTextEncode → LTXVSampler → LTXVDecode |
| v2v | VHS_LoadVideo → VAEEncode → KSampler → VAEDecode → VHS_Combine |
Flux
Flux
| Pattern | Flow |
|---|---|
| Flux txt2img | UNETLoader + DualCLIPLoader + VAELoader → FluxGuidance → KSampler |
| 模式 | 流程 |
|---|---|
| Flux txt2img | UNETLoader + DualCLIPLoader + VAELoader → FluxGuidance → KSampler |
Batch Scripts
批处理脚本
For multi-step edits, use batch scripts:
bash
undefined对于多步骤编辑,可使用批处理脚本:
bash
undefinedCopy 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`