# Godfortune Local Premium Image Loop

## Decision

Seedream, Grok Imagine, and GPT Image are visual quality references only. Studio
does not call those APIs for this loop. The production candidate must run on the
local RTX 3060 12GB server.

The first local engine is FLUX.2 Klein Base 4B FP8 with the Qwen3 4B text
encoder and FLUX.2 VAE in native ComfyUI. The base model is selected ahead of
the distilled preview model because this phase optimizes quality and later
fine-tuning flexibility, not latency.

After that hardware baseline succeeds, HiDream-O1-Image Full FP8 is the slow
quality lane. Local tests completed a 768x1344 background in 96 seconds at
8,869 MiB peak GPU use and a 2048x2048 reference character in 738 seconds at
10,989 MiB peak GPU use. It is not promoted by reputation or benchmark claims;
the stored local outputs must win the same human scorecard.

## Identity Rule

A seed is recorded for reproducibility and variation. It is not a character
identity lock.

1. Approve one neutral character master.
2. Add up to two approved views or states when identity needs more evidence.
3. Use FLUX.2 single or multi-reference editing to create new states.
4. Build an identity LoRA only for recurring characters that still fail the
   edit-consistency gate or need enough repeated output to justify training.

One-off characters do not require registration or LoRA training before use.

## Prompt Rule

Prompts separate invariants from requested changes.

- Invariants: face, hair, clothes, palette, proportions, line grammar.
- Change: one pose, expression, camera, or scene state.
- Negative prompt: empty by default.
- Add one exclusion only after the same visible defect repeats.

Long quality-tag lists and contradictory style names are prohibited.

## Two Independent Lanes

### Background

Generate a clean plate with no person, character, caption, logo, or watermark.
Score perspective, art direction, required props, action and caption zones,
character compatibility, editability, and defects. Four candidates are
generated for each qualification scene.

### Character

Generate or edit a full-body state against an approved reference. Score
identity fidelity, design appeal, face and expression, anatomy and hands,
proportion, line and color coherence, state consistency, and defects. Four
candidates are generated for each state.

Background failures do not trigger character regeneration. Character failures
do not trigger background regeneration.

## Resolution

The first background intermediate is 768x1344. FLUX.2 character state tests use
1024x1024 for fast iteration. HiDream-O1 reference editing uses its trained
approximately four-megapixel regime: the 1024x1024 control produced full-frame
noise, while 2048x2048 produced a valid full-body character. After a candidate
passes visual review, Studio compares deterministic Lanczos scaling with a
licensed local illustration upscaler before mastering to 1080x1920.

## Measured Lane Assignment

- FLUX.2 Base: research previews and fast structural experiments only.
- HiDream-O1 Full: premium background and production character-state
  candidates.
- Production character chain: direct HiDream-O1 Full reference editing at
  2048x2048. A FLUX.2 finishing pass is prohibited unless a later human review
  proves that it preserves the selected HiDream finish.
- HiDream character generation: 2048x2048 only; 1024x1024 is a recorded hard
  failure for this local workflow.
- The corrected HiDream clean background scores 94.05 internally.
- The user selected the first valid HiDream 2048 character as the
  reference-relative style score of 100. This is a workflow anchor, not a claim
  of external benchmark parity.
- The later HiDream-to-FLUX character and its five-pose pack are rejected. They
  retained pose and palette but visibly simplified the selected face, eye
  catchlights, blush, hair highlights, and soft cel shading.
- The clean background remains approved. Character-state production remains
  blocked on a direct HiDream reproduction test.

## Automatic Failure Guard

Image diagnostics measure horizontal and vertical neighbor differences on a
normalized preview. A value of 30 or more marks possible full-frame noise. The
failed 1024x1024 HiDream edit measured about 43 to 44; valid local candidates
measure about 5 to 8. This guard runs before a candidate reaches human review.

## Style Direction Correction

On 2026-07-24 the user explicitly selected `HiDream 4MP character first pass`
as the preferred character-quality anchor. Its exact file hash and engine
receipt are frozen in `approved_winners.json`, with a reference-relative score
of 100.

The previous HiDream-to-FLUX master and five-pose pack optimized the wrong
finish. Their metrics measured consistency against a flatter source rather
than preservation of the selected premium look. They are retained only as
rejected research evidence and cannot be reused as state-pack assets.

Before generating the 28-state pack, Studio must:

1. Reuse the original identity source, selected HiDream seed, short prompt
   grammar, and empty negative prompt at 2048x2048. Change only the requested
   state.
2. Compare face and eye finish, catchlights, blush, hair shape and highlights,
   soft cel shading, costume palette, proportions, anatomy, and artifacts
   against the selected reference.
3. Require a reference-relative score of at least 90, no critical-category
   regression, and explicit human approval.

Only after this reproduction gate passes may Studio expand the body poses,
expressions, mouth states, and extreme reactions. Motion research remains
paused until the corrected still-image state pack is approved.

Three neutral-front reproduction attempts established the routing rule:

- A long preservation prompt caused large multi-catchlight anime eyes plus hair
  and apron color drift.
- A short prompt against the finished HiDream render improved the palette but
  still amplified the eyes into a different face design.
- The original identity source, selected seed, short prompt grammar, and empty
  negative prompt returned to the selected character family. Its only clear
  face regression was the missing single eye catchlight.

Studio therefore treats the completed HiDream render as the quality reference,
not as the next state generator input. A deterministic layer adds one small
catchlight to each detected black oval eye without replacing or cropping the
face. The corrected neutral candidate scores a provisional 93.0 relative to
the selected reference at 100. The user approved this neutral state on
2026-07-24 and accepted large reflective or sparkling eyes as a separate comic
effect state rather than the base eye design.

This approval opens only the single-character motion qualification. It does not
approve the other 27 states, multi-character scenes, or an episode render.

## Promotion

Each lane requires a total score of at least 90, every hard constraint must
pass, and a person must select the winner. Motion research remains paused until
both still-image lanes pass.

Every run stores the model names, prompt, empty or explicit negative prompt,
seed, sampler, dimensions, elapsed time, GPU and RAM observations, source
references, workflow, and output image.
