VibeComfy
VibeComfy is this package: a Python-first way to drive ComfyUI without hand-editing JSON. The center of gravity is VibeWorkflow: load a workflow, edit it in Python, validate it, then compile to ComfyUI API JSON and run it.
Use this umbrella skill for orientation and package rules. For real work, route to the smallest focused skill:
| User wants |
Use |
| Configure ComfyUI paths, server URL, custom nodes, or models |
vibecomfy-setup |
| Find a workflow, precedent, node wiring, or Hivemind evidence |
search-comfy-workflows |
| Explain what a workflow does or answer questions about it |
explain-comfy-workflow |
| Clean up, regroup, or align a ComfyUI workflow layout without changing runtime behavior |
reorganise-comfy-workflow |
| Tweak or rewrite a workflow without running it |
edit-comfy-workflow |
| Execute a ready template, recipe, scratchpad, server run, or RunPod smoke |
run-comfy-workflow |
| Diagnose validation, conversion, node/model, or runtime failures |
debug-comfy-workflow |
| Add a durable package ready template |
add-comfy-workflow-template |
The operating path is:
discover -> load_bundle -> edit/compose -> validate -> compile("api") -> run -> collect outputs
For a reusable source-to-Python onboarding path, including provenance and honest
import/runtime blockers, see workflow onboarding.
First Moves
Work from the repo root. Prefer the vibecomfy ... console entrypoint; if an editable checkout has no console script, use python -m vibecomfy.cli ....
For a runnable starting point:
vibecomfy workflows list --ready
vibecomfy inspect image/z_image
vibecomfy copy-to-recipe image/z_image --out recipes/my_run.py
vibecomfy validate recipes/my_run.py
vibecomfy run recipes/my_run.py --runtime server --server-url http://127.0.0.1:8188
For raw JSON:
vibecomfy port check workflow.json --json
vibecomfy port convert workflow.json --out out/scratchpads/workflow.py --json
vibecomfy validate out/scratchpads/workflow.py
For setup trouble:
vibecomfy config show --json
vibecomfy runtime doctor
Authoring Model
Use one loader by default:
from vibecomfy.cli_loader import load_bundle
def build():
wf = load_bundle("image/z_image").workflow
wf.set_prompt("a glass teapot on basalt")
wf.set_seed(42)
wf.set_steps(20)
return wf.finalize_metadata()
Choose the lightest edit shape:
| Shape |
Use when |
VibeWorkflow setters/direct methods |
You are changing existing prompt, seed, steps, widgets, edges, or metadata. |
| Patches |
You are decorating an existing graph without changing the public handle shape. |
| Blocks |
You are adding graph structure that produces new handles. |
| Recipes |
You are making a user-specific composition or chaining logic. |
| Ready templates |
You are adding a durable package starting point by id. |
Keep ComfyUI's terms precise: a workflow is any graph; a template is a curated starting-point workflow under ready_templates/.
Rules
- Treat raw UI/API JSON as import evidence. Load the canonical Python candidate through
load_bundle() before editing or running.
- Treat the worktree as shared. Do not revert, overwrite, or clean up edits you did not make.
- Keep changes scoped to the requested workflow, command, template, or doc surface.
- Do not change runtime behavior, workflow corpus files, generated snapshots, or template manifests unless the task explicitly covers them.
- Never invent node class names, sockets, widget fields, or model layouts. Use
inspect, analyze info, nodes spec, local precedents, or search-comfy-workflows.
- Sync indexes only when needed:
vibecomfy sources sync.
- Add focused tests when changing command routing, parser behavior, conversion, validation, search, runtime-facing code, or template coverage.
- Keep tests deterministic; avoid requiring ComfyUI, RunPod, network, or local model files unless the test is explicitly marked for that environment.
Agent-Edit Policy
- Prefer normal static graph edits first.
- Use
vibecomfy.loop only for bounded visible sweeps that cannot lower cleanly to ordinary nodes. Keep iteration counts bounded and metadata typed.
- Use
vibecomfy.code only for inspectable typed logic when no shipped shape fits. Default to sandboxed modes. Never emit unrestricted execution from agent-authored code.
- Reject side-effecting, unbounded, runtime-only, external-I/O, or otherwise unrepresentable requests at policy level.
- Editor-only intent nodes may be valid for Canvas Apply, but they are Queue blockers until lowered to normal runtime nodes.
- When emitting an intent node programmatically, build metadata with
intent_node_properties(...).
When You Need More Detail
Schema Capture and Preflight (Batch E)
Missing schema captures block preflight — the harness fails closed and tells you exactly how to provision:
vibecomfy schemas ensure --manifest <comparison-manifest.json>
What the command does (no parallel schema system, compose only):
- Registry → ephemeral clone → extraction ladder → cache + provenance tier. Registry resolves the owning pack (
pack_resolver), a shallow clone is materialized in the LRU-bounded sandbox ~/.cache/vibecomfy/schema-sandbox (max 64 packs / 2 GiB), then extract_pack_schemas runs rung 1 (static AST) and rung 2 (stubbed-subprocess INPUT_TYPES — always on for this command). Rung 3 (embedded comfy-as-library) is deferred; the command fails closed if a class needs it.
- Persist with honest tier.
persist_on_demand_pack stamps source_kind as on_demand_static (rung 1) or on_demand_import (rung 2), writes Pack@on_demand_*-{sha7}.json (never @runpod-snapshot or @stub.json), and attests provenance.json with repo, locked_commit (clone HEAD), extraction_rung, registry_pack_version, source_kind, schema_sha256.
How preflight accepts it:
- Declarations accepted:
authoritative_object_info | on_demand_static | on_demand_import | on_demand_embedded. Preflight requires the declared source to match the cache entry's source_kind exactly — no silent upgrades (on_demand_static does not satisfy authoritative_object_info, on_demand_import does not satisfy on_demand_static).
@stub.json / workflow_json_stub never counts as evidence (filtered and stub-rejected even if indexed).
- Campaign-grade strict lane:
VIBECOMFY_OBLIGATION_RUNTIME_ONLY=1 rejects any on_demand_* declaration — runtime-family captures only.
Discovering the command:
vibecomfy schemas validate-coverage --manifest <m> --json reports missing_classes and ensure_command (vibecomfy schemas ensure --manifest <m>); it exits 1 when --manifest and gaps exist (template positional keeps exit 0 for back-compat).
vibecomfy doctor <workflow.py> on unknown_class_type / missing schema prints vibecomfy schemas ensure <workflow.py> and the generic vibecomfy schemas ensure --manifest <comparison.json> hint. Doctor never clones or extracts — reporting only.
Read REFERENCE.md for the API surface, layer model, command catalog, plugin hooks, known limitations, RunPod environment, and durable-template checklist.
In-repo references:
docs/authoring.md — blocks, patches, handles, opaque subgraphs, recipes
docs/vibeworkflow.md — IR contract
docs/api/m6-public-api.md — public imports and compatibility aliases
docs/custom_nodes.md — node packs, install/lock/restore
docs/runtime/lifecycle.md, docs/runtime/surface.md — embedded vs server runtime
docs/errors_and_doctor.md — what doctor flags and how to fix it
docs/templates/adding_templates_models.md — full ready-template addition process
When in doubt, stay in Python and descend only as far as needed:
op -> Artifact -> preview_workflow -> VibeWorkflow -> compile("api") -> run
1---2name: vibecomfy3description: Drive the VibeComfy package to discover ComfyUI workflows, load ready Python templates, edit and compose them in a `VibeWorkflow` IR, validate, and execute either embedded locally, against an existing ComfyUI server, or on RunPod. Use whenever the user wants to generate images/video/audio/edits from ComfyUI workflows, tweak templates, build recipes, compose graphs in Python, or run existing `ready_templates` end-to-end.4---56# VibeComfy78VibeComfy is this package: a Python-first way to drive ComfyUI without hand-editing JSON. The center of gravity is `VibeWorkflow`: load a workflow, edit it in Python, validate it, then compile to ComfyUI API JSON and run it.910Use this umbrella skill for orientation and package rules. For real work, route to the smallest focused skill:1112| User wants | Use |13|---|---|14| Configure ComfyUI paths, server URL, custom nodes, or models | `vibecomfy-setup` |15| Find a workflow, precedent, node wiring, or Hivemind evidence | `search-comfy-workflows` |16| Explain what a workflow does or answer questions about it | `explain-comfy-workflow` |17| Clean up, regroup, or align a ComfyUI workflow layout without changing runtime behavior | `reorganise-comfy-workflow` |18| Tweak or rewrite a workflow without running it | `edit-comfy-workflow` |19| Execute a ready template, recipe, scratchpad, server run, or RunPod smoke | `run-comfy-workflow` |20| Diagnose validation, conversion, node/model, or runtime failures | `debug-comfy-workflow` |21| Add a durable package ready template | `add-comfy-workflow-template` |2223The operating path is:2425```text26discover -> load_bundle -> edit/compose -> validate -> compile("api") -> run -> collect outputs27```2829For a reusable source-to-Python onboarding path, including provenance and honest30import/runtime blockers, see [workflow onboarding](../guides/workflow-onboarding.md).3132## First Moves3334Work from the repo root. Prefer the `vibecomfy ...` console entrypoint; if an editable checkout has no console script, use `python -m vibecomfy.cli ...`.3536For a runnable starting point:3738```bash39vibecomfy workflows list --ready40vibecomfy inspect image/z_image41vibecomfy copy-to-recipe image/z_image --out recipes/my_run.py42vibecomfy validate recipes/my_run.py43vibecomfy run recipes/my_run.py --runtime server --server-url http://127.0.0.1:818844```4546For raw JSON:4748```bash49vibecomfy port check workflow.json --json50vibecomfy port convert workflow.json --out out/scratchpads/workflow.py --json51vibecomfy validate out/scratchpads/workflow.py52```5354For setup trouble:5556```bash57vibecomfy config show --json58vibecomfy runtime doctor59```6061## Authoring Model6263Use one loader by default:6465```python66from vibecomfy.cli_loader import load_bundle6768def build():69 wf = load_bundle("image/z_image").workflow70 wf.set_prompt("a glass teapot on basalt")71 wf.set_seed(42)72 wf.set_steps(20)73 return wf.finalize_metadata()74```7576Choose the lightest edit shape:7778| Shape | Use when |79|---|---|80| `VibeWorkflow` setters/direct methods | You are changing existing prompt, seed, steps, widgets, edges, or metadata. |81| Patches | You are decorating an existing graph without changing the public handle shape. |82| Blocks | You are adding graph structure that produces new handles. |83| Recipes | You are making a user-specific composition or chaining logic. |84| Ready templates | You are adding a durable package starting point by id. |8586Keep ComfyUI's terms precise: a **workflow** is any graph; a **template** is a curated starting-point workflow under `ready_templates/`.8788## Rules8990- Treat raw UI/API JSON as import evidence. Load the canonical Python candidate through `load_bundle()` before editing or running.91- Treat the worktree as shared. Do not revert, overwrite, or clean up edits you did not make.92- Keep changes scoped to the requested workflow, command, template, or doc surface.93- Do not change runtime behavior, workflow corpus files, generated snapshots, or template manifests unless the task explicitly covers them.94- Never invent node class names, sockets, widget fields, or model layouts. Use `inspect`, `analyze info`, `nodes spec`, local precedents, or `search-comfy-workflows`.95- Sync indexes only when needed: `vibecomfy sources sync`.96- Add focused tests when changing command routing, parser behavior, conversion, validation, search, runtime-facing code, or template coverage.97- Keep tests deterministic; avoid requiring ComfyUI, RunPod, network, or local model files unless the test is explicitly marked for that environment.9899## Agent-Edit Policy100101- Prefer normal static graph edits first.102- Use `vibecomfy.loop` only for bounded visible sweeps that cannot lower cleanly to ordinary nodes. Keep iteration counts bounded and metadata typed.103- Use `vibecomfy.code` only for inspectable typed logic when no shipped shape fits. Default to sandboxed modes. Never emit unrestricted execution from agent-authored code.104- Reject side-effecting, unbounded, runtime-only, external-I/O, or otherwise unrepresentable requests at policy level.105- Editor-only intent nodes may be valid for Canvas Apply, but they are Queue blockers until lowered to normal runtime nodes.106- When emitting an intent node programmatically, build metadata with `intent_node_properties(...)`.107108## When You Need More Detail109110## Schema Capture and Preflight (Batch E)111112Missing schema captures block preflight — the harness fails closed and tells you exactly how to provision:113114```bash115vibecomfy schemas ensure --manifest <comparison-manifest.json>116```117118What the command does (no parallel schema system, compose only):119120- **Registry → ephemeral clone → extraction ladder → cache + provenance tier.** Registry resolves the owning pack (`pack_resolver`), a shallow clone is materialized in the LRU-bounded sandbox `~/.cache/vibecomfy/schema-sandbox` (max 64 packs / 2 GiB), then `extract_pack_schemas` runs rung 1 (static AST) and rung 2 (stubbed-subprocess `INPUT_TYPES` — always on for this command). Rung 3 (embedded comfy-as-library) is deferred; the command fails closed if a class needs it.121- **Persist with honest tier.** `persist_on_demand_pack` stamps `source_kind` as `on_demand_static` (rung 1) or `on_demand_import` (rung 2), writes `Pack@on_demand_*-{sha7}.json` (never `@runpod-snapshot` or `@stub.json`), and attests `provenance.json` with `repo`, `locked_commit` (clone HEAD), `extraction_rung`, `registry_pack_version`, `source_kind`, `schema_sha256`.122123How preflight accepts it:124125- Declarations accepted: `authoritative_object_info` | `on_demand_static` | `on_demand_import` | `on_demand_embedded`. Preflight requires the declared `source` to match the cache entry's `source_kind` exactly — no silent upgrades (`on_demand_static` does not satisfy `authoritative_object_info`, `on_demand_import` does not satisfy `on_demand_static`).126- `@stub.json` / `workflow_json_stub` never counts as evidence (filtered and stub-rejected even if indexed).127- Campaign-grade strict lane: `VIBECOMFY_OBLIGATION_RUNTIME_ONLY=1` rejects any `on_demand_*` declaration — runtime-family captures only.128129Discovering the command:130131- `vibecomfy schemas validate-coverage --manifest <m> --json` reports `missing_classes` and `ensure_command` (`vibecomfy schemas ensure --manifest <m>`); it exits 1 when `--manifest` and gaps exist (template positional keeps exit 0 for back-compat).132- `vibecomfy doctor <workflow.py>` on `unknown_class_type` / missing schema prints `vibecomfy schemas ensure <workflow.py>` and the generic `vibecomfy schemas ensure --manifest <comparison.json>` hint. Doctor never clones or extracts — reporting only.133134135Read [REFERENCE.md](REFERENCE.md) for the API surface, layer model, command catalog, plugin hooks, known limitations, RunPod environment, and durable-template checklist.136137In-repo references:138139- `docs/authoring.md` — blocks, patches, handles, opaque subgraphs, recipes140- `docs/vibeworkflow.md` — IR contract141- `docs/api/m6-public-api.md` — public imports and compatibility aliases142- `docs/custom_nodes.md` — node packs, install/lock/restore143- `docs/runtime/lifecycle.md`, `docs/runtime/surface.md` — embedded vs server runtime144- `docs/errors_and_doctor.md` — what `doctor` flags and how to fix it145- `docs/templates/adding_templates_models.md` — full ready-template addition process146147When in doubt, stay in Python and descend only as far as needed:148149```text150op -> Artifact -> preview_workflow -> VibeWorkflow -> compile("api") -> run151```