Turn a source text into visual media — slide decks and single-page infographics, with multi-provider text and image generation
Project description
Polyptych Studio
Turn a source essay (markdown) into visual media. Polyptych Studio ships two
fully independent pipelines — a slide deck generator and a single-page
infographic generator — built on multi-provider text generation (Gemini,
OpenAI, xAI, Anthropic, Vertex AI) and multi-provider image generation (Gemini,
OpenAI, xAI, Vertex AI via pixbridge).
Full documentation — tutorial, how-to guides, reference, and architecture explanation.
Pipelines
Each pipeline takes a source essay (markdown) and produces a different kind of visual output.
| Pipeline | Command | Output | Use case |
|---|---|---|---|
| Slide | polyptych deck |
Presentation deck (10–30 slides with images) | Essay-to-slides conversion |
| Infographic | polyptych infographic |
Single-page infographic(s), N variants | Quick visual summary of key data |
Both run unattended end-to-end: the LLM text tasks (slide: task1→task7;
infographic: i0→i2) run first, then image generation.
Both infographics above were generated by Polyptych Studio itself from
examples/about-polyptych-studio.mdusing theinfographicpipeline and thesemi-flat-vectorstyle.
For more examples, see the AI-generated part of my homepage: jdinkla.github.io/ai-generated.
Installation
Install the published package (the distribution and import name is polyptych;
this repository is polyptych-studio):
pip install polyptych # or: uv add polyptych
Or work from a clone of this repo:
uv sync
Optional external tool: ImageMagick (brew install imagemagick) for
collecting a slide deck into a PDF via just create-pdf.
Environment variables
Set a key for each provider you intend to use (copy .envrc.example to .envrc,
or export them however you manage secrets):
| Provider | Environment variable |
|---|---|
| Gemini (text + image) | GOOGLE_API_KEY |
| OpenAI (text + gpt-image-2) | OPENAI_API_KEY |
| xAI / Grok | XAI_API_KEY |
| Anthropic Claude | ANTHROPIC_API_KEY |
| Vertex AI | Application Default Credentials (gcloud auth application-default login) |
Quick start
An example source (examples/scene.md, a short noir scene) ships with the repo.
# Infographic (3 text tasks + images)
uv run polyptych infographic examples/scene.md -o generated/my-infographic
# Slide deck
uv run polyptych deck examples/scene.md -o generated/my-slides
With style presets
A few example visual-style presets ship under prompts/style-transfer/
(anime/, editorial/, infographic/, noir/, period-art/). Point --style
at any preset markdown file, or author your own (see
Write Style Prompts):
uv run polyptych deck examples/scene.md --style prompts/style-transfer/noir/cinematic-illustrative-noir.md
uv run polyptych infographic examples/scene.md --style prompts/style-transfer/infographic/semi-flat-vector.md
Presets, resume, and selective regeneration
# Reusable provider/size/quality bundles from image-presets.yaml
uv run polyptych deck examples/scene.md --image-preset openai-high
# Resume from image generation (text tasks already done)
uv run polyptych deck examples/scene.md -o generated/my-slides --from images
# Regenerate specific slides only
uv run polyptych deck examples/scene.md -o generated/my-slides --from images --slides 3,7,12
See the Resume Pipeline guide for details.
Use just --list for all workflow shortcuts and the
CLI Reference for the full flag set.
Operating modes
The system can be driven two ways:
- Python CLI — run
polyptychdirectly (or viajusttargets). Best for scripts, CI, batch runs, and reproducible pipelines. - Claude Code skills — inside a Claude Code session, type slash commands
like
/run-pipeline,/run-local-pipeline,/infographic,/review-regen,/edit-output. Best for exploration, guided iteration, and running text tasks with Claude as the LLM (zero API cost for text). The skill list is in CLAUDE.md.
Both surfaces share the same task templates, schemas, and output layout. See Operating Modes for the comparison.
Project structure
src/
common/ # Shared utilities (usage logging)
polyptych/ # Pipelines, CLI, models, tasks
pipeline.py # Pipeline orchestration (slide + infographic mixins)
cli.py # polyptych CLI
models/ # Pydantic schemas (slide.py, infographic.py)
tasks/ # Task implementations (task_01..task_07, task_i0..task_i2)
prompts/
tasks/ # Task prompt templates
style-transfer/ # Example visual style presets
providers/ # Provider-specific best practices
docs/ # Documentation (tutorial, how-to, reference, explanation)
model_config.yaml # Per-task LLM model tier configuration
image_model_config.yaml # Per-provider image generation model configuration
image-presets.yaml # Reusable image-generation presets
pipeline-presets.yaml # Pipeline-specific behavior presets
justfile # Common workflow shortcuts
Image generation is provided by the pixbridge
PyPI package (pixbridge CLI), which supports Gemini, OpenAI, xAI, and Vertex.
Using Vertex AI
gcloud auth login
gcloud auth application-default login
Vertex AI uses Application Default Credentials. The vertex text and image
providers use the same Gemini models but route through Google Cloud.
Continuous integration
.github/workflows/ci.yml runs on every pull request and on pushes to main,
gating three checks (a failure in any fails the build):
| Check | Command |
|---|---|
| Lint | uv run ruff check src/ |
| Type check | uv run pyright src/ |
| Unit tests | uv run pytest -m "not integration" tests/ |
Run the same locally with just lint, just typecheck, just test.
Integration tests (@pytest.mark.integration) are excluded — they call real,
paid LLM / image APIs. All dependencies (including pixbridge) resolve from
PyPI, so CI needs no special access.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polyptych-0.2.0.tar.gz.
File metadata
- Download URL: polyptych-0.2.0.tar.gz
- Upload date:
- Size: 250.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
733d17b0b503ec94e7ffc5adbd22b8e5d405a80dfd7c026dd9ecfa8ba4ae9ba4
|
|
| MD5 |
71917a51399c501f8750d2e1726b9ab8
|
|
| BLAKE2b-256 |
488af7511ce5a98f3513b6c2fab557f83e5f71ff5a01c32d820059a7fd5d9231
|
File details
Details for the file polyptych-0.2.0-py3-none-any.whl.
File metadata
- Download URL: polyptych-0.2.0-py3-none-any.whl
- Upload date:
- Size: 237.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d68bbf21402eda2972e4b508dcb61fdbf50acc30bbda3eb8bcb90fb5203c5e7e
|
|
| MD5 |
85c60f6d193dca7fd9ae94d8021ee9df
|
|
| BLAKE2b-256 |
1fa656451be0d8d3af8c0b6a4b51ee8eaf1b47bb20226892ed6d0cc6b8c25138
|