consistent-pet / docs /WORKFLOW.md
bensblueprints's picture
Mirror saved portrait workflows and recovery source 1c944f19
69f59e2 verified
|
Raw History Blame Contribute Delete
13.6 kB

Feedback loop and saved workflows

One reference at a time

  1. Build a whole-animal and costume mask from the original reference artwork. Erase the former animal's exposed fur from the conditioning reference.
  2. Render using the intact original dog, its face crop and the neutralized costume guide. The editable region includes the body, so this is not a face overlay.
  3. Independently score face identity, coat distribution/texture, body anatomy and design fidelity. The local vision LLM supplies concrete visible evidence and proposed corrections alongside the four scores.
  4. Compile the critique into a new recipe. Apply dog-specific correction text only to that same dog. Adjust the repair region, relative reference resolution, sampling steps and guidance; give each attempt a deterministic new seed.
  5. Repeat on the two tuning dogs until both pass every dimension or the configured limit is reached. Keep every candidate and critique, including failed attempts.
  6. Freeze the best recipe and its generic API graph, then evaluate at least three different validation dogs. Only when tuning and validation all pass, run the final two dogs once. Their feedback never selects another recipe within this run.
  7. Save an accepted workflow only when all required dogs pass. Otherwise save the best provisional recipe and a report explaining which stages did not pass.

The target is at least nine on all four dimensions, high confidence and no major defects. Minor differences can remain at a nine. An 8.9 overall or three tens plus a body eight does not pass. The evaluator's prompt, scoring rules and weights are not modified to reach the target.

The current compiler changes an existing graph family. It does not autonomously invent arbitrary ComfyUI nodes, install models, tune the critic or train weights. Specific LLM correction text is generation evidence, never Python/shell code.

Runtime artifacts

Private path Contents
dog-revisions.json Every auto-attempt shown in the studio
reviews.sqlite3 Versioned AI assessments and optional append-only human reviews
judge-evidence/ Raw critic response, model/rubric IDs and exact image hashes
auto-refine-status.json Allowlisted summary for the page
auto-refinement/<run>/state.json Resume state, recipes, scores and stage membership
auto-refinement/<run>/jobs/ Exact submitted graphs, UUIDs and native history
auto-refinement/<run>/<reference>-frozen.json Best parameterized recipe, frozen before different-dog checks
auto-refinement/<run>/<reference>-report.json Outcomes and limitations for this reference
auto-refinement/<run>/accepted/<reference>.json Only workflows that met every required acceptance check

The frozen graph has placeholders for the dog original, face crop, costume guide, template layout, mask, seed, output prefix and input-specific prompt. Actual accepted generations remain the exact graphs in jobs/. This distinction avoids accidentally baking a tuning dog's coat description into a different dog's prompt.

portrait_autorefine.dog_instruction, apply_recipe and portrait_body_repair.repair_graph are the binding functions used for the cross-dog replays. Frozen recipes omit the tuning dog's critique text.

To export an accepted recipe for source control without images, runtime paths, dog identifiers or assessment records:

python scripts/export-accepted-workflow.py \
  --accepted /private/runtime/auto-refinement/RUN/accepted/REFERENCE.json \
  --output workflows/REFERENCE.json

The exported file is a reusable API-graph configuration. Matching model weights and the operator's reference/mask assets are still required. The exporter refuses provisional workflows and rechecks every assessment in the frozen evaluation groups before exporting, including all dogs in an expanded validation cohort.

Expanding the submitted-dog cohort

A plan can set dogs_manifest to a private JSON basename and validate_all_dogs: true. Keep the old manifest and files intact. New registry entries require id, source_sha256, input and crop; use identity_group to keep alternate photographs of a possible same dog in one split. When extending an existing evaluation, pin every entry's split to train, validation or test, preserving the earlier holdouts.

Visually reviewed inputs may include quality_tier (clear or challenging), quality_rank, quality_notes and tuning_eligible. Tuning then requires two clear, eligible training identities. Remaining training inputs and the pinned validation inputs run against the frozen recipe. Final test identities remain conditional on preceding stages passing and never drive candidate selection. Use a new version and frozen runner whenever the registry or its policy changes.

Copy the approved private registry to input-catalog.json to show its selected pet crops in the token-protected studio. The server projects display fields and allowlisted image basenames only; source hashes, split groups and audit records are not exposed. Rows carry their exact identity_crop, so new crops never silently replace the evidence used for older scores. The reviewer records that crop's checksum alongside the input, reference and output hashes.

Limits and interpretation

The catalog worker scripts/run-costume-catalog.py --repo /path/to/checkout manages a durable queue for all 725 references. It uses the resident Qwen vision model to inspect the reference, two clear training pets, previous outputs and training-only critiques. The planner selects validated sampler, reference-resolution, mask and latent-strategy changes. Its separate planning prompt cannot edit the independent scoring rubric or execute generated code. This optimizes ComfyUI workflows; it does not train model weights.

Freeze a complete copy of scripts/ before starting a version. The default resource window is 48 hours, with four candidate recipes per round and up to three consecutive training rounds before moving to the next costume. Incomplete training candidates are revisited on later catalog passes. Accepted workflows stop; multi-subject references, repeated technical failures and failed frozen cross-dog checks are retained for inspection. Held-out results never become planner feedback. Only a workflow passing all required checks is exported.

Each reference gets a sanitized status.json and REPORT.md in its own folder. The full attempts, LLM proposals and native ComfyUI IDs remain in private runtime storage. Publishing these generated reports to Git requires a separate operator or configured publisher. scripts/sync-costume-progress.py can pull the allowlisted reports through the operator's existing SSH connection and use --publish --watch-hours 48 to commit and push only those report files every five minutes. It stops on conflicts or unexpected exports; its host/key arguments stay private. The publisher requires the operator's machine and Git credentials to remain available. Do not mistake a local report for a pushed Git commit.

In the existing studio, choose Generations side by side and select a costume and dog. The horizontal slider compares successive outputs, AI scores, suggested fixes and applied changes. Human stars and notes remain available on each output.

Budget exhaustion is not success. Unimproved attempts remain visible and no below-target workflow enters the accepted directory. Time limits gate new submissions; an already running native job or a score wait can finish afterward. The default pilot caps retries rather than generating indefinitely.

AI scores can be wrong or reward artifacts they fail to notice. The held-out checks test transfer to the selected dogs, not every possible future upload. Historical pilot failures included close faces with body scores around seven. No claim that all templates reach the target is made by this repository.

Optional human-review export/report tools retain human and AI evidence separately. They prepare data for future evaluation; they do not train or deploy new weights.

Six-attempt refinement on every submitted dog

Latest owner update: qualify inputs with an independent source-only photo score of at least 7. Face visibility, fur detail and body visibility are scored 1-10; the input score is their minimum, so a clear face cannot conceal a missing body. Low-confidence/unscored sources are not accepted as qualifying evidence. Photos at 6 or below request a clearer upload; they remain visible in the viewer.

The new output acceptance thresholds are face 9, fur 9, body 7, design 9; high output confidence and no major defects remain required. These are separate minimums, not an average. This supersedes the all-9 acceptance language below for new qualified runs only. The independent output critic is unchanged. Pinned input-score snapshots prevent moving the eligibility threshold after seeing failed outputs. All qualifying dogs (minimum seven) must pass one shared recipe before export as consistent-pet-roster-recipe-v2. Reports disclose the excluded count and minimum input score. Low input quality suggests a source-photo problem; it is not proof that the generation workflow has no defect.

Owner update, 2026-10-14: the previous catalog worker tuned two dogs and evaluated the remaining dogs once. The new run-roster-catalog.py policy makes the entire submitted roster available for development. Historical evaluations are preserved.

Each failing dog gets up to six completed, independently scored renders per costume visit. The local vision LLM inspects the original, costume, failed output, and critiques before proposing a changed recipe. A passing dog stops early. After six unsuccessful attempts, other dogs still get a turn and the costume remains provisional for another catalog pass. Technical faults remain visible. The score threshold stays at 9 in every dimension, with high confidence and no major defects. Passing a mean score is insufficient.

The recipe is shared within the costume. Any change clears the current recipe's previous pass evidence and requires rechecking earlier dogs. Only one exact recipe passing every roster entry can produce a locked export. Separate per-dog passes from different recipes cannot be combined into acceptance. Native prompt IDs, output hashes, every failed generation, pass checkpoints and review history remain private and durable. Fixed per-dog seeds make recipe comparisons controlled.

These are development results on known dogs, not independent unseen-dog tests or a guarantee of perfect results. Accepted exports use consistent-pet-roster-recipe-v1 and explicitly state this distinction. The historical exporter remains unchanged. The sanitized progress publisher supports both formats and checks their acceptance fields and checksum.

Deployment uses a new frozen runner directory and queue version. Finish any in-flight native job before switching; retain the original submission deadline. Do not restart the sharing tunnel or ComfyUI. The viewer groups generations by costume and exact input, so new attempts appear in the existing dog's row.

Validation: test-portrait-roster.py tests immutable evidence and full-roster acceptance; test-roster-catalog-flow.py runs the actual controller with simulated generation/scoring to verify immediate retries, earlier-dog rechecks, the six-try limit and continued processing of other dogs. Run controller tests on Linux.

Latest owner update: accept a costume when at least 85% of the FULL qualifying input roster passes one unchanged shared recipe. Required count is ceil(0.85 * roster size): 15/17. Untested dogs are not passes. Preserve face 9, fur 9, body 7, design 9, input >=7, confidence and defect gates. v3 exports include actual passing, checked and required counts. Historical evaluations and owner visual approvals remain separate.

Round order: generate and score one image per qualifying dog on the same recipe before any revision. Evaluate the complete round; >=85% locks and advances to the next costume. Otherwise the LLM revises once, then runs another complete dog sweep, up to six rounds per catalog visit. Never combine passes from different recipes.

Latest owner change: 8/10 is sufficient for face, fur and design; body remains >=7. Full-round >=85% rule and source>=7 unchanged. New v4 runs and exports use these thresholds; historical scores and approvals remain unchanged.

Latest owner correction: acceptance is the completed-round arithmetic MEAN >=8/10, not 85% individually passing dogs. Average all four dimension scores across one image of each qualifying dog on one exact recipe. All roster entries must be scored; no mix of historical candidates, no separate dimension/confidence/defect veto. Source >=7 remains. New average-v5 policy, distinct export format; historical evaluations remain immutable.

Latest owner update: use five visually selected diverse dogs from the 17 qualifying source photos for screening. Private selected-screening-five.json is pinned per run. Render each once, accept complete five-dog mean >=8, otherwise revise and repeat. Exports identify screening_sample=true and untested qualifying count; this is not validation on all 17 dogs. Previously accepted workflows remain unchanged.