vary_workflow
Generate multiple workflow variants by sweeping slot value lists across a ComfyUI workflow. Streams NDJSON to stdout or writes JSON files.
Instructions
Fan a frontend-format workflow out into variants over slot value lists.
Wraps comfy workflow vary <path> --slot "ADDR=[v1,v2,...]" [--slot ...],
one entry per address (from list_workflow_slots). comfy-cli ZIPS the
value lists — every list MUST be the same length.
Each slots entry may be EITHER form, mixed in one list:
Structured (preferred) —
{"address": "6.text", "values": ["a cat", "a dog"]}. Type PRESERVED EXACTLY; no quoting gotcha.String —
'6.text=["a cat", "a dog"]'. Parsed as JSON and MUST be a JSON ARRAY — a value with a comma/spaces (a prompt) must be JSON-quoted or it reads as one bare string and fails. A single value still needs its array ("3.seed=[42]", not"3.seed=42"). Pre-checked here, naming the offending entry before shelling out.
With out_dir unset (default), variants stream as NDJSON to stdout;
set it to write <stem>_<N>.json files instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slots | Yes | ||
| out_dir | No | ||
| workflow_path | Yes |