Recipe Lab - rapid tweak-and-test for Krea recipes
A small harness for iterating on recipe settings against the real Krea 2 model fast, using a mixture of agent tiers: cheap agents do the mechanical rendering; a stronger model judges whether the result achieves the recipe's intent. It turns "change a number, guess if it's better" into "change a number, render it, and get a scored verdict from images."
Pieces
| File | Role | Who runs it |
|---|---|---|
| tweak_test.py | Render engine: given a recipe (built-in label or a full tweak bundle) + reference + prompt + strength + seed, renders on the ComfyUI box and prints {name, image, metrics} as JSON. Pure mechanical work, no judgment. |
a cheap agent (Haiku), or you directly |
| style_transfer_stack_test.py | Multi-card V10 style-transfer harness: content anchor + style reference + optional away-layout guard. Used to test the repeatable style-transfer method in v10-style-transfer-method.md. | maintainer |
| style_transfer_reliability_suite.py | Fixed V10 style-transfer regression matrix: six content/style stress cases across the default and leak-control methods, with JSONL metrics and a contact sheet. | maintainer |
| style_transfer_seed_sweep.py | Seed-stability check for the recommended V10 style-transfer methods: three stress cases, two methods, three seeds each, with JSONL metrics and a contact sheet. | maintainer |
the recipe-tweak-test workflow |
Orchestrates: for each recipe, Haiku agents render the current settings + candidate tweaks in parallel, then a Fable agent reads the images and scores each against the recipe's stated intent, names the best, and recommends a change. | the Workflow tool |
| generate_guide_demos.py | Renders the V10 user-guide demo set (every recipe + the journeys) with the matching drag-in V10 workflow embedded in each PNG, and rebuilds the guide manifest + recipe-gallery contact sheet in docs/assets/krea-v10/demos/. --only <slugs> re-renders a subset; --skip-render rebuilds manifest/sheet only. |
maintainer |
| refs/ | Local copies of reference images so the judge agent can see them. | - |
| runs/ | Local copies of every rendered variant (also saved on the box under output/claude-generations/recipe-lab/). |
- |
Gotcha: dropping a brand-new custom recipe label onto the box races
ComfyUI's node-definition cache - the first /prompt after the drop can 400.
Retry once (or hit /object_info/KGKrea2ImageGuideCardV10 first to force a
refresh).
The loop
- Define the job: the recipe label, its intent in one sentence (what it
should do and what it must NOT overstep), a reference image, a content
prompt, and a list of variants to compare (the current recipe plus any
tweaks - a tweak is a full recipe bundle, e.g. a different
layersarray orglobal). - Render (cheap): one Haiku agent per variant runs
tweak_test.py. Renders serialize on the single GPU but the agent orchestration is free. - Judge (capable): one Fable agent Reads all the variant images + the reference and scores them 0-10 against the intent, picks the best, and recommends a concrete settings change if the current recipe underperforms.
- Act: apply the winning/recommended settings, re-run to confirm, commit.
Run it
Directly (one render):
python docs/recipe-lab/tweak_test.py --builtin "suggest the visual style" \
--ref layerprobe2/base.png --prompt "a plain white bowl on a wooden table" \
--strength 0.6 --seed 424242 --name style-current
As the judged workflow: invoke the recipe-tweak-test workflow (it embeds a
demo job set; pass args.jobs to test your own recipes/tweaks). Cheap agents
render, Fable judges, and the run returns per-recipe verdicts.
Requirements
- A running ComfyUI server (default
http://127.0.0.1:8188) with the V10 nodes installed and the reference images in itsinput/folder. - Renders and reference copies go to the dedicated
claude-generations/output folder; the harness only reads back what it generated.
You can point all recipe-lab scripts at another server without editing files:
KREA_COMFYUI_SERVER=http://192.0.2.10:8188 python docs/recipe-lab/tweak_test.py ...
Optional path overrides:
KREA_REFERENCE_REPO: repo root for therecipe-tweak-testworkflow.KREA_REFERENCE_SCRATCH: scratch folder for temporary recipe JSON from that workflow. Defaults todocs/recipe-lab/runs/scratchpad.KREA_REFERENCE_CUSTOM_RECIPES: where lab recipe JSON files are written for ComfyUI to discover. Defaults to the repo'scustom_recipes/folder, which is correct when this repo is installed as a ComfyUI custom node.KREA_REFERENCE_STYLE_REFS: local folder for the style-transfer reliability reference images. Defaults todocs/recipe-lab/refs/. The reliability suite will print the exact missing filenames if those larger public-domain stress references are not present in your checkout.KREA_MODEL,KREA_CLIP, andKREA_VAE: ComfyUI model filenames if your local names differ from the defaults.
Maintainer tooling - lives under docs/ (excluded from registry packs).