Skip to content
sola-ryuPublic

About

Run ComfyUI workflows from the command line. Designed for agent automation — structured JSON output on stdout, human-readable text on stderr.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

comfy-cli

Run ComfyUI workflows from the command line. Designed for agent automation — structured JSON output on stdout, human-readable text on stderr.

Quick Start

# Run a workflow (blocks until complete)
python3 run.py image "a cat sitting on a windowsill" -o ./output

# Get view URL without downloading
python3 run.py image "a cat" --no-download

Workflows

Workflow Use Case Default Model
image General purpose, style-agnostic z_image_turbo_bf16.safetensors
anime Anime/manga style NetaYumev35_pretrained_all_in_one.safetensors
sdxl SDXL-specific workflows See workflow JSON

Model Paths

Models must include the correct path prefix for ComfyUI's discovery:

  • SDXL models: SDXL/ (e.g., SDXL/realDream_sdxlPony17_fp16.safetensors)
  • Standard checkpoints: Just the filename (e.g., z_image_turbo_bf16.safetensors)
  • UNet models: unet/ prefix

Output Convention

All generated images go to:

~/.openclaw/media/tool-image-generation/

Machine-Readable Output

The script outputs JSON lines to stdout at each stage:

status meaning
submitting Job submitted, waiting on queue
queued In ComfyUI queue (includes prompt_id, queue_position)
done Complete — includes paths or urls
failed Error — includes error field with reason

Example parsing:

output=$(python3 run.py image "a cat" -o ./output 2>/dev/null)
last=$(echo "$output" | tail -1)
status=$(echo "$last" | jq -r '.status')
if [ "$status" = "done" ]; then
    echo "Files: $(echo "$last" | jq -r '.paths[]')"
fi

Recommended Models

  • z_image_turbo_bf16.safetensors — Fast, versatile, good for most use cases
  • NetaYumev35_pretrained_all_in_one.safetensors — Best anime/manga output
  • realDream_sdxlPony17_fp16.safetensors — Photo-realistic SDXL

Requirements

  • ComfyUI running locally (default: http://localhost:8188)
  • Python 3.10+
  • Models installed in your ComfyUI models directory

About

Run ComfyUI workflows from the command line. Designed for agent automation — structured JSON output on stdout, human-readable text on stderr.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages