← 返回
数据分析

Comfyui Workflow

Universal ComfyUI workflow executor with 33+ workflow templates. Self-describing — use --inspect on ANY workflow to discover inputs and outputs automatically...
通用 ComfyUI 工作流执行器,附带 33+ 工作流模板。自我描述 — 在任意工作流上使用 --inspect 可自动发现输入和输出。
yiqiliu2
数据分析 clawhub v1.1.0 1 版本 99924.7 Key: 无需
★ 2
Stars
📥 1,287
下载
💾 117
安装
1
版本
#latest

概述

ComfyUI Workflows — Agent Usage Guide

> ⚠️ READ-ONLY WARNING: The scripts in this skill (comfy_run.py, comfy_api.py) are

> production-validated and must not be modified. They handle 33+ workflow JSONs with complex LiteGraph→API

> conversion, subgraph expansion, bypass resolution, and multi-format output downloading. Any modification risks

> breaking all workflows. Only read and use the scripts — never edit them.


Requirements

Before using this skill, ensure your environment meets these requirements:

RequirementDetails
----------------------
Python3.10 or higher
pip packageswebsocket-client, requests
ComfyUI serverMust be running before executing workflows
TokenRequired if ComfyUI has authentication enabled

Install Python dependencies:

pip install websocket-client requests

Configuration Options

VariableDescriptionDefault
--------------------------------
COMFY_HOSTComfyUI server address127.0.0.1:8188
COMFY_WORKFLOW_DIRSAdditional workflow directories(none)

Credentials

CredentialRequiredSource
------------------------------
ComfyUI TokenOnly if auth enabledComfyUI settings page

Personal Configuration Required

Before using this skill, ensure these items are configured for your environment:

ItemDescriptionWhere to Configure
--------------------------------------
comfy_hostYour ComfyUI server addressscripts/config.json or COMFY_HOST env
ComfyUI serverMust be running before executing workflowsStart manually
Model pathsYour local model directoriesMODELS_INVENTORY.md (for reference)
TokenComfyUI authentication tokenGet from ComfyUI settings
Workflow filesYour own workflow JSON filesworkflows/ directory (see note below)

Quick Setup

1. Start ComfyUI

Start your ComfyUI server manually before executing any workflows. The skill expects ComfyUI to be running at the configured host.

2. Configure Connection

Create scripts/config.json:

{
  "comfy_host": "127.0.0.1:8188",
  "workflow_dirs": []
}

Or set environment variables:

export COMFY_HOST="127.0.0.1:8188"

3. Install Dependencies

pip install websocket-client requests

4. Add Your Workflows

Place workflow JSON files in workflows/ directory, organized by category:

workflows/
├── Image-Text/
│   ├── workflow1.json
│   └── workflow2.json
├── Image-Edit/
│   └── ...
└── Video/
    └── ...

Shell Variables (use in all commands)

VENV=python3  # or path to your venv
SCRIPT=/path/to/comfyui-workflow-skill/scripts/comfy_run.py

End-to-End Workflow (Steps 0–5)

Step 0 — Ensure ComfyUI Is Running

Start ComfyUI manually. Verify it's accessible at http://127.0.0.1:8188.

Step 1 — List Available Workflows

$VENV $SCRIPT --list

Step 2 — Inspect the Workflow

$VENV $SCRIPT -w "workflow_name" --inspect

Step 3 — Prepare Inputs

--prompt "your prompt"           # Text prompts
--image /path/to/image.jpg       # Image inputs
--audio /path/to/audio.wav       # Audio inputs
--video /path/to/video.mp4       # Video inputs
--width 1024 --height 1024       # Resolution
--steps 50 --cfg 4.0 --seed 42   # Sampler settings
--override '{"node_id": {"key": value}}'  # Advanced overrides

Step 4 — Execute

$VENV $SCRIPT -w "workflow_name" --prompt "..." -o /tmp

Step 5 — Collect Outputs

Outputs are saved to the -o directory with auto-generated prefixes.


CLI Reference

Usage: comfy_run.py [-w WORKFLOW] [options]

Modes:
  --list              List all available workflows
  --inspect           Human-readable input/output inspection
  --inspect-json      Machine-readable JSON inspection
  --dry-run           Print API JSON without executing
  --queue             Submit to queue and return immediately
  --status [IDs...]   Check queue state

Input customization:
  --prompt, -p TEXT        Positive prompt
  --negative, -n TEXT      Negative prompt
  --image, -i PATH [...]   Input image(s)
  --audio, -a PATH [...]   Input audio file(s)
  --video, -v PATH [...]   Input video file(s)

Generation settings:
  --width, -W INT          Output width
  --height, -H INT         Output height
  --steps INT              Sampling steps
  --cfg FLOAT              CFG scale
  --seed INT               Random seed

Advanced:
  --override JSON          Node input overrides
  --config PATH            YAML/JSON config file
  --server HOST:PORT       ComfyUI server
  --output-dir, -o PATH    Output directory
  --output-prefix TEXT     Output filename prefix
  --no-ensure              Skip auto-starting ComfyUI
  --no-validate            Skip input validation

Troubleshooting

ProblemFix
--------------
Workflow not foundUse --list to see available workflows
NO OUTPUTS generatedRun --inspect to check required inputs
Cannot reach ComfyUIEnsure ComfyUI is running at configured host
Image file not foundUse absolute paths, verify with ls -la
GPU out of memoryReduce resolution or steps

Knowledge Cache Pattern

MODELS_INVENTORY.md and WORKFLOWS_SUMMARY.md serve as the agent's persistent knowledge base for the user's actual ComfyUI setup. Use them to cache learned information across sessions:

> ⚠️ DO NOT REFERENCE THE EXAMPLE CONTENT: The default content in these files describes sanitized example workflows that will NOT work. Agents MUST update them with the user's actual data before relying on them. Using outdated example data will cause workflow failures.

Initial Setup (First Time)

When the user first provides their own workflow files:

  1. Clean the example content — Remove the sanitized example entries from both files
  2. Populate with user's data — Run --inspect on each workflow, document findings in WORKFLOWS_SUMMARY.md
  3. Inventory models — Scan user's model directories, update MODELS_INVENTORY.md with their actual models

Ongoing Maintenance

  • After using a new workflow → Add its documentation to WORKFLOWS_SUMMARY.md
  • After downloading models → Update MODELS_INVENTORY.md status
  • When learning model-specific quirks → Document tips/tricks in the relevant section

Session Workflow

1. Read MODELS_INVENTORY.md → know available models
2. Read WORKFLOWS_SUMMARY.md → know workflow capabilities
3. Select appropriate workflow without re-inspecting
4. If new workflow discovered → document it for future sessions

This pattern lets the agent skip repeated discovery and work efficiently with cached knowledge.


Reference Documents

DocumentPurpose
-------------------
MODELS_INVENTORY.mdKnowledge cache — user's installed models, status, paths
WORKFLOWS_SUMMARY.mdKnowledge cache — workflow capabilities, settings, tips
references/prompting-guide.mdPrompt anatomy, model-specific strategies
references/maintenance.mdCode structure, debugging
references/architecture.mdDesign principles

版本历史

共 1 个版本

  • v1.1.0 当前
    2026-03-30 00:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 270 📥 57,027
data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 166 📥 60,239
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 368 📥 140,832