AgentSkillsCN

comfyui

在Windows上运行ComfyUI以生成图像。当被要求创作、生成或渲染图像、艺术作品、照片、插画或其他各类视觉内容时,可使用此方法。需在Windows上运行ComfyUI,并通过`--listen 0.0.0.0`启动服务。

SKILL.md
--- frontmatter
name: comfyui
description: Generate images with ComfyUI running on Windows. Use when asked to create, generate, or render images, artwork, photos, illustrations, or any visual content. Requires ComfyUI running on Windows with --listen 0.0.0.0.

ComfyUI Skill

Generate images via the ComfyUI API running on Windows, accessible from WSL2.

Prerequisites

  1. ComfyUI running on Windows with --listen 0.0.0.0
  2. Accessible via host.docker.internal:8188 from WSL2

Quick Check

bash
python3 skills/comfyui/scripts/comfy_client.py status

Generate Images

Simple generation (uses dreamshaperXL Turbo preset by default)

bash
python3 skills/comfyui/scripts/generate.py "a robot sentinel guarding a castle at sunset"

With specific preset

bash
python3 skills/comfyui/scripts/generate.py "prompt" -m juggernautXL
python3 skills/comfyui/scripts/generate.py "prompt" -m flux
python3 skills/comfyui/scripts/generate.py "prompt" -m flux2
python3 skills/comfyui/scripts/generate.py "prompt" -m cyberrealistic
python3 skills/comfyui/scripts/generate.py "prompt" -m architecture

Full control

bash
python3 skills/comfyui/scripts/generate.py "prompt" \
    -m dreamshaperXL \
    -W 1024 -H 768 \
    -s 12 -c 2.5 \
    --seed 42 \
    -o /path/to/output

List presets

bash
python3 skills/comfyui/scripts/generate.py "" --list-presets

Available Presets

PresetModelTypeResolutionStepsSpeed
dreamshaperXLDreamShaper XL TurboSDXL1024x10248⚡ Fast
juggernautXLJuggernaut XL LightningSDXL1024x10246⚡ Fast
cyberrealisticXLCyberRealistic XLSDXL1024x102425Normal
zavychromaZavyChroma XLSDXL1024x102425Normal
sdxlSD XL BaseSDXL1024x102425Normal
fluxFlux.1 Dev FP8Flux1024x102420🎨 Hochwertig
fluxFastFlux.1 Dev SmallFlux1024x102420⚡ Schneller
flux2Flux 2 Dev FP8 MixedFlux1024x102420🆕 Neueste
cyberrealisticCyberRealistic v6SD1.5512x51230Normal
dreamshaperDreamShaper 8SD1.5512x51230Normal
realisticVisionRealistic Vision 6SD1.5512x76830Normal
architectureArchitecture RealMixSD1.5512x51230🏠 Architektur

Model Selection Guide

  • Best Quality: flux, flux2 (Flux-Architektur, beste Prompt-Adherence)
  • Photorealism: juggernautXL, cyberrealisticXL, cyberrealistic
  • Creative/Artistic: dreamshaperXL, zavychroma
  • Architecture: architecture
  • Speed priority: dreamshaperXL (8 steps), juggernautXL (6 steps)
  • Flux (schneller): fluxFast (weniger VRAM)

Custom Workflows

Place workflow JSON files in skills/comfyui/workflows/ and run:

bash
python3 skills/comfyui/scripts/comfy_client.py generate workflows/my_workflow.json

Output

Generated images are saved to /home/mcmuff/clawd/output/comfyui/ by default.

Workflow

  1. Check if ComfyUI is running: comfy_client.py status
  2. If not reachable, ask user to start ComfyUI with --listen 0.0.0.0
  3. Generate image with appropriate preset for the request
  4. Show the generated image to the user using the image tool

Scripts

ScriptPurpose
comfy_client.pyLow-level API client (status, queue, generate from JSON)
generate.pyHigh-level generator with presets and CLI args