Skip to content

mohit231007/comicforge-local

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ComicForge Local

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

Scope

ComicForge is built for original, work-safe comic storytelling with fictional characters, responsible dataset controls, and IP-safe prompt handling.

Current pipeline

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

Current features

  • 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

Recommended local models

Start with smaller local models if running on a 16GB RAM laptop:

ollama pull llama3.2:3b
ollama pull mistral

qwen3:4b can be slow for structured JSON on CPU-only machines, so use template or llama3.2:3b first.

Quick start

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 8000

Open:

http://127.0.0.1:8000/docs

Fast test without image generation

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

Free image-generation test

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.

Optional image backends

  • none: use the fallback renderer only
  • pollinations: free public image endpoint for quick portfolio demos
  • openai: OpenAI Images API for higher reliability
  • comfyui: local image workflow for advanced users

Environment

Optional local .env values can be copied from:

backend/.env.example

Roadmap

  • 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.

Portfolio positioning

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages