---
reliability: 4.5 # computed: 5.0 − 0.2 (kontext anchor edit) − 0.3 (6-panel image batch); caption/grid/banner are deterministic ffmpeg/hyperframes (−0.0); 4 stages, no overflow; no E2E showcase bonus
---

# Animated comic page — agent playbook

> Paste this whole file (with the BRIEF filled in) into Claude cowork, chat, or Code. The agent walks through it with you and stops for your approval at every step that matters. **This is the single biggest pain in AI comic creation today, solved.** Six panels. Character LOCKED across every one. Dialog bubbles lettered cleanly. Composed onto a single page in 20 minutes for under $3. The page you can actually publish without a reader noticing the protagonist changed faces between panels 3 and 5.

## What you'll get

A finished comic page assembled the way a manga assistant or comic letterer assembles one — character anchor first, panel composition second, dialog lettering third, page composition last:

- **Character anchor lock** — protagonist held by LoRA reference or kontext-edit anchor. The face that survives every panel.
- **6 panel renderings** — each panel composed from your one-sentence description, with character + style + palette injected as constraints. Anchored consistency is the whole point.
- **Lettered dialog bubbles** — `hyperframes-caption` applied per panel for clean speech-bubble text. AI-rendered bubble text is the most-failed thing in AI comics; this skips that failure entirely.
- **Single composed page** — `ffmpeg-grid` composes the 6 panels into a 2×3 page (default — manga publishers and webcomic platforms both expect this). Aspect ratio matches `aspect_ratio` (default portrait 2:3).
- **Optional header banner** — `ffmpeg-overlay` applies a chapter/scene title at the top of the page if provided.
- **Final page as PNG** — print-ready, web-ready, ready to drop into a CBZ or post to Webtoons.
- **Project archive** — every panel URL, every prompt, the page composition, all persisted. Next page in 15 minutes because the anchor's already there.

**Time**: ~20 minutes wall clock. **Your attention**: about 5 minutes across 5 approvals. **Cost**: $1.40–$2.80 end to end. *Comic-page-fast tier* — the panel renderings run at `quality_threshold: 0.85` with anchor reference, and the page composition is pure ffmpeg (no inference cost). The premium variant ($4-5) adds `gpt-image` for typographic SFX panels ("CRACK!" "BOOM!") which photoreal models hallucinate.

## Tell the agent about the page

```yaml
page_title:             # e.g. "Chapter 4 — The Salt Shrine" or scene description. Used in archive + optional header banner
protagonist_lora_id:    # OPTIONAL — if set, character anchor active. Leave blank to use kontext-edit reference (also fine for 6 panels)
protagonist_brief:      # 3-5 visual identifiers if no LoRA, used for kontext-edit anchor lock
panel_descriptions:     # list of 6, one sentence each. e.g. ["wide establishing of the shrine at dusk", "protagonist approaching the gate", "close-up on her hand on the iron handle", ...]
dialog_per_panel:       # list of 6, short bubble text. Empty string "" = silent panel. e.g. ["", "I shouldn't be here.", "", "Mother?", "It's been eight years.", ""]
style:                  # e.g. "ink-wash manga" · "western comic Mike-Mignola-noir" · "watercolor pastel" · "cel-shaded action manga" · "indie webcomic flat-color"
palette_hex:            # 3-4 hex colors space-separated, e.g. #1F3A5F #C8A165 #F4E8D8 #6B2E2B
aspect_ratio:           # portrait 2:3 (default — page format) · 3:4 · 4:5 · 1:1 (Instagram square format) · webtoon-vertical (single tall column)
header_banner:          # OPTIONAL — text to overlay as page header, e.g. "Chapter 4" or blank
page_slug:              # kebab-case, used in filenames, e.g. salt-shrine-ch4-pg7
```

## How the agent should run this (interaction contract)

1. **CONFIRM (one turn, no render):** restate the page in 1 line ("6-panel {style} page, protagonist {brief}, 2×3 layout") + the 3 choices that matter: **anchor source** (LoRA / reference images / text-only), **style**, **aspect** (2:3 page vs webtoon-vertical). Quote ~$1.40–$2.80 / ~20 min. Ask ONE question only if the anchor source is missing; otherwise state assumptions and start.
2. **PREVIEW CHECKPOINT = the anchor confirmation panel** (Step 1, ~$0.20). Show it before the 6-panel batch fires: "Anchor holds in this style — reply 'go' or redirect." This is the cheapest point to change style/character; after it, the only other pause is the 6-panel grid before lettering.
3. **NARRATE:** the 6-panel batch takes ~8 min — post "panel 3/6 done" as each lands (poll `get_create_media` every 10–15s). Never go silent >2 min; lettering + grid are <2 min total, one line each.
4. **FAIL GRACEFULLY:** kontext-edit 422/weak panel → soften prompt, retry once → `gpt-image-edit` with the same anchor → flux-dev with the anchor *described in text*. `hyperframes-caption` failure → retry once, else deliver unlettered panels + the dialog list as text (user can letter in any editor). `ffmpeg-grid` with 6 inputs → use the direct-SDK call if the MCP envelope drops the array. Max 2 retries per panel; a 5/6 page with one flagged panel beats no page.
5. **DELIVER:** final page PNG + one honest line ("face consistency held on 5/6 panels — panel 4 is the weakest") + ONE next step ("same anchor, next page is ~$1.50 — want page 2?").

Gate discipline: 3 stops total (brief+anchor, panel grid, final page). Don't re-ask after the user says "go".

## Quality controls (new — auto-applied)


This playbook leverages the closed quality loop. The agent applies these by default; you don't have to ask:

- **Cost upfront.** Before any multi-step batch fires, the agent calls `submit_plan` with `confirm:false` and shows you the proposed steps + total cost. Nothing runs until you approve.
- **Auto-retry on weak shots.** The server default is `quality_threshold: 0.7`. For panel renderings the playbook step tells the agent to pass `quality_threshold: 0.85` so a low-confidence first try gets one auto-retry before you see it.
- **Critic verdict on the result.** When the 6-panel batch finishes, `critique_shot` runs with `focus: "consistency"` across the set. The agent surfaces verdict before composition — if a panel drifted, redo it before the page assembles around a broken face.
- **One-click recovery.** If a step fails, `get_plan` returns a `recovery` hint pointing at `replan({plan_id})` — the agent classifies the failure and proposes a recovery plan you can approve.
- **End-of-project scorecard.** The final wrap-up calls `get_scorecard({project_id})` with succeeded count, mean quality score, critic verdict, total cost, and wall time.

You can override any of these per step: pass `quality_gate: false` on a deliberately stylized panel, `quality_threshold: 0.6` for an abstract / impressionistic panel, or `submit_plan({plan_id, confirm:true})` to skip the cost-preview pause when you trust the chain.

## How this works

AI comics today fail one of three ways: the face drifts, the dialog bubbles are unreadable AI-glyph nonsense, or every panel looks like it's from a different artist. This playbook fixes all three:

1. **Face holds** — LoRA or kontext-edit reference on every panel render, with cross-panel critic before page composition
2. **Dialog reads** — `hyperframes-caption` for lettering, not in-image text generation
3. **Visual unity** — same style guide, same palette injection, same anchor reference across all six panels

Three gates at runtime (brief+anchor, panel grid, final page) — the STOPs below at Steps 3 and 5 are advisory; skip them unless a step failed or the critic flagged drift. The first gate — character anchor lock — is the whole game.

## The steps

### Step 0 — Confirm the brief

The agent reads back the BRIEF and confirms the panel descriptions + dialog list align (6 of each, dialog aligned with panel index).

**STOP**: "Brief looks right? Dialog and panel counts match? (approve / edit [field] [new value])"

### Step 1 — Character anchor lock (~2 min if reference, ~15 min if training)

If `protagonist_lora_id` is set: `apply_lora({lora_id})`, confirm load, done.

If not: for a 6-panel page, **kontext-edit reference is sufficient** — the protagonist appears in 3-5 of the 6 panels typically, and reference anchor holds well enough for that count. The agent asks the user for 1-3 reference images (uploads via the upload endpoint if needed) and picks the strongest as `quality_anchor_url`.

The agent renders one anchor confirmation panel at `quality_threshold: 0.85` showing the protagonist in a neutral pose with the chosen `style` applied. This is the "yes, the anchor holds in this style" gate before the 6-panel batch fires.

> **For the agent**: if the user is on a webcomic deadline and will produce many pages of the same character, recommend LoRA training even for the first page — page 2 onward costs $0.50 less in compute and the consistency upgrade is dramatic. If they're testing a single page, reference is fine.

**STOP**: "Anchor confirmation panel shown. Lock the character? (lock / refine [direction])"

### Step 2 — Generate 6 panels (~8 min, ~$1.20)

The agent fans out 6 parallel `create_media` calls. Each panel prompt combines:
- Panel description from `panel_descriptions[i]`
- The character anchor (LoRA or reference image as `image_url`)
- `style` injected explicitly ("ink-wash manga with selective color", etc.)
- `palette_hex` colors named in the prompt
- Comic-panel framing keywords ("medium shot, comic panel composition, clean edges, no border")
- Aspect ratio matched to panel-aspect-within-page (typically square or 4:3 for 2×3 page layout)

The character anchor is passed on every panel that features the protagonist; the agent uses the panel description to detect protagonist-presence ("close-up on her hand" = yes anchor; "wide establishing of the shrine" = optional anchor).

> **For the agent**: use `flux-dev` with LoRA if set; `kontext-edit` with anchor as `image_url` otherwise. Pass `quality_threshold: 0.85` on every panel. After all 6 render, call `critique_shot` with `focus: "consistency"` across the set — surface the verdict before lettering and page composition fire. If 2+ panels drift, recommend a redo before the page assembles.

**STOP**: "6 panels + consistency critic shown. Approve all, or redo specific? (approve / redo [#] [direction])"

