Skill metadata
Reference: full SKILL.md
The following is the complete skill definition that Mibyan loads when this skill is triggered. This is what the agent sees as instructions when the skill is active.
ComfyUI
Generate images, video, audio, and 3D content through ComfyUI using the officialcomfy-cli for setup/lifecycle and direct REST/WebSocket API
for workflow execution.
What’s in this skill
Reference docs (references/):
official-cli.md— everycomfy ...command, with flagsrest-api.md— REST + WebSocket endpoints (local + cloud), payload schemasworkflow-format.md— API-format JSON, common node types, param mappingtemplate-integrity.md— convertingcomfyui-workflow-templatesfrom editor format to API format: Reroute bypass, dotted dynamic-input keys (values.a,resize_type.width), Cloud quirks (302 redirect, 1 concurrent free-tier job, 1080p VRAM ceiling), Discord-compatible ffmpeg stitch. Authored by @purzbeats. Load this whenever you’re starting from an official template.
scripts/):
Example workflows (
workflows/): SD 1.5, SDXL, Flux Dev, SDXL img2img,
SDXL inpaint, ESRGAN upscale, AnimateDiff video, Wan T2V. See
workflows/README.md.
When to Use
- User asks to generate images with Stable Diffusion, SDXL, Flux, SD3, etc.
- User wants to run a specific ComfyUI workflow file
- User wants to chain generative steps (txt2img → upscale → face restore)
- User needs ControlNet, inpainting, img2img, or other advanced pipelines
- User asks to manage ComfyUI queue, check models, or install custom nodes
- User wants video/audio/3D generation via AnimateDiff, Hunyuan, Wan, AudioCraft, etc.
Architecture: Two Layers
Quick Start
Detect environment
One-line health check
Core Workflow
Step 1: Get a workflow JSON in API format
Workflows must be in API format (each node hasclass_type). They come from:
- ComfyUI web UI → Workflow → Export (API) (newer UI) or the legacy “Save (API Format)” button (older UI)
- This skill’s
workflows/directory (ready-to-run examples) - Community downloads (civitai, Reddit, Discord) — usually editor format, must be loaded into ComfyUI then re-exported
nodes and links arrays) is not directly
executable. The scripts detect this and tell you to re-export.
Step 2: See what’s controllable
Step 3: Run with parameters
-1 for seed (or omitting it with --randomize-seed) generates a fresh
random seed per run.
Step 4: Present results
The scripts emit JSON to stdout describing every output file:Decision Tree
Setup & Onboarding
When a user asks to set up ComfyUI, the FIRST thing to do is ask whether they want Comfy Cloud (hosted, zero install, API key) or Local (install ComfyUI on their machine). Don’t start running install commands or hardware checks until they’ve answered. Official docs: https://docs.comfy.org/installation CLI docs: https://docs.comfy.org/comfy-cli/getting-started Cloud docs: https://docs.comfy.org/get_started/cloud Cloud API: https://docs.comfy.org/development/cloud/overviewStep 0: Ask Local vs Cloud (ALWAYS FIRST)
Suggested script:“Do you want to run ComfyUI locally on your machine, or use Comfy Cloud?Routing:Which would you like?”
- Comfy Cloud — hosted on RTX 6000 Pro GPUs, all common models pre-installed, zero setup. Requires an API key (paid subscription required to actually run workflows; free tier is read-only). Best if you don’t have a capable GPU.
- Local — free, but your machine MUST meet the hardware requirements:
- NVIDIA GPU with ≥6 GB VRAM (≥8 GB for SDXL, ≥12 GB for Flux/video), OR
- AMD GPU with ROCm support (Linux), OR
- Apple Silicon Mac (M1+) with ≥16 GB unified memory (≥32 GB recommended).
- Intel Macs and machines with no GPU will NOT work — use Cloud instead.
- Cloud → skip to Path A.
- Local → run hardware check first, then pick a path from Paths B–E based on the verdict.
- Unsure → run the hardware check and let the verdict decide.
Step 1: Verify Hardware (ONLY if user chose local)
The script also surfaces
wsl: true (WSL2 with NVIDIA passthrough) and
rosetta: true (x86_64 Python on Apple Silicon — must reinstall as ARM64).
If verdict is cloud but the user wants local, do not proceed silently.
Show the notes array verbatim and ask whether they want to (a) switch to
Cloud or (b) force a local install (will OOM or be unusably slow on modern models).
Choosing an Installation Path
Use the hardware check first. The table below is the fallback for when the user has already told you their hardware:
For the fully automated path (hardware check → install → launch → verify):
hardware_check.py internally, refuses to install locally when the
verdict is cloud (unless --force-cloud-override), picks the right
comfy-cli flag, and prefers pipx/uvx over global pip to avoid polluting
system Python.
Path A: Comfy Cloud (No Local Install)
For users without a capable GPU or who want zero setup. Hosted on RTX 6000 Pro. Docs: https://docs.comfy.org/get_started/cloud- Sign up at https://comfy.org/cloud
- Generate an API key at https://platform.comfy.org/login
- Set the key:
- Run workflows:
/api/prompt, /api/upload/*, /api/view, etc.
Path B: ComfyUI Desktop (Windows / macOS)
One-click installer for non-technical users. Currently Beta. Docs: https://docs.comfy.org/installation/desktop- Windows (NVIDIA): https://download.comfy.org/windows/nsis/x64
- macOS (Apple Silicon): https://comfy.org
Path C: ComfyUI Portable (Windows Only)
Docs: https://docs.comfy.org/installation/comfyui_portable_windows Download from https://github.com/comfyanonymous/ComfyUI/releases, extract, runrun_nvidia_gpu.bat. Update via update/update_comfyui_stable.bat.
Path D: comfy-cli (All Platforms — Recommended for Agents)
The official CLI is the best path for headless/automated setups. Docs: https://docs.comfy.org/comfy-cli/getting-startedInstall comfy-cli
Install ComfyUI
~/comfy/ComfyUI (Linux), ~/Documents/comfy/ComfyUI
(macOS/Win). Override with comfy --workspace /custom/path install.
Launch / verify
Path E: Manual Install (Advanced / Unsupported Hardware)
For Ascend NPU, Cambricon MLU, Intel Arc, or other unsupported hardware. Docs: https://docs.comfy.org/installation/manual_installPost-Install: Download Models
comfy model list.
Post-Install: Install Custom Nodes
Post-Install: Verify
Image Upload (img2img / Inpainting)
The simplest way is to use--input-image with run_workflow.py:
photo.png, then injects its server-side filename into
whatever schema parameter is named image. For inpainting, pass both:
Cloud Specifics
- Base URL:
https://cloud.comfy.org - Auth:
X-API-Keyheader (or?token=KEYfor WebSocket) - API key: set
$COMFY_CLOUD_API_KEYonce and the scripts pick it up automatically - Output download:
/api/viewreturns a 302 to a signed URL; the scripts follow it and stripX-API-Keybefore fetching from the storage backend (don’t leak the API key to S3/CloudFront). - Endpoint differences from local ComfyUI:
/api/object_info,/api/queue,/api/userdata— 403 on free tier; paid only./historyis renamed to/history_v2on cloud (the scripts route automatically)./models/<folder>is renamed to/experiment/models/<folder>on cloud (the scripts route automatically).clientIdin WebSocket is currently ignored — all connections for a user receive the same broadcast. Filter byprompt_idclient-side.subfolderis accepted on uploads but ignored — cloud has a flat namespace.
- Concurrent jobs: Free/Standard: 1, Creator: 3, Pro: 5. Extras queue
automatically. Use
run_batch.py --parallel Nto saturate your tier.
Queue & System Management
Pitfalls
-
API format required — every script and the
/api/promptendpoint expect API-format workflow JSON. The scripts detect editor format (top-levelnodesandlinksarrays) and tell you to re-export via “Workflow → Export (API)” (newer UI) or “Save (API Format)” (older UI). -
Server must be running — all execution requires a live server.
comfy launch --backgroundstarts one. Verify withcurl http://127.0.0.1:8188/system_stats. -
Model names are exact — case-sensitive, includes file extension.
check_deps.pydoes fuzzy matching (with/without extension and folder prefix), but the workflow itself must use the canonical name. Usecomfy model listto discover what’s installed. -
Missing custom nodes — “class_type not found” means a required node
isn’t installed.
check_deps.pyreports which package to install;auto_fix_deps.pyruns the install for you. -
Working directory —
comfy-cliauto-detects the ComfyUI workspace. If commands fail with “no workspace found”, usecomfy --workspace /path/to/ComfyUI <command>orcomfy set-default /path/to/ComfyUI. -
Cloud free-tier API limits —
/api/prompt,/api/view,/api/upload/*,/api/object_infoall return 403 on free accounts.health_check.pyandcheck_deps.pyhandle this gracefully and surface a clear message. -
Timeout for video/audio workflows — auto-detected when an output node
is
VHS_VideoCombine,SaveVideo, etc.; the default jumps from 300 s to 900 s. Override explicitly with--timeout 1800. -
Path traversal in output filenames — server-supplied filenames are
passed through
safe_path_jointo refuse anything escaping--output-dir. Keep this protection on — workflows with custom save nodes can produce arbitrary paths. -
Workflow JSON is arbitrary code — custom nodes run Python, so
submitting an unknown workflow has the same trust profile as
eval. Inspect workflows from untrusted sources before running. -
Auto-randomized seed — pass
seed: -1in--args(or use--randomize-seedand omit the seed) to get a fresh seed per run. The actual seed is logged to stderr. -
trackingprompt — first run ofcomfymay prompt for analytics. Usecomfy --skip-prompt tracking disableto skip non-interactively.comfyui_setup.shdoes this for you.
Verification Checklist
Usepython scripts/health_check.py to run the whole list at once. Manual:
-
hardware_check.pyverdict isokOR the user explicitly chose Comfy Cloud -
comfy --versionworks (oruvx --from comfy-cli comfy --help) -
curl http://HOST:PORT/system_statsreturns JSON -
comfy model listshows at least one checkpoint (local) OR/api/experiment/models/checkpointsreturns models (cloud) - Workflow JSON is in API format
-
check_deps.pyreportsis_ready: true(or onlynode_check_skippedon cloud free tier) - Test run with a small workflow completes; outputs land in
--output-dir

