This fork is a controllable slide renderer:
- You write the outline as YAML slides.
- You pick a style pack from
styles/. - The tool composes prompts for Gemini 3 Pro Image Preview.
- Each slide is rendered as a full image that you can view, export to PDF, or wrap in PowerPoint.
Original write‑up for background and style inspiration:
Instead of building slides inside PowerPoint, you describe the talk as data:
- Outline:
slides.yamlholds the slide sequence and content. - Style: a style pack in
styles/describes the visual language. - Generator:
tools/generate_slides.pycombines style text, style images and your outline into prompts, and calls Gemini 3 Pro Image Preview.
The result is a folder of slide images, plus a PDF and a small HTML viewer.
-
Separation of concerns
Structure, content and visual style are defined separately and combined at render time. -
Consistent visual identity
The model sees both the style description and an example style image so decks tend to look coherent end to end. -
Style‑swappable decks
The sameslides.yamlcan be rendered in different styles just by changing--style.
-
Images, not editable shapes
Output is raster images. You cannot edit text inside PowerPoint; links are not clickable on the slide itself. -
Layout is a hint
layout:values are steering signals for the model, not strict layout constraints. -
Model and cost dependent
Renders depend on Gemini’s behaviour and pricing, so long decks and many iterations will consume API quota.
Compared to the original Nano Banana Pro repo, this fork:
- Uses YAML slide blocks (
slides.yamlby default, or any file via--yaml) rather than ad‑hoc markdown formats. - Provides multiple style packs in
styles/(for examplemodern_academic,chalkboard,clean_keynote,glass_garden). - Uses style reference images automatically when they are present for a style.
- Generates a PDF and a minimal HTML viewer for each run, in addition to the per‑slide images.
- Exposes standard flags for draft generation, upscaling to 4K, and optional PowerPoint export (image‑only slides).
Each style has:
-
A style file in
styles/, for example:styles/modern_academic.mdstyles/chalkboard.mdstyles/notebook_paper.mdstyles/glass_garden.md
-
An optional style reference image that shows one example slide in that look, for example:
imgs/style_ref_modern_academic_0.jpgimgs/style_ref_chalkboard_0.jpgimgs/style_ref_notebook_paper_0.jpgimgs/style_anchor_glass_garden_0.jpg
When you run:
python tools/generate_slides.py --yaml slides.yaml --style modern_academicthe generator:
- Loads the text spec from
styles/modern_academic.md. - If an image with a matching name exists in
imgs/(for example a file startingstyle_ref_modern_academic_), uses it as a global style anchor. - Also passes any per‑slide
assets:listed in the YAML (intended for semantic assets such as logos/QR codes).
This means the model is guided by both the written description and a concrete visual example, which improves consistency across slides.
You can also steer the overall tone with --mode:
structured: more literal, bullet-friendly layoutsbalanced: (default) mix structure with some expressive visualsexpressive: more visual/metaphorical while preserving information
For research-heavy decks, use prompts/outline_generator_research.md to generate a style-neutral outline with strict factual constraints.
You can scaffold a new style automatically:
python tools/make_style.py \
--name minimal_grid \
--description "Very clean research-talk style, thin grid, off-white background, mono accent colour."This creates styles/minimal_grid.md and a matching imgs/style_ref_minimal_grid_0.* anchor.
-
Create a style file Copy an existing file, for example:
cp styles/modern_academic.md styles/my_style.md
Edit the colours, typography and layout guidance so it describes your new style.
-
Generate an example slide image Use
tools/gemini_generate_image.pyto render one example slide in that style and save it underimgs/with a matching name, for example:python tools/gemini_generate_image.py \ --prompt "One example presentation slide in the 'My Style' visual language
described in styles/my_style.md"
--output imgs/style_ref_my_style
--size 1K --aspect-ratio 16:9
3. **Use it in your outline**
Keep the outline style‑neutral. Render with:
```bash
python tools/generate_slides.py --yaml slides.yaml --style my_style
The generator will automatically pick up both the style text and the matching style reference image if present.
Default outline file is slides.yaml in the repo root.
You can also point at any YAML file with --yaml.
Set repo-wide defaults in deck.yaml:
style_pack: modern_academic # style name or path under styles/
mode: balanced # structured | balanced | expressive
yaml: slides.yaml # default outline fileCLI flags override these values.
Outlines are style neutral. Choose the style with --style; per-slide
style is treated only as a variant (e.g. title, visual). YAML format is
--- separated slide documents, for example:
---
slide: 2 # explicit number
type: content # title | section | content | image_only |
transition
style: title # optional variant (e.g. title | visual)
layout: two_content # title_slide | title_and_content |
two_content | comparison | picture_with_caption | section_header | blank
generate: true # optional; defaults to true
title: Background problem
subtitle: The old world
text: # optional; omit for image‑only
columns:
- heading: Old
bullets:
- Fragmented visuals
- Manual layout
- Time sink
- heading: New
bullets:
- Cohesive visuals
- Minimal manual layout
- Faster iteration
visual: |
Two‑column composition: left shows fragmented assets; right shows a cohesive
rendered scene. Keep it style neutral; the style pack will define the medium.
assets:
- imgs/logo.png # optional per‑slide semantic asset (logo/QR)
notes: Optional speaker notes
image_only: false
---demo/chalkboard/: example run of the neutral outline rendered with--style chalkboard(images, PDF, PPTX, index).demo/notebook_paper/: example run of the same outline rendered with--style notebook_paper(images, PDF, PPTX, index).
Then render with a style pack, for example:
# Chalkboard look
python tools/generate_slides.py --yaml slides.yaml --style chalkboard --mode balanced
# Notebook paper look
python tools/generate_slides.py --yaml slides.yaml --style notebook_paper --mode structuredIf slides.yaml is missing, the tool falls back to
outlines/sample_slides.yaml.
Create 1K draft images for quick iteration:
python tools/generate_slides.py --yaml slides.yaml --style glass_garden --mode balancedThis writes a new run under:
generated_slides/<yaml-stem>/<timestamp>/
Each run directory contains:
slide_XX_0.<ext>– draft slide imagesslides.pdf– combined PDF versionindex.html– simple viewer that shows all slides in order
You can limit to specific slides with:
python tools/generate_slides.py --yaml slides.yaml --style glass_garden --slides
2 4 5Once you are happy with some drafts, upscale those images:
# Upscale all slides from the most recent run
python tools/generate_slides.py --enlarge
# Upscale specific slides from the most recent run
python tools/generate_slides.py --enlarge --slides 8 11
# Upscale slides from a specific run directory
python tools/generate_slides.py --enlarge --run-dir slides/20250101_120000If you have a script such as tools/export_pptx.py, you can wrap a run’s images
into a PPTX where each image is a full‑screen slide and notes come from the
YAML:
# 1) Generate slides as images
python tools/generate_slides.py --yaml slides.yaml --style modern_academic
# 2) Upscale if you want 4K (optional)
python tools/generate_slides.py --enlarge --run-dir slides/20250101_120000
# 3) Export to PPTX (image‑only slides)
python tools/export_pptx.py \
--run-dir generated_slides/slides/20250101_120000 \
--yaml slides.yaml \
--use-4k \
--output pptx/slides_modern_academic.pptxIf you do not need PowerPoint, you can present directly from the generated PDF or from the HTML viewer in the run directory.
-
Environment
uv venv # any virtualenv tool is fine source .venv/bin/activate pip install -r requirements.txt
-
Credentials
Create a
.envfile with your API key:GOOGLE_API_KEY=your_key_here
slides.yaml– default outline file.outlines/– extra outline examples, for exampleoutlines/sample_talk_outline.md.styles/– style packs (markdown descriptions).imgs/– style reference images and other assets.prompts/outline_generator.md– prompt for asking an LLM to generate YAML outlines.AGENTS.md– quick guide for agents using this repo.speak_notes.md– speaker notes for the demo talk.tools/– generation and upscaling scripts.generated_slides/– output from each run.index.html– Reveal.js talk about the project itself (not updated per run).