Skip to content

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 \
    --run

Options

OptionDescriptionDefault
--input, -iInput images directory(required)
--output, -oBase output directory(required)
--prompt, -pEdit prompt for synthetic command(required)
--stepsComma-separated step values to sweep
--cfg-scaleComma-separated CFG scale values to sweep
--true-cfg-scaleComma-separated true CFG values to sweep
--strengthComma-separated strength values to sweep
--loraComma-separated LoRA specs to sweep
--modelComma-separated model names to sweep
--seedRandom seed (passed through to each step)
--output-formatImage format (passed through)
--output-fileOutput YAML file pathsweep.yaml
--runGenerate YAML and immediately executefalse

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 combinations

Examples

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

Released under the MIT License.