skills/scientific-slides/references/script_reference.md
Arguments, options, and usage for generate_slide_image.py, slides_to_pdf.py,
validate_presentation.py, and pdf_to_images.py, plus the pptx-skill scripts and
external tools this skill relies on.
Generate presentation slides or visuals using Nano Banana Pro AI.
# Full slide (default) - generates complete slide as image
python scripts/generate_slide_image.py "slide description" -o output.png
# Visual only - generates just the image/figure for embedding in PPT
python scripts/generate_slide_image.py "visual description" -o output.png --visual-only
# With reference images attached (Nano Banana Pro will see these)
python scripts/generate_slide_image.py "Create a slide explaining this chart" -o slide.png --attach chart.png
python scripts/generate_slide_image.py "Combine these into a comparison slide" -o compare.png --attach before.png --attach after.png
Options:
-o, --output: Output file path (required)--attach IMAGE: Attach image file(s) as context for generation (can use multiple times)--visual-only: Generate just the visual/figure, not a complete slide--iterations: Max refinement iterations (default: 2)--api-key: OpenRouter API key (or set OPENROUTER_API_KEY env var)-v, --verbose: Verbose outputAttaching Reference Images:
Use --attach when you want Nano Banana Pro to see existing images as context:
Environment Setup:
export OPENROUTER_API_KEY='your_api_key_here'
# Get key at: https://openrouter.ai/keys
Combine multiple slide images into a single PDF.
# Combine PNG files
python scripts/slides_to_pdf.py slides/*.png -o presentation.pdf
# Combine specific files in order
python scripts/slides_to_pdf.py title.png intro.png methods.png -o talk.pdf
# From directory (sorted by filename)
python scripts/slides_to_pdf.py slides/ -o presentation.pdf
Options:
-o, --output: Output PDF path (required)--dpi: PDF resolution (default: 150)-v, --verbose: Verbose outputTip: Name slides with numbers for correct ordering: 01_title.png, 02_intro.png, etc.
generate_slide_image.py - Generate slides or visuals with AI:
# Full slide (for PDF workflow)
python scripts/generate_slide_image.py "Title: Introduction\nContent: Key points" -o slide.png
# Visual only (for PPT workflow)
python scripts/generate_slide_image.py "Diagram description" -o figure.png --visual-only
# Options:
# -o, --output Output file path (required)
# --visual-only Generate just the visual, not complete slide
# --iterations N Max refinement iterations (default: 2)
# -v, --verbose Verbose output
slides_to_pdf.py - Combine slide images into PDF:
# From glob pattern
python scripts/slides_to_pdf.py slides/*.png -o presentation.pdf
# From directory (sorted by filename)
python scripts/slides_to_pdf.py slides/ -o presentation.pdf
# Options:
# -o, --output Output PDF path (required)
# --dpi N PDF resolution (default: 150)
# -v, --verbose Verbose output
validate_presentation.py:
python scripts/validate_presentation.py presentation.pdf --duration 15
# Checks:
# - Slide count vs. recommended range
# - File size warnings
# - Slide dimensions
# - Font sizes (PowerPoint)
# - Compilation (Beamer)
pdf_to_images.py:
python scripts/pdf_to_images.py presentation.pdf output/slide --dpi 150
# Converts PDF to images for visual inspection
# Supports: JPG, PNG
# Adjustable DPI
# Page range selection
From skills/pptx/scripts/:
thumbnail.py: Create thumbnail gridsrearrange.py: Duplicate and reorder slidesinventory.py: Extract text contentreplace.py: Update text programmaticallyRecommended: