AGENT SKILL

cli-export

Export ComfyUI API workflows to Python and troubleshoot the generated script runtime.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
cli-export
license
MIT
metadata
{ "disco-role": "operating" }
description
Export ComfyUI API workflows to Python and troubleshoot the generated script runtime.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

CLI Export and Generated Script Runtime

Use this sub-skill when the task is about converting workflow_api.json into Python or understanding the standalone script that the exporter produces.

Typical user requests

  • Convert an exported ComfyUI workflow to a Python script.
  • Run the exporter from the command line.
  • Explain or debug the generated Python file.
  • Check why a generated script cannot find ComfyUI, torch, or a model file.
  • Understand how node ordering, seed sync, cleanup, or custom-node loading works.
  • Create or run a small export smoke test.

What this sub-skill owns

  • comfyui_to_python/ package behavior.
  • The CLI parser and python -m comfyui_to_python entry point.
  • Generated script layout, bootstrap, cleanup, and queue execution.
  • Workflow loading, load-order planning, and renderer output.
  • Generated-script troubleshooting for COMFYUI_PATH, torch, black, custom nodes, and model/runtime issues.

What this sub-skill excludes

  • Installing the repo as a ComfyUI custom node.
  • The browser File -> Save As Script button and /saveasscript route.
  • Frontend menu behavior or ComfyUI discovery mechanics beyond what the exporter needs at runtime.

Read these first

Workflow

  1. Confirm that the user has an API-format workflow or wants the exporter to produce one.
  2. Use the CLI when the user wants a file-based export, or use ComfyUItoPython(...) programmatically when they are scripting the export.
  3. If ComfyUI is not already discoverable, set COMFYUI_PATH before running the exported Python.
  4. Make sure black is available in the runtime that renders the script.
  5. If the user needs the generated script to unload models after each run, explain COMFYUI_TOPYTHON_UNLOAD_MODELS=1 or main(unload_models=True).
  6. Use the smoke script for quick validation before you move to heavier runtime checks.

Routing hints

Choose this sub-skill when you see any of these signals:

  • workflow_api.json
  • workflow_api.py
  • python -m comfyui_to_python
  • comfyui_to_python.py
  • --input_file, --output_file, or --queue_size
  • COMFYUI_PATH
  • No module named 'torch'
  • custom node import errors during generated-script execution
  • cleanup_comfyui_runtime
  • bootstrap_comfyui_runtime
  • File -> Export (API)

What the generated script does

The exported Python is a standalone workflow runner, not a generic API service. It:

  • embeds the workflow and optional frontend metadata
  • bootstraps ComfyUI before importing torch
  • loads ComfyUI model paths and custom nodes when needed
  • executes the workflow in a bounded queue loop
  • performs best-effort cleanup in a finally block

Success criteria

A future agent should be able to:

  • export a workflow to a Python file,
  • understand the key sections in the generated source,
  • explain why the script needs a ComfyUI runtime,
  • and diagnose the common runtime failures without reopening the original repository.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351