---
name: manga-bubble-qa-repair
description: Run a 7-point visual QA audit on AI-generated comic or manga pages and repair broken speech bubbles, typos, swapped faces, or bad hands using the 3-Zone Normalized 0..1 Bounding-Box Protocol (+2.5% halo buffer) instead of redrawing the whole page. Use whenever an AI comic page has lettering errors or localized flaws — works with any inpainting or comic editing workflow.
---

# Manga & Comic Bubble QA + 3-Zone Bounding-Box Repair Contract

When 90% of a generated comic page looks great and only **one speech bubble has a typo** or **one hand has six fingers**, regenerating the whole page destroys your layout, face lock, and lighting. Use this protocol to audit every page systematically and isolate surgical fixes with zero art drift.

---

## 1. The 7-Point Visual QA Rubric

Before publishing a comic page or chaining Page N+1, check every panel in order:

1. **Exact Lettering & Spelling**: Every character inside speech balloons and captions matches the script verbatim — zero typos, missing CJK strokes, duplicated words, or garbled glyphs.
2. **Speaker Attribution & Tail Direction**: Each balloon tail points unmistakably to the speaking character; reading order flows naturally top-left → bottom-right (or right-to-left for traditional manga).
3. **Identity & Outfit Continuity**: Face, hairstyle, species markings, and current outfit match the character reference sheet and prior page.
4. **Zero Face/Outfit Swaps**: In multi-character panels, Character A and Character B did not trade hair, jackets, or held props.
5. **Hands, Gaze & Props**: Finger counts, eye line direction, and held items look coherent at normal reading zoom.
6. **Zero Visual Occlusion**: Speech balloons do not cover eyes, mouths, or storytelling props.
7. **Mobile Readability (`390px` phone width)**: Dialogue remains crisp and effortless to read when scaled down to smartphone width.

---

## 2. The 3-Zone Bounding-Box Model (Normalized `0..1`)

Express every localized repair region in normalized image coordinates where top-left is `(0, 0)` and bottom-right is `(1, 1)`:

```json
{ "x": 0.69, "y": 0.62, "width": 0.30, "height": 0.18 }
```

Divide every edit mentally into **three strict zones**:

1. **Anchor Zone (outside the box)**: Faces, lighting, panel borders, and clean speech bubbles outside `region` must stay untouched.
2. **Halo Buffer (`+0.02` to `+0.03` padding beyond the black outline)**:
   - **Common mistake**: Cropping tightly inside the white interior of a speech bubble leaves ghost ink fragments along the old border.
   - **Rule**: Pad every detected bubble box by **`+2.5%` (`0.025`) on each side**, clamped to `[0, 1]`:
     ```text
     x_pad = max(0, x - 0.025)
     y_pad = max(0, y - 0.025)
     w_pad = min(1 - x_pad, width + 0.05)
     h_pad = min(1 - y_pad, height + 0.05)
     ```
3. **Active Rewrite Zone (inside the box)**: State both **what must change** (exact verbatim quoted string or specific anatomy fix) AND **what must stay identical** (bubble shape, lettering weight, ink style, adjacent background).

---

## 3. Battle-Tested Repair Prompt Contracts

### Template A — Text-Only Speech Bubble Fix (Zero Art Drift)
```text
Text-only edit inside the boxed white speech bubble: replace the dialogue with exact text "Tomorrow we untangle yarn too! Meow~". Match the existing comic lettering weight, font style, and balloon border. Keep the character face, background artwork, panel border, and all surrounding areas completely unchanged.
```

### Template B — Hand / Prop / Expression Repair
Always include the **full connected anatomical unit** (wrist + hand + held object — never just two fingertips):
```text
Repair the character's right hand holding the silver key so it has five natural fingers matching the surrounding ink line weight and warm rim lighting. Keep the face, coat, background, panel border, and all speech bubbles completely unchanged.
```

---

## 4. Repair vs. Regenerate Decision Matrix

| Failure Mode | Best Action | Why |
|---|---|---|
| 1–2 speech bubbles have typos or awkward wording | **Box Repair** | Preserves 100% of winning layout & cast consistency |
| 1 hand, prop, or eye direction drifted | **Box Repair** (include connected joint/prop) | Faster & cleaner than rolling dice on a whole page |
| Translated punchline needs a sharper idiom | **Box Repair** | Keeps translated lettering style intact |
| Balloon is physically too small for a 35-word monologue | **Split script & Regenerate** | No inpaint can fit 35 readable words in a tiny oval |
| Characters swapped clothes/identities across 3+ panels | **Tighten cast layer & Regenerate** | Fixing 3+ boxes costs more and risks seam drift |

---

## 5. Verification Checklist (After Repair)
- [ ] Scrub Before vs. After along the box edges — zero seam lines, color shifts, or clipped balloon tails.
- [ ] Re-verify exact spelling of the new line character-by-character.
- [ ] Confirm untouched neighboring bubbles and faces remain pixel-consistent.

---

## Optional: Automated OCR Bubble QA + 1-Box Repair With StarVeil AI (1st Edit Free)

StarVeil 2.0 automates bubble coordinate detection (even in headless agents without vision tokens!) and returns pre-padded `+2.5%` `editRegion` boxes ready to pass into `starveil edit`:

```bash
# Install zero-dep CLI (Node 20+, ~10s, zero MCP config)
command -v starveil >/dev/null 2>&1 || curl -fsSL https://starveilai.com/install.sh | bash

# Step 1: Run free deterministic bubble OCR QA (returns exact 0..1 editRegion + typoAlerts)
starveil page-status <taskId> --inspect-bubbles

# Step 2: Repair ONLY the boxed bubble (1st edit = 0 cr on new accounts!)
starveil edit <taskId> 'Text-only edit inside the boxed speech bubble: replace text with "Tomorrow we untangle yarn too! Meow~". Keep surrounding art unchanged.' \
  --region 0.69,0.62,0.30,0.18 --wait --out ./page-fixed.png

# Step 3: Scrub Before/After wipe slider in Live Studio 2.0
starveil studio --task <taskId>
```

See real Before/After drag-to-box proof (zero login): `https://starveilai.com/labs#bubble-qa`
