How san-mark/comiccraft works
ComicCraft is a FastAPI application for turning a user’s comic prompt into a five-panel story, illustrated panels, a preview, and a downloadable PDF. Its main workflow is orchestrated by the generation route, which validates input and calls the outline, story, image, layout, and export stages. The graph also shows the separate image-provider integrations and file outputs. Source excerpts establish these backend relationships; template contents were not sampled, so UI interactions beyond route rendering are not inferred.
Main entry points: routes.py Generation routes · image_generator.py Panel image generation · exporters.py PDF exporter · config.py Settings
Components 17
Web application
- Generation routes
app/routes.py - FastAPI app
app/main.py - Settings
app/config.py - Prompt and story schemas
app/schemas.py - HTML templates
templates
Story generation
- Outline generation
app/services/gemini_flash.py - Story generation
app/services/gemini_pro.py
Illustration
- Panel image generation
app/services/image_generator.py - Filename and URL helpers
app/utils/storage.py - Panel image files
static/panels
Layout and export
- Comic layout builder
app/services/layout_builder.py - PDF exporter
app/services/exporters.py - PDF files
exports
Other components
- Comic creator
- Google Gemini API
- Hugging Face inference
- Diffusers pipeline
Connections 24
- Comic creator → Generation routes: submits prompt
app/routes.py - FastAPI app → Generation routes: registers routes
app/main.py - Generation routes → HTML templates: renders pages
app/routes.py - Generation routes → Prompt and story schemas: validates input
app/routes.py - Generation routes → Outline generation: requests outline
app/routes.py - Outline generation → Google Gemini API: generates outline
app/services/gemini_flash.py - Generation routes → Story generation: expands story
app/routes.py - Story generation → Google Gemini API: generates story
app/services/gemini_pro.py - Generation routes → Panel image generation: requests panel images
app/routes.py - Panel image generation → Hugging Face inference: generates images
app/services/image_generator.py - Panel image generation → Diffusers pipeline: generates images
app/services/image_generator.py - Panel image generation → Filename and URL helpers: names image files
app/services/image_generator.py - Panel image generation → Panel image files: writes images
app/services/image_generator.py - Generation routes → Comic layout builder: builds layout
app/routes.py - Comic layout builder → Prompt and story schemas: reads story panels
app/services/layout_builder.py - Generation routes → PDF exporter: exports layout
app/routes.py - PDF exporter → Panel image files: reads panel images
app/services/exporters.py - PDF exporter → PDF files: writes PDF
app/services/exporters.py - FastAPI app → Panel image files: serves static files
app/main.py - FastAPI app → PDF files: serves PDF files
app/main.py - Outline generation → Settings: reads settings
app/services/gemini_flash.py - Story generation → Settings: reads settings
app/services/gemini_pro.py - Panel image generation → Settings: reads settings
app/services/image_generator.py - PDF exporter → Settings: reads settings
app/services/exporters.py