Skip to main content

Turn a source text into visual media — slide decks and single-page infographics, with multi-provider text and image generation

Project description

Polyptych Studio

Polyptych Studio — turn one essay into many coordinated visual panels

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: task1task7; infographic: i0i2) run first, then image generation.

How Polyptych Studio works: two pipelines, a model-agnostic multi-provider core, and the essay-to-image task flow

Both infographics above were generated by Polyptych Studio itself from examples/about-polyptych-studio.md using the infographic pipeline and the semi-flat-vector style.

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 polyptych directly (or via just targets). 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

Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polyptych-0.2.0.tar.gz (250.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polyptych-0.2.0-py3-none-any.whl (237.9 kB view details)

Uploaded Python 3

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

Hashes for polyptych-0.2.0.tar.gz
Algorithm Hash digest
SHA256 733d17b0b503ec94e7ffc5adbd22b8e5d405a80dfd7c026dd9ecfa8ba4ae9ba4
MD5 71917a51399c501f8750d2e1726b9ab8
BLAKE2b-256 488af7511ce5a98f3513b6c2fab557f83e5f71ff5a01c32d820059a7fd5d9231

See more details on using hashes here.

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

Hashes for polyptych-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d68bbf21402eda2972e4b508dcb61fdbf50acc30bbda3eb8bcb90fb5203c5e7e
MD5 85c60f6d193dca7fd9ae94d8021ee9df
BLAKE2b-256 1fa656451be0d8d3af8c0b6a4b51ee8eaf1b47bb20226892ed6d0cc6b8c25138

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page