Files
kgilper-krea-reference/docs/testing.md
T
Kevin Gilper f8e1e89611 Documentation and workflow sync: every V10 feature covered, starter-recipe example workflow added
Full V10 documentation audit pass:
- README: What V10 Adds now covers focus, the auto-loaded starter recipes,
  and the Recipe Builder; workflow table lists the new example.
- New example workflow krea-v10-starter-recipe-workflow.json: cinematic
  color grade (from the shipped starter pack) grading the scene from the
  bundled style reference - configuration render-validated on the live node.
- V10 user guide: 'Focus: recipes that study one aspect' section with the
  render-verified select/de-select evidence and limits; What V10 Adds rows;
  focus troubleshooting entry (MD + HTML, incl. the What-V10-Adds grid).
- V10 documentation index refreshed: Recipe Kit + Builder + standalone tech
  reference in Start Here, the full twenty-demo journey list (away render
  and balance pair included - no more 'pending' notes), starter-recipe
  workflow, maintainer touchpoints incl. the builder and recipe-lab.
- Stack encoder node page: deep-dive points at the standalone V10 technical
  reference; report bullet mentions the focus line.
- Testing guide: V10 smoke checklist covers starter recipes, focus report
  lines, and the Builder; demo-renders section describes the current
  twenty-journey set and its regenerator script.

All 7 example workflows parse; 57/57 tests; doc links verified.
2026-07-03 12:45:36 -04:00

64 lines
4.2 KiB
Markdown

# Testing Guide
Use this guide to validate changes with portable paths and test images created for the package.
## Local Contract Tests
These tests stub the small parts of ComfyUI needed by the V9 and V10 math and label contracts:
```bash
python -m unittest discover -s tests -p "test_*.py" -v
```
They verify:
- V9 widget labels remain stable for saved workflow compatibility, and V10 labels are the V9 labels plus appended rows only.
- Guide packets stay compatible in both directions: V9 cards work in the V10 stack and V10 cards work in the V9 stack.
- The text/logo guard supports both full prompt rewriting and gentle prompt preservation, and the V10 multilingual vocabulary rewrites Spanish/French/German/Portuguese/Italian marking words without touching English collision words.
- Per-layer conditioning math handles scalar and layer-weight composition, and the V10 direction feature negates targets with a symmetric layer clamp.
- Per-card timing rewrites phase multipliers and the blank-surface guard clamp always wins.
- The V10 balance budget scales hot stacks while preserving card ratios.
- The V10 study cache skips encoder passes on re-runs and re-studies when reuse is off.
- Custom recipe files validate against the schema: valid YAML/JSON recipes appear after the built-in dropdown choices and resolve on the card (including guard clamping and direction/timing composition), invalid files are skipped with named reasons, labels cannot shadow built-ins in either direction, and removed-recipe workflows fall back to `balanced`.
- Layer-target fallback warns when conditioning cannot split into the expected bands.
- Strength curves and timestep ranges behave predictably.
## Syntax Check
```bash
python -m compileall -q kg_krea_v9 kg_krea_v10 __init__.py
```
## Real ComfyUI Smoke Test
Before a release, install the package into a real ComfyUI `custom_nodes` folder, restart ComfyUI, and confirm these node keys appear:
```text
KGKrea2ImageGuideCardV9
KGTextEncodeKreaImageReferencesV9
KGKrea2ImageGuideCardV10
KGTextEncodeKreaImageReferencesV10
```
Then load the example workflows and replace placeholder Load Image filenames with test images created for that run. For the V10 workflows, additionally confirm:
- The stack report (Preview Any) prints per-card lines and the `Studies:` pass count.
- The prepared-references contact sheet (Preview Image) shows one treated frame per active card.
- A second queue with only a strength change reports zero new encoder passes when `Reuse image studies` is on.
- The counter-example workflow's away card is marked in the report with negative targets.
- The three starter recipes (`borrow the weather`, `borrow the clothing style`, `cinematic color grade`) appear in `Use image for` out of the box, and the starter-recipe workflow queues cleanly.
- A recipe with a `focus` prints `Focus: ...` on its report card line.
- The Recipe Builder is served at `/extensions/<pack folder>/recipe-builder.html` and its downloaded files validate (drop one in `custom_recipes/`, refresh node definitions, confirm it appears).
## V10 Demo Renders (release checklist)
The V10 demo set (twenty journeys: one demo per built-in recipe - the twelve-recipe gallery with its labeled contact sheet - plus the palette before/after pair, the timing pair, the three-step direction journey including the away render, and the balance off/gentle showcase pair) lives under `docs/assets/krea-v10/demos/` with per-demo settings in its `guide-demo-manifest.json`. Every demo was rendered through the real V10 nodes with the current recipe tuning; each PNG embeds the exact V10 workflow that rendered it.
To regenerate after a recipe change: `python docs/recipe-lab/generate_guide_demos.py` (renders on the configured ComfyUI box, re-embeds workflows, and rebuilds the manifest and the recipe-gallery contact sheet; `--only <slugs>` re-renders a subset).
## Test Images
- Use images generated specifically for the test, public-domain fixtures, or images explicitly provided for the test.
- Keep generated test inputs and outputs outside the git repo, or under ignored local folders such as `input/`, `output/`, or `temp/`.
- Do not commit generated images unless they are intentionally curated public documentation assets.