sweep
Generate workflow YAML files with parameter grid combinations for synthetic editing. Computes the Cartesian product of specified parameter ranges and outputs a workflow file that can be inspected, edited, and run with datasety workflow.
Usage
bash
# Generate workflow YAML for inspection
datasety sweep \
--input ./images --output ./sweep_output \
--prompt "add a winter hat" \
--steps 4,8,16 \
--cfg-scale 1.0,2.5,5.0 \
--seed 42 \
--output-file sweep.yaml
# Generate and immediately execute
datasety sweep \
--input ./images --output ./sweep_output \
--prompt "add a winter hat" \
--steps 4,8,16 \
--cfg-scale 1.0,2.5,5.0 \
--runOptions
| Option | Description | Default |
|---|---|---|
--input, -i | Input images directory | (required) |
--output, -o | Base output directory | (required) |
--prompt, -p | Edit prompt for synthetic command | (required) |
--steps | Comma-separated step values to sweep | |
--cfg-scale | Comma-separated CFG scale values to sweep | |
--true-cfg-scale | Comma-separated true CFG values to sweep | |
--strength | Comma-separated strength values to sweep | |
--lora | Comma-separated LoRA specs to sweep | |
--model | Comma-separated model names to sweep | |
--seed | Random seed (passed through to each step) | |
--output-format | Image format (passed through) | |
--output-file | Output YAML file path | sweep.yaml |
--run | Generate YAML and immediately execute | false |
Generated Output
Each combination gets its own output subdirectory named with parameter values:
sweep_output/
steps4_cfg1.0/
steps4_cfg2.5/
steps4_cfg5.0/
steps8_cfg1.0/
...Generated YAML
yaml
# Generated by: datasety sweep
# Total combinations: 9
# Parameters: steps=[4, 8, 16], cfg-scale=[1.0, 2.5, 5.0]
steps:
- command: synthetic
args:
input: ./images
output: ./sweep_output/steps4_cfg1.0
prompt: add a winter hat
steps: 4
cfg-scale: 1.0
seed: 42
- command: synthetic
args:
input: ./images
output: ./sweep_output/steps4_cfg2.5
prompt: add a winter hat
steps: 4
cfg-scale: 2.5
seed: 42
# ... etc for all 9 combinationsExamples
bash
# Find optimal steps for FLUX.2-klein
datasety sweep -i ./dataset -o ./sweep \
--prompt "add sunglasses" \
--steps 2,4,8,16 \
--seed 42
# Compare CFG scales
datasety sweep -i ./dataset -o ./sweep \
--prompt "add a red scarf" \
--cfg-scale 1.0,2.0,2.5,3.5,5.0
# Full grid search: steps x cfg-scale
datasety sweep -i ./dataset -o ./sweep \
--prompt "add a winter hat" \
--steps 4,8,16 \
--cfg-scale 1.0,2.5,5.0 \
--output-file grid_search.yaml
# Generate and run immediately
datasety sweep -i ./dataset -o ./sweep \
--prompt "change background to beach" \
--steps 4,8 --cfg-scale 2.0,3.0 \
--run