Skip to main content

ComicForge

📖 Documentation: https://mojzis.github.io/comicforge/

A tiny, scriptable comic-page engine. Characters are a base SVG + stackable variant overlays (faces, arms, …); a comic page is a declarative YAML spec; output is SVG / PNG / PDF. Built so an LLM (or you) can author pages as plain text.

Start a project

ComicForge ships no art and a project needs no Python — a project is just YAML specs + SVG / pixel art that the CLI points at. Install the engine globally and scaffold one:

uv tool install comicforge         # puts `cmf` on your PATH (no venv needed)
cmf init my-comic                  # scaffold characters/ scenes/ pixel/ pages/ + skill
cd my-comic && cmf render pages/hello.yaml

See Starting a project for the data-only setup, version pinning, and when to make it a real Python project.

Working on the engine

uv sync                            # create .venv and install deps
uv run poe test                    # the tight loop
uv run poe check                   # everything, before opening a PR
uv run poe docs                    # serve the documentation site locally

Use

# render a comic page
cmf render examples/pes/pages/slepice.yaml -o slepice.png
cmf render examples/pes/pages/slepice.yaml -o slepice.pdf

# render a standalone scene illustration (one background, no comic grid)
cmf scene examples/pes/pages/dvur-scene.yaml -o dvur.png

# render individual panels at low res for quick review
cmf panel examples/pes/pages/slepice.yaml -o panel.png --row 0 --col 0
cmf panel examples/pes/pages/slepice.yaml -o panels/ --all --scale 0.5

# print the machine-readable contracts (characters / scenes, slots, variants)
cmf characters --library examples/pes/characters
cmf scenes --scenes examples/pes/scenes

Or from Python:

from comicforge import render_spec
render_spec("examples/pes/pages/slepice.yaml", "out.pdf")

How it fits together

ComicForge is a content-free engine plus self-contained projects. There is no shared asset library: every project owns all of its own art. A real downstream project just does pip install comicforge and brings its own characters — none of the example art comes with the engine.

Layer Path Purpose
Engine comicforge/ Pure code — loads assets, composes SVG, writes output. No hardcoded content.
Project examples/<name>/ A self-contained comic: its own characters, scenes, pixel art, and page specs.

A project is one directory with four asset folders:

examples/pes/
  characters/tom/             flat: base.svg + <slot>-<variant>.svg + character.yaml
  characters/bara/            posed: shared faces + character.yaml + poses/{sit,walk}/
  scenes/{dvur,pokoj}/        base.svg + <slot>-<variant>.svg + scene.yaml
  pixel/{heart,sun,...}.yaml  grid + palette
  pages/
    slepice.yaml              2×2 comic — Tom and Bára watch chickens
    kosticka.yaml             Strip with scenes, pixel art, multiple bubble types
    dvur-scene.yaml           Standalone illustration (use `comicforge scene`)

comicforge/library.py         loads a character, stacks base+overlays, places it
comicforge/scene.py           loads a scene, stacks overlays, scales it to cover a box
comicforge/bubbles.py         speech / thought / shout bubbles with word-wrap + tail
comicforge/pixelart.py        grid+palette → SVG sprite
comicforge/render.py          row/panel pages + standalone scenes → SVG → PNG/PDF
comicforge/cli.py             `render`, `scene`, `panel`, `characters`, `scenes` commands

Asset directories

Each spec declares where its assets live via top-level keys (paths are relative to the spec file's directory). For a spec under pages/, the sibling asset folders are one level up:

library:    "../characters"   # character art
scenes_dir: "../scenes"       # scene backgrounds
pixel_dir:  "../pixel"        # pixel-art sprites

CLI flags (--library, --scenes, --pixel-dir) override spec keys and are treated as relative to the current working directory.

The documentation site covers the full path-resolution rule, how to add characters / scenes / sprites, and the complete CLI and spec references — every picture on it is rendered from a spec at build time.

Design choices

  • Base + overlays in one shared local canvas — "posing" is just choosing which overlay SVGs to stack. No rig math; each pose/expression is a small SVG you can edit by hand.
  • Declarative spec — the whole agent surface is YAML + the characters JSON.
  • SVG all the way down, rasterized only at the end — crisp vector PDF for print.
  • Content-free engine — comicforge/ ships no art. Each project owns all its own assets, so the engine is a dependency, not a content bundle.

Roadmap ideas

  • A FastAPI + HTMX preview server (live re-render on spec edit).
  • An MCP server exposing list_characters / render_page as tools.
  • Part-anchored slots (separate eyes/mouth/limb pivots) for finer posing.
  • Free-form panel shapes and a gutter/layout DSL.
  • AI-image panels (drop a generated raster into a panel like pixel art).

Metadata

Release files for comicforge 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for comicforge 0.2.2
File Size Uploaded
comicforge-0.2.2.tar.gz 224.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for comicforge 0.2.2
File Interpreter ABI Platform
comicforge-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 280.6 kB

Release files / comicforge-0.2.2.tar.gz

Download URL comicforge-0.2.2.tar.gz
Size 224.0 kB
Tags Source
SHA-256 checksum
How to use checksums
13989b0a7a96c6e600d0006b20c90ff3ab16e2a1c4371e50969e8acac19df958
BLAKE2b-256 checksum
How to use checksums
e3ae9128f264df046cf53028cb1d0d4016f89cb6045757e3c486ce20deb081ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / comicforge-0.2.2-py3-none-any.whl

Download URL comicforge-0.2.2-py3-none-any.whl
Size 56.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c589a5c70201541f54e6ba999f142742dd3135be067087d8a56d7dd52b481002
BLAKE2b-256 checksum
How to use checksums
67d73a768dc381ec995160c52d3c2afaee12ed5b1f10d81512f3e4dcddd2f642
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.4

2 release files

0.2.3

2 release files

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page