ComicForge Local is a portfolio-ready text-to-comic generation project. It converts a story idea into an original comic episode using local LLMs, structured panel planning, safety/IP filtering, optional image generation, and polished comic-page rendering.
The project is designed for learning and portfolio-building around:
- FastAPI backend design
- Local LLM inference with Ollama
- Story-to-structured-JSON generation
- Character and panel planning
- Work-safe image-prompt generation
- Free image generation through Pollinations
- Optional OpenAI Images API backend
- Optional local ComfyUI backend
- HTML and PNG comic-page rendering
- Local model benchmarking
- Dataset governance for future fine-tuning
ComicForge is built for original, work-safe comic storytelling with fictional characters, responsible dataset controls, and IP-safe prompt handling.
User Prompt
↓
Safety + IP Filter
↓
Template mode or local LLM through Ollama
↓
Structured Comic JSON
↓
Optional panel image generation
↓
HTML Preview Renderer
↓
PNG Comic Page Compositor
- FastAPI backend
- Ollama local model client
- Rule-based safety/IP filter
- Template mode for instant deterministic tests
- Comic episode JSON generator
- Free Pollinations image backend
- Optional OpenAI image backend
- Optional ComfyUI panel-image backend
- HTML preview with panel image support
- PNG compositor that uses generated panel art when available
- Fallback coded comic-page renderer when generated panel images are not available
- Model benchmarking script
- Dataset manifest validator
Start with smaller local models if running on a 16GB RAM laptop:
ollama pull llama3.2:3b
ollama pull mistralqwen3:4b can be slow for structured JSON on CPU-only machines, so use template or llama3.2:3b first.
git clone https://github.com/mohit231007/comicforge-local.git
cd comicforge-local/backend
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000Open:
http://127.0.0.1:8000/docs
Use this first. It does not need Ollama, ComfyUI, or any paid API.
{
"prompt": "Create a 3-panel original Indian romantic-comedy comic episode set in a Gurugram apartment society. Make it witty, cinematic, and work-safe. Use original characters only.",
"model": "template",
"panel_count": 3,
"render_images": false,
"image_backend": "none"
}Expected outputs:
outputs/json/comic_<timestamp>.json
outputs/html/comic_<timestamp>.html
outputs/images/comic_<timestamp>.png
Use the Pollinations backend for a no-key development workflow:
{
"prompt": "Create a 3-panel original Indian romantic-comedy comic episode set in a Gurugram apartment society. Make it witty, cinematic, and work-safe. Use original characters only.",
"model": "template",
"panel_count": 3,
"render_images": true,
"image_backend": "pollinations",
"image_width": 1024,
"image_height": 1536,
"image_timeout_seconds": 300
}Expected additional outputs:
outputs/panels/<title>_pollinations_panel_1.png
outputs/panels/<title>_pollinations_panel_2.png
outputs/panels/<title>_pollinations_panel_3.png
The final page in outputs/images uses the generated panel images and overlays captions/dialogue.
none: use the fallback renderer onlypollinations: free public image endpoint for quick portfolio demosopenai: OpenAI Images API for higher reliabilitycomfyui: local image workflow for advanced users
Optional local .env values can be copied from:
backend/.env.example
- v0.1: Local LLM comic planning, structured JSON, HTML/PNG storyboard output, filtering, benchmarking.
- v0.2: Work-safe comic-page compositor with fallback placeholder art.
- v0.3: Optional local image generation per panel and image-aware final page composition.
- v0.4: Free Pollinations backend and improved splash-page renderer.
- v0.5: Frontend UI, regenerate single panel, download PNG/PDF/CBZ.
- v0.6: Character consistency, reference sheets, and seed locking.
- v0.7: Licensed/original dataset pipeline.
Suggested resume bullet:
Built a text-to-comic generation engine using FastAPI, Ollama, Pydantic, Pillow, and multi-backend image generation to transform natural-language story prompts into structured comic episodes, panel scripts, work-safe image prompts, generated panel artwork, and rendered comic-page previews with safety/IP guardrails and model benchmarking.