一键导入
workflow-edit
Edit ComfyUI workflow JSON using WorkflowEditor utility. Use when modifying nodes, links, widget values, or subgraph internals in workflow files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Edit ComfyUI workflow JSON using WorkflowEditor utility. Use when modifying nodes, links, widget values, or subgraph internals in workflow files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Canonical first-pass when a ComfyUI-AudioLoopHelper workflow won't run or fails validation. Use when the user mentions "workflow won't run", "dependency cycle detected", "validation failed", "Failed to convert ... to INT", "control_after_generate", or describes a recent ComfyUI render that didn't get past prompt validation, or reports a loop/full-song render that is pathologically slow or re-encodes (text-encode / audio / keyframe) every iteration. Runs the canonical diagnosis (ComfyUI log tail, audit, DAG inspection, exec log review, launch-flag check for --cache-none) BEFORE any inline orjson scripting. Reference: docs/reference/debug_tools.md.
Structural diff of two ComfyUI workflow JSON files — node types, widget values, link topology, subgraph schemas — with noise filtered out (link IDs, node positions, ordering). Use when debugging "why does workflow A behave differently than B" or verifying a migration script produced the intended shape change.
Generate an LTX 2.3 prompt that makes a character speak SPECIFIC dialogue, formatted per the official LTX 2.3 prompt guide (short quoted segments with acting directions between, accent, acoustic environment). Use when the user wants to put words in a character's mouth for the AV inversion / one-pass / keyframe workflows (voice-cloned dubbing, dialogue replacement).
Scaffold a new scripts/apply_*.py workflow migration script from scripts/templates/, enforcing the project's idempotence + paired-audit-check convention. Use when adding a new fix that mutates example_workflows/*.json or stages an experimental variant.
Dispatch three parallel Explore agents to validate a structural refactor BEFORE writing changes. Use when the user proposes restructuring multiple CLAUDE.md / docs / agent / skill files (signal: ≥ 3 files, ≥ 2 different concerns), or when planning a curation pass on documentation. Cost ~30s of agent time; turns vague "compress this" into a concrete edit list and prevents premature subtree splits.
Analyze audio file for music video prompt scheduling. Picks the right analyzer (ffmpeg-only for quick energy/structure, librosa for BPM/key/F0/JSON-export-for-LLM), and outputs a prompt schedule template with timestamps. Also works on generated audio for diagnostic comparison.
| name | workflow-edit |
| description | Edit ComfyUI workflow JSON using WorkflowEditor utility. Use when modifying nodes, links, widget values, or subgraph internals in workflow files. |
Edit ComfyUI workflow JSON files programmatically using the WorkflowEditor utility.
import sys
from pathlib import Path
# Resolve scripts/ relative to the project root (works regardless of CWD)
_project_root = Path(__file__).resolve().parent if '__file__' in dir() else Path.cwd()
sys.path.insert(0, str(_project_root / 'scripts'))
from workflow_utils import WorkflowEditor
ed = WorkflowEditor('example_workflows/audio-loop-music-video_image.json')
Or if running inline via python3 -c:
import sys
sys.path.insert(0, 'scripts')
from workflow_utils import WorkflowEditor
ed = WorkflowEditor('example_workflows/audio-loop-music-video_image.json')
ed.print_node_summary(843)
ed.trace_forward(1507) # follow output chain
ed.trace_node_inputs(161) # show all inputs
n = ed.find_node(531)
n['widgets_values'] = ['2', 1, 0, 1, -1]
ed.find_node(1558)['mode'] = 4 # bypass
ed.find_node(1588)['mode'] = 0 # activate
Prefer rewire_input for the common "replace whatever feeds an input slot" pattern — it's idempotent and handles the remove+add in one call:
ed.rewire_input(tgt_node=1587, tgt_slot=0, new_src=1588, new_src_slot=0, dtype="CONDITIONING")
Manual splice only when you need to insert a new node between two existing ones (remove one link, add two):
ed.remove_link(2906)
ed.add_link(1588, 0, new_node_id, 0, "CONDITIONING")
ed.add_link(new_node_id, 0, 1587, 0, "CONDITIONING")
Lookup first if you don't have the link id:
row = ed.find_link_to_slot(tgt_node=1587, tgt_slot=0) # returns [id, src, src_slot, tgt, tgt_slot, type] or None
sg_node = ed.find_subgraph_node(606) # find node inside subgraph
ed.remove_subgraph_link(1782) # remove internal link
n = WorkflowEditor.make_node(1589, "LatentUpscaleModelLoader", [4500, 5800],
widgets=["ltx-2.3-spatial-upscaler-x2-1.0.safetensors"],
title="Load Spatial Upscaler 2x")
ed.add_node(n)
ed.remove_node_and_links(1596) # detaches every link touching the node, then removes it
Callers must re-wire any surviving slots before use — the helper only detaches.
ed.save() # quiet
ed.save('out.json', verbose=True) # prints "Saved to ..."
Validation runs automatically via PostToolUse hook on workflow JSON writes. To run manually:
python3 scripts/test_workflow_integrity.py example_workflows/*.json
[id, src, src_slot, tgt, tgt_slot, type]{id, origin_id, origin_slot, target_id, target_slot, type}wf['definitions']['subgraphs'][0][num, str1, str2, ..., idx1, idx2, ...]
Strengths first, indices second. NOT interleaved. Example: ['2', 1.0, 0.5, 0, -1]