Img-gen
Behavior when invoked
When user invokes $img-gen, do the full run automatically:
- Run dependency preflight (
scripts/check_deps.py). If it fails, tell user to install fromrequirements.txt. - Read
config.json. - Build jobs file.
- Generate images in-session for all jobs using solid key-color background prompt instructions.
- Run script-based transparency processing on outputs.
- Strictly verify alpha and fail if any file is not truly transparent.
- Regenerate only failed/missing jobs and repeat steps 5-6 until pass.
Modes
auto: edge-connected background removal (enforce_transparency.py).chroma: key-color removal + edge de-spill (chroma_to_alpha.py).
Default mode for $img-gen is chroma with anti-fringe settings:
--threshold 55--edge-softness 16--despill-strength 1.0
Dependencies
Install before first run:
pip install -r requirements.txt
If you use uv:
uv pip install -r requirements.txt
Files
config.json: run settings.scripts/make_jobs.py: creates deterministicjobs.json.scripts/check_deps.py: dependency preflight with install instructions.scripts/enforce_transparency.py: connected background to alpha.scripts/chroma_to_alpha.py: chroma-to-alpha with de-spill.scripts/verify_alpha.py: strict alpha checks.scripts/finalize_run.py: one command for process + verify.
Variation Level
Set variation_level in config.json:
low: subtle differences.medium: clearly different pose/camera/expression while preserving style.high: stronger compositional differences. Usesubjectsandimages_per_subjectin config. Setskip_existingtotrueto generate only missing output files. Keep good images, delete rejected images, then rerun job creation to fill the gaps. Set it tofalseto create jobs for every configured output, including files that already exist. Usecanvas_sizeobject to set final output canvas dimensions:
"canvas_size": {
"width": 2624,
"height": 3152
}
Set final_size to upscale after transparency cleanup and verification:
"final_size": {
"width": 4500,
"height": 5400,
"dpi": 300
}
Standard commands
python3 scripts/make_jobs.py --config config.json --out output/jobs.json
python3 scripts/finalize_run.py --jobs output/jobs.json --report output/alpha_report.json --mode chroma --key-color '#00FF00' --threshold 55 --edge-softness 16 --despill-strength 1.0