Generate multi-panel manga from character reference and story beats
Generate sequential manga panels with visual continuity using Nano Banana Pro.
| Parameter | Type | Required | Description |
|---|---|---|---|
character_image_path | Path | Yes | Reference image for character consistency |
character_name |
| str |
| Yes |
| Character name for prompts |
story_beats | list[str] | Yes | 2-6 visual descriptions (one per panel) |
dialogues | list[str] | No | Optional dialogue for each panel |
style | str | No | Visual style (default: manga) |
Include camera direction in story beats for best results:
"Close-up: Momo's eyes widen in surprise"
"Wide shot: The room is a mess of scattered toys"
"Low angle: Momo leaps heroically toward the treat"
"Medium shot: Momo lands gracefully, treat in mouth"
async for event in generator.generate_manga_streaming(...):
if event.type == 'panel':
show_panel(event.data['image_url'])
result = await generator.generate_manga(...)
for panel in result.panels:
print(panel.image_url)
from skills.generate_manga.generate_manga import MangaGenerator
generator = MangaGenerator(client=gemini_client)
# Streaming (for progressive UI)
async for event in generator.generate_manga_streaming(
character_image_path=Path("outputs/characters/momo_full_body.png"),
character_name="Momo",
story_beats=[
"Wide shot: Momo spots a butterfly in the garden",
"Medium shot: Momo crouches, ready to pounce",
"Close-up: Momo's intense focus, whiskers twitching",
"Low angle: Momo leaps into the air, paws extended"
],
dialogues=["Ooh!", "Must... catch...", "", "GOTCHA!"],
style="manga"
):
if event.type == 'panel':
# Display panel immediately
display(event.data['image_url'])
assets/outputs/manga/{manga_id}_panel_{n}.pngBefore generating panels, Gemini Pro (gemini-3-pro-preview) analyzes each character reference sheet and produces a 2-3 sentence appearance description. This runs once per character (~2s), not per panel.
Each panel prompt includes two anchors per character:
[IMAGE N]APPEARANCE: VibeCoder is an older man with long grey hair, full grey beard, black hoodie, gold headphones...This prevents the image model from hallucinating different characters on complex story beats.
For panels 2+, the prompt includes:
[IMAGE N - PREVIOUS PANEL])This ensures consistent backgrounds, lighting, color palette, and character identity across all panels.