13 KiB
Comic-Odin Production Readiness Plan
Current State Summary
| Metric | Value |
|---|---|
| Source files | 38 .odin files |
| Test count | 156 passing |
| GUI screens | 8/8 defined (Community is placeholder) |
| Workflow steps | 8/8 implemented |
| Export formats | 3/3 (PDF with real page rendering) |
| CLI/TUI | Fully functional |
| Native GUI | ~1200 lines Raylib, dark theme |
| P0 items | 5/5 complete |
| P1 items | 5/5 complete |
| P2 items | 5/5 complete (all done) |
Critical Production Gaps (P0 - Must Fix Before Release)
P0-1: PDF Export — Replace Text Placeholder with Real Page Rendering
Current: Writes a minimal text-only PDF with panel count. No images embedded. Target: Canvas-like page composition with panel images positioned per layout cells.
Implementation plan:
- Add
stb_image.hbinding (or use existing Odin image loading) to load panel images from URLs/local paths - Create
render_page_to_imageproc that:- Creates a blank canvas at page dimensions (from
Page_Size) - Fills white background
- For each panel: loads image, calculates pixel position from
Layout_Cellfractions, draws with gutter margins, draws black border
- Creates a blank canvas at page dimensions (from
- Integrate with existing PDF writer or switch to a proper PDF library (e.g.,
harfbuzz+freetypefor text, or usewkhtmltopdf/weasyprintsubprocess like current CBZ zip approach) - Add DPI scaling (default 300 DPI)
- Test: Export a 4-page comic, verify PDF opens in viewer with correct panel positions
Files to modify: src/adapters/export.odin
New files: src/adapters/image_loading.odin
Estimated effort: 2-3 days
P0-2: Character Consistency — IP-Adapter Reference Images
Current: generate_panel_image ignores character reference images (_ = characters).
Target: Pass character reference image URLs to fal.ai API for consistent character appearance.
Implementation plan:
- Add
reference_images: []stringandreference_image_strength: f32to fal.ai request body - Collect
character.reference_image_urlfor all characters inpanel.characters_present - Pass
reference_image_strength = 0.65(the "sweet spot" from TypeScript) - Add
reference_imagesfield toCharacterstruct (already hasreference_image_url) - Store character reference images in
Comic_Stateas a map:character_ref_images: map[string]string(character_id → URL) - Test: Generate panels with 2+ characters, verify visual consistency across panels
Files to modify: src/adapters/fal.odin, src/core/types.odin, src/gui/actions.odin
Estimated effort: 1-2 days
P0-3: Shot-Type-Based Image Sizing
Current: All panels generated at fixed 1024x1024. Target: Map shot types to appropriate aspect ratios for better composition.
Implementation plan:
- Add
get_image_size_for_shot_typeproc mapping:establishing,wide,aerial→landscape_16_9medium,over-shoulder→landscape_4_3close-up→portrait_4_3extreme-close-up→square_hd
- Pass
image_sizeparameter to fal.ai request - Store actual returned dimensions in
Panel_Image.width/height - Test: Generate panels with varied shot types, verify different aspect ratios
Files to modify: src/adapters/fal.odin, src/core/layout.odin
Estimated effort: 0.5 days
P0-4: Art Style Keyword Mapping
Current: Raw art_style string passed to prompts.
Target: 8 defined art styles with detailed keyword expansions.
Implementation plan:
- Add
Art_Style_Keyenum:Manga, Western_Comic, Pixel_Art, Watercolor, Noir, Chibi, Sketch, Cyberpunk - Add
ART_STYLE_KEYWORDSconstant map with detailed prompt keywords per style - Add
QUALITY_MODIFIERconstant:"high quality, detailed, clean lines, vibrant colors, professional illustration, best quality, masterpiece" - Add
get_style_keywordsproc to expand art style into prompt prefix - Update
build_local_panel_imagesandgenerate_panel_imageto prepend style keywords - Test: Generate panels with each art style, verify prompt includes correct keywords
Files to modify: src/core/types.odin, src/adapters/fal.odin, src/gui/local_helpers.odin
Estimated effort: 1 day
P0-5: Negative Prompts
Current: No negative prompts in image generation. Target: Add negative prompts to improve output quality.
Implementation plan:
- Add
negative_prompt: stringto fal.ai request body - Character reference negative:
"blurry, low quality, distorted face, extra limbs, bad anatomy, deformed, watermark, signature" - Panel negative:
"blurry, low quality, distorted face, extra limbs, bad anatomy, deformed, watermark, signature, text, speech bubble" - Test: Generate panels with and without negative prompts, compare quality
Files to modify: src/adapters/fal.odin
Estimated effort: 0.5 days
High Priority Gaps (P1 - Important for Quality)
P1-1: Multi-Angle Character Sheet Generation
Current: Single reference portrait only. Target: 4-angle character sheet (front, 3/4, profile, back) with IP-Adapter consistency.
Implementation plan:
- Add
generate_character_sheetproc that iterates 4 poses sequentially - First pose generates anchor image; subsequent poses use first image as
reference_imageswithreference_image_strength: 0.65 - Poses: front-facing, three-quarter, side profile, back view
- Store sheet URLs in
Character.character_sheet_urls - Add GUI button "Generate Character Sheet" on Characters screen
- Test: Generate sheet for a character, verify 4 distinct but consistent images
Files to modify: src/adapters/fal.odin, src/gui/actions.odin, src/gui/summary_views.odin
Estimated effort: 2 days
P1-2: Emotion Enum + Structured Dialogue
Current: emotion is a free-form string in Dialogue.
Target: Proper Emotion enum with 6 values.
Implementation plan:
- Add
Emotionenum:Happy, Sad, Angry, Surprised, Neutral, Determined - Update
Dialoguestruct:emotion: Emotion - Update DeepSeek response parser to map string emotions to enum
- Update bubble auto-placement to consider emotion (e.g., Shout for Angry, Whisper for Sad)
- Update JSON serialization/deserialization
- Test: Generate script, verify emotion enum populated correctly
Files to modify: src/core/types.odin, src/adapters/deepseek.odin, src/core/bubble.odin
Estimated effort: 0.5 days
P1-3: Character Description Parser
Current: Character descriptions are free-form text.
Target: Parse natural language descriptions into structured Character_Prompt_Template.
Implementation plan:
- Add 10 regex extraction procs (age, gender, hair color, hair style, eye color, skin tone, body type, outfit, accessories, distinguishing features)
- Add
parse_description_to_templateproc - Add
extract_color_paletteproc - Add GUI helper: "Parse Description" button on Characters screen
- Test: Parse "25-year-old female, black long hair, blue eyes, fair skin, slim build, wearing a red dress, glasses, scar on cheek" → structured template
Files to modify: src/core/character_prompt.odin, src/gui/actions.odin
New files: src/core/character_parser.odin
Estimated effort: 1-2 days
P1-4: CBZ/PNG Export — Use Real Image Rendering Instead of Raw Copies
Current: CBZ/PNG exports copy raw panel images without page composition. Target: Render full pages with panels positioned per layout (same as PDF).
Implementation plan:
- Reuse
render_page_to_imagefrom P0-1 - For CBZ: render each page to PNG, add to zip with
page_XXX.jpgnaming - For PNG: same but output as individual PNG files in a zip
- Add
ComicInfo.xmlwith proper metadata (Title, Series, Count, etc.) - Test: Export CBZ, open in comic reader (e.g., CDisplayEx)
Files to modify: src/adapters/export.odin
Estimated effort: 1 day
P1-5: Progress Tracking During Generation
Current: No progress feedback during long operations. Target: Real-time progress updates in GUI.
Implementation plan:
- Add
progress_callbackparameter togenerate_all_panels_batched - Update job manager to track progress percentage
- Add progress bar to GUI during generation (overlay or inline)
- Update status message with "Generating panel 3/12 (25%)"
- Test: Generate 12 panels, verify progress updates visible
Files to modify: src/ui/jobs.odin, src/gui/runtime.odin, src/adapters/fal.odin
Estimated effort: 1 day
Medium Priority Gaps (P2 - Polish)
P2-1: DeepSeek Streaming Generation
Current: Waits for full response before showing results. Target: Streaming partial JSON for real-time preview.
Implementation plan:
- Add
stream_comic_scriptproc using curl with streaming response - Parse partial JSON chunks, update GUI progressively
- Add "Generating..." overlay with partial script preview
- Fallback to non-streaming if streaming fails
Files to modify: src/adapters/deepseek.odin, src/gui/runtime.odin
Estimated effort: 2 days
P2-2: Appearance Count Tracking
Current: Character.appearance_count field exists but is never populated.
Target: Auto-count character appearances across panels.
Implementation plan:
- Add
count_character_appearancesproc that iterates all panels - Call after script generation and panel generation
- Display count in Characters screen summary
Files to modify: src/core/script.odin, src/gui/summary_views.odin
Estimated effort: 0.5 days
P2-3: Genre-Based Layout Pattern Selection
Current: Layout pattern selection considers genre but pattern_matches_genre is basic.
Target: Full genre-to-pattern mapping with tightest-fit algorithm.
Implementation plan:
- Add
get_patterns_by_genreproc - Update
select_best_patternto use tightest-fit (smallest maxPanels that fits) - Add genre filtering to pattern selection
Files to modify: src/core/layout.odin
Estimated effort: 0.5 days
P2-4: Bubble Text Editing in GUI
Current: Bubble text can only be changed via project file edit. Target: Inline text editing in bubble editor.
Implementation plan:
- Add text input field to bubble detail panel
- Add "Save" button to commit text changes
- Update
action_update_bubbleto accept new text - Add keyboard shortcut for text editing mode
Files to modify: src/gui/bubbles_views.odin, src/gui/runtime.odin, src/gui/actions.odin
Estimated effort: 1 day
P2-5: Manual Bubble Positioning
Current: Bubbles are auto-placed only. Target: Drag-to-reposition bubbles in GUI.
Implementation plan:
- Add mouse drag detection on bubble preview
- Update bubble
positionon drag - Add "Reset Position" button to revert to auto-place
- Save position changes to project
Files to modify: src/gui/bubbles_views.odin, src/gui/runtime.odin
Estimated effort: 2 days
Low Priority Gaps (P3 - Nice to Have)
P3-1: Community Features
Current: Placeholder screen. Target: Publish/share/browse functionality.
Estimated effort: 5+ days (defer to future release)
P3-2: Undo/Redo for Bubble and Layout Edits
Current: No undo support. Target: Command history for bubble/layout changes.
Estimated effort: 2-3 days
P3-3: Multi-Monitor Awareness
Current: Launches on primary monitor only. Target: Remember last window position, support multi-monitor.
Estimated effort: 1 day
P3-4: Image Asset Caching to Disk
Current: Images stored in memory only.
Target: Cache generated images to assets/ directory.
Estimated effort: 1-2 days
P3-5: Custom Layout Pattern Assignment
Current: Layout regeneration cycles through patterns. Target: Manual pattern selection dropdown.
Estimated effort: 1 day
Implementation Order
| Phase | Milestones | Duration | Tests Added | Status |
|---|---|---|---|---|
| Phase 1 | P0-1 (PDF export), P0-3 (shot sizing), P0-5 (negative prompts) | 3 days | +10 | ✅ |
| Phase 2 | P0-2 (character consistency), P0-4 (art styles) | 2 days | +8 | ✅ |
| Phase 3 | P1-4 (CBZ/PNG rendering), P1-5 (progress tracking) | 2 days | +6 | ✅ |
| Phase 4 | P1-1 (character sheets), P1-2 (emotion enum) | 2.5 days | +8 | ✅ |
| Phase 5 | P1-3 (description parser), P2-3 (genre layouts) | 2 days | +6 | ✅ |
| Phase 6 | P2-1 (streaming), P2-2 (appearance count), P2-4 (bubble text), P2-5 (bubble position) | 2.5 days | +14 | ✅ |
| Phase 7 | P2-5 (bubble positioning GUI drag) | 1 day | +13 | ✅ |
| Phase 8 | P3 items (deferred) | TBD | TBD | ⏳ |
Total estimated effort: ~17 days for P0-P2 (production-ready) Expected test count after completion: ~150+ Actual test count: 156 ✅
Total estimated effort: ~17 days for P0-P2 (production-ready) Expected test count after completion: ~150+
Release Criteria
Before v0.3.0 release:
- All P0 items complete and tested
- All P1 items complete and tested
- All P2 items complete and tested
- 150+ tests passing (156/150)
- No memory leaks in test output
- PDF export produces valid comic with images
- CBZ opens in standard comic readers
- Character consistency verified across 10+ panels
- GUI smoke test: full pipeline (story → script → panels → layout → bubbles → export) works end-to-end
- CLI smoke test:
auto-allcommand completes without errors - Package script produces valid artifact with checksums