### Step 3 — Letter the dialog bubbles (~2 min, ~$0.10)

For each panel where `dialog_per_panel[i]` is non-empty, the agent calls `create_media({ model_override: "hyperframes-caption", source_url: <panel_url>, ... })` to overlay the dialog as a comic speech bubble. The agent picks bubble placement (top-left / top-right / bottom-center based on panel composition — e.g. if the character faces right, bubble origin from their mouth toward the upper-right) and styles the bubble per `style` ("ink-wash manga" → thin black border, off-white fill; "western comic" → bold black border, hand-lettered font; "watercolor" → soft circular bubble with palette-colored edge).

Panels with empty dialog skip this step.

> **For the agent**: `hyperframes-caption` handles the bubble shape + text. If the dialog has SFX text ("CRACK!", "BOOM!") that needs to live in-panel rather than in a bubble, recommend a separate `gpt-image-edit` pass on that panel for typographic SFX (gpt-image is the only model on the network that gets in-image lettering right).

**STOP**: "Lettered panels shown. Approve, or refine a bubble? (approve / edit [#] [direction])"

### Step 4 — Compose the page via ffmpeg-grid (~1 min, ~$0.05)

The agent calls `create_media({ model_override: "ffmpeg-grid", ... })` with the 6 lettered panels as inputs, `columns: 2, rows: 3` (default page layout — most reader-friendly format for 6-panel pages). Aspect ratio matched to `aspect_ratio` from brief. Background color pulled from `palette_hex` neutral slot (default white-cream for ink-wash, dark for noir style).

If `aspect_ratio: webtoon-vertical` is set, the agent overrides to `columns: 1, rows: 6` for a single-column vertical scroll page — the format Webtoons / Tapas / LINE Manga readers expect.

> **For the agent**: ffmpeg-grid with 6 inputs needs the direct-SDK fallback pattern for the input array. Use minimal gutter (~16-24px) between panels — comic pages read tighter than photo grids.

### Step 5 — Optional header banner (~30s, ~$0.02)

If `header_banner` is set: `create_media({ model_override: "hyperframes-lower-third", source_url: <page_url>, ... })` (or `ffmpeg-overlay`) applies the banner text at the top of the page. The banner uses a hand-lettered serif treatment matched to `style`. Pulled from `palette_hex` accent slot for contrast. (`hyperframes-lower-third` renders clean text; never bake header text into a generated image — AI in-image lettering is the top failure mode.)

If `header_banner` is blank, skip.

> **For the agent**: for chapter-opening pages, recommend a slightly taller header (10% of page height); for in-chapter pages, recommend the minimal version (~5%).

**STOP**: "Page composed. Approve final, or redo a step? (approve / redo [step])"

### Final step — scorecard wrap-up

Call `get_scorecard({project_id: ...})` — paste output to your channel.

```
Scorecard for cjob_xxx
6/6 panels shipped — critic: SHIP
Title: {page_title}
Steps: N/N succeeded (100%)
Quality: mean X.XX · M/N passed · K retries
Critic verdict: SHIP — character face consistency 0.XX across all panels
Cost: $X.XX actual (est $Y.YY) · Ts wall time
Viewer: <project URL>
```

## When you're done

The agent prints:

```
✅ Final page (PNG): <URL>
✅ 6 lettered panels: <URL × 6>
✅ 6 raw panel renderings: <URL × 6>
✅ Character anchor: <URL>
✅ Project viewer: <project URL>

Total spent: $X.XX
Total wall-clock: MM:SS
Critic verdict: SHIP — character face consistency 0.XX across all panels
```

## What can disappoint (cap ceilings)

- **Reference-anchor consistency is good, not perfect.** kontext-edit holds a face across ~6 panels; expect 1 panel per page to need a redo. Beyond ~8 panels of the same character per session, drift compounds — that's the LoRA threshold.
- **Never put dialog or SFX text in the generated image.** AI in-image lettering is the top failure mode — that's why lettering is `hyperframes-caption` and SFX is a separate `gpt-image-edit` pass (the only model that semi-reliably renders letters; still verify every glyph).
- **Style names get filtered.** Brand-name style prompts ("Mignola") can be softened by the model into generic comic-style; describe the look (heavy blacks, chiaroscuro) instead of the name.

## What to do next

You made a comic page where the character looks the same in every panel — the single hardest problem in AI comic creation — in ~20 minutes for ~$2.

- **Next page:** re-run with the same `protagonist_lora_id` (or reference). Anchor, style, and palette carry over — page 2 costs ~$1.50.
- **Webtoons / Tapas / LINE Manga:** set `aspect_ratio: webtoon-vertical` — the playbook composes a single tall scrolling column (`ffmpeg-grid` `columns: 1, rows: 6`), the format those platforms expect.
- **Print comic:** the 2×3 page is print-ready at 300dpi at native resolution. Drop the PNGs into Affinity Publisher / InDesign, set bleed and trim, ship the issue.
- **Train a LoRA** (`submit_lora_train`) once you have ~10 panels of the character — every future page is cheaper at identical fidelity.
