Paper2Slides: From Paper to Presentation in One Click

December 31, 2025 Β· View on GitHub

Paper2Slides Logo

Paper2Slides: From Paper to Presentation in One Click

Python License Feishu WeChat

✨ Never Build Slides from Scratch Again ✨

| πŸ“„ Universal File Support Β |Β  🎯 RAG-Powered Precision Β |Β  🎨 Custom Styling Β |Β  ⚑ Lightning Speed |


🎯 What is Paper2Slides?

Turns your research papers, reports, and documents into professional slides & posters in minutes.

✨ Key Features

  • πŸ“„ Universal Document Support
    Seamlessly process PDF, Word, Excel, PowerPoint, Markdown, and multiple file formats simultaneously.

  • 🎯 Comprehensive Content Extraction
    RAG-powered mechanism ensures every critical insight, figure, and data point is captured with precision.

  • πŸ”— Source-Linked Accuracy
    Maintains direct traceability between generated content and original sources, eliminating information drift.

  • 🎨 Custom Styling Freedom
    Choose from professional built-in themes or describe your vision in natural language for custom styling.

  • ⚑ Lightning-Fast Generation
    Instant preview mode enables rapid experimentation and real-time refinements.

  • πŸ’Ύ Seamless Session Management
    Advanced checkpoint system preserves all progressβ€”pause, resume, or switch themes instantly without loss.

  • ✨ Professional-Grade Visuals
    Deliver polished, presentation-ready slides and posters with publication-quality design standards.

⚑ Easy as One Command

# One command to generate slides from a paper
python -m paper2slides --input paper.pdf --output slides --style doraemon --length medium --fast --parallel 2

πŸ”₯ News

  • [2025.12.09] Added parallel slide generation (--parallel) for faster processing
  • [2025.12.08] Paper2Slides is now open source!

🎨 Custom Styling Showcase


doraemon

academic

custom

doraemon

academic

custom

✨ Multiple styles available β€” simply modify the --style parameter
Examples from DeepSeek-V3.2: Pushing the Frontier of Open Large Language Models

πŸ’‘ Custom Style Example: Totoro Theme
--style "Studio Ghibli anime style with warm whimsical aesthetic. Use soft watercolor Morandi tones with light cream background, muted sage green and dusty pink accents. Totoro character can appear as a friendly guide relating to the content, with nature elements like soft clouds or leaves."

🌐 Paper2Slides Web Interface


πŸ“‹ Table of Contents


πŸƒ Quick Start

1. Environment Setup

# Clone repository
git clone https://github.com/HKUDS/Paper2Slides.git
cd Paper2Slides

# Create and activate conda environment
conda create -n paper2slides python=3.12 -y
conda activate paper2slides

# Install dependencies
pip install -r requirements.txt

Note

Create a .env file in paper2slides/ directory with your API keys. Refer to paper2slides/.env.example for the required variables.

2. Command Line Usage

# Basic usage - generate slides from a paper
python -m paper2slides --input paper.pdf --output slides --length medium

# Generate poster with custom style
python -m paper2slides --input paper.pdf --output poster --style "minimalist with blue theme" --density medium

# Fast mode
python -m paper2slides --input paper.pdf --output slides --fast

# Enable parallel generation (2 workers by default)
python -m paper2slides --input paper.pdf --output slides --parallel 2

# List all processed outputs
python -m paper2slides --list

CLI Options:

OptionDescriptionDefault
--input, -iInput file(s) or directoryRequired
--outputOutput type: slides or posterposter
--contentContent type: paper or generalpaper
--styleStyle: academic, doraemon, or customdoraemon
--lengthSlides length: short, medium, longshort
--densityPoster density: sparse, medium, densemedium
--fastFast mode: skip RAG indexingfalse
--parallelEnable parallel slide generation: --parallel uses 2 workers, --parallel N uses N workers1 (sequential without this option)
--from-stageForce restart from stage: rag, summary, plan, generateAuto-detect
--debugEnable debug loggingfalse

πŸ’Ύ Checkpoint & Resume:

Paper2Slides intelligently saves your progress at every key stage, allowing you to:

ScenarioCommand
Resume after interruptionJust run the same command again β€” it auto-detects and continues
Change style onlyAdd --from-stage plan to skip re-parsing
Regenerate imagesAdd --from-stage generate to keep the same plan
Full restartAdd --from-stage rag to start from scratch

Tip

Checkpoints are auto-saved. Just run the same command to resume. Use --from-stage only to force restart from a specific stage.

3. Web Interface

Launch both backend and frontend services:

./scripts/start.sh

Or start services independently:

# Terminal 1: Start backend API
./scripts/start_backend.sh

# Terminal 2: Start frontend
./scripts/start_frontend.sh

Access the web interface at http://localhost:5173 (default)


πŸ—οΈ Paper2Slides Framework

Paper2Slides transforms documents through a 4-stage pipeline designed for reliability and efficiency:

StageDescriptionCheckpointOutput
πŸ” RAGParse documents and construct intelligent retrieval index using RAGcheckpoint_rag.jsonSearchable knowledge base
πŸ“Š AnalysisExtract document structure, identify key figures, tables, and content hierarchycheckpoint_summary.jsonStructured content map
πŸ“‹ PlanningGenerate optimized content layout and slide/poster organization strategycheckpoint_plan.jsonPresentation blueprint
🎨 CreationRender final high-quality slides and poster visualsOutput directoryPolished presentation materials

πŸ’Ύ Smart Recovery System

Each stage automatically saves progress checkpoints, enabling seamless resumption from any point if the process is interruptedβ€”no need to start over.

Fast Mode vs Normal Mode

ModeProcessing PipelineUse Cases
NormalComplete RAG indexing with deep document analysisComplex research papers, lengthy documents, multi-section content
FastSkip RAG indexing, direct LLM queryShort documents, instant previews, quick revisions

Use --fast when:

  • Document (text + figures) is short enough to fit in LLM context
  • Quick preview/iteration needed
  • Don't want to wait for RAG indexing

Use normal mode (default) when:

  • Document is long or has many figures
  • Multiple files to process together
  • Need retrieval for better context selection

βš™οΈ Configuration

Output Directory Structure

outputs/
β”œβ”€β”€ <project_name>/
β”‚   β”œβ”€β”€ <content_type>/                   # paper or general
β”‚   β”‚   β”œβ”€β”€ <mode>/                       # fast or normal
β”‚   β”‚   β”‚   β”œβ”€β”€ checkpoint_rag.json       # RAG query results & parsed file paths
β”‚   β”‚   β”‚   β”œβ”€β”€ checkpoint_summary.json   # Extracted content, figures, tables
β”‚   β”‚   β”‚   β”œβ”€β”€ summary.md                # Human-readable summary
β”‚   β”‚   β”‚   └── <config_name>/            # e.g., slides_doraemon_medium
β”‚   β”‚   β”‚       β”œβ”€β”€ state.json            # Current pipeline state
β”‚   β”‚   β”‚       β”œβ”€β”€ checkpoint_plan.json  # Content plan for slides/poster
β”‚   β”‚   β”‚       └── <timestamp>/          # Generated outputs
β”‚   β”‚   β”‚           β”œβ”€β”€ slide_01.png
β”‚   β”‚   β”‚           β”œβ”€β”€ slide_02.png
β”‚   β”‚   β”‚           β”œβ”€β”€ ...
β”‚   β”‚   β”‚           └── slides.pdf        # Final PDF output
β”‚   β”‚   └── rag_output/                   # RAG index storage
β”‚   └── ...
└── ...

Checkpoint Files:

FileDescriptionReusable When
checkpoint_rag.jsonParsed document contentSame input files
checkpoint_summary.jsonFigures, tables, structureSame input files
checkpoint_plan.jsonContent layout planSame style & length/density

Style Configuration

StyleDescription
academicClean, professional academic presentation style
doraemonColorful, friendly style with illustrations
customAny text description for LLM-generated style

Image Generation Providers

  • Set IMAGE_GEN_PROVIDER in paper2slides/.env to choose the backend:
    • openrouter (default): uses IMAGE_GEN_API_KEY, IMAGE_GEN_BASE_URL, and IMAGE_GEN_MODEL (default google/gemini-3-pro-image-preview)
    • google: uses the official Gemini API at GOOGLE_GENAI_BASE_URL (default https://generativelanguage.googleapis.com/v1beta), IMAGE_GEN_API_KEY, IMAGE_GEN_MODEL (default models/gemini-3-pro-image-preview, must be image-capable), and IMAGE_GEN_RESPONSE_MIME_TYPE (default text/plain; use text types if your model does not support image responses)
  • Reference figures are sent as inline data when supported (Google) or as image_url attachments (OpenRouter).

Image Generation Notes

Tip

By default Paper2Slides uses gemini-3-pro-image-preview (OpenRouter) for image generation; you can switch to an image-capable Google Gemini model (e.g., models/gemini-1.5-flash) via IMAGE_GEN_PROVIDER=google. Key findings:

  • Mood Keywords: Words like "warm", "elegant", "vibrant" strongly influence the overall color palette
  • Layout vs Style: Fine-grained layout instructions ground well; fine-grained element styling does not
  • Prompt Length: Simple prompts generally outperform detailed ones
  • Multi-slide Generation: Native multi-image output is story-like; for consistent slides, we use iterative single-image generation

πŸ“ Code Structure

ModuleDescription
paper2slides/core/Pipeline orchestration, 4-stage execution
paper2slides/raganything/Document parsing & RAG indexing
paper2slides/summary/Content extraction: figures, tables, paper structure
paper2slides/generator/Content planning & image generation
api/FastAPI backend for web interface
frontend/React frontend (Vite + TailwindCSS)
Click to expand full project structure
Paper2Slides/
β”œβ”€β”€ paper2slides/                 # Core library
β”‚   β”œβ”€β”€ main.py                   # CLI entry point
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ pipeline.py           # Main pipeline orchestration
β”‚   β”‚   β”œβ”€β”€ state.py              # Checkpoint state management
β”‚   β”‚   └── stages/
β”‚   β”‚       β”œβ”€β”€ rag_stage.py      # Stage 1: Parse & index
β”‚   β”‚       β”œβ”€β”€ summary_stage.py  # Stage 2: Extract content
β”‚   β”‚       β”œβ”€β”€ plan_stage.py     # Stage 3: Plan layout
β”‚   β”‚       └── generate_stage.py # Stage 4: Generate images
β”‚   β”‚
β”‚   β”œβ”€β”€ raganything/
β”‚   β”‚   β”œβ”€β”€ raganything.py        # RAG processor
β”‚   β”‚   └── parser.py             # Document parser
β”‚   β”‚
β”‚   β”œβ”€β”€ summary/
β”‚   β”‚   β”œβ”€β”€ paper.py              # Paper structure extraction
β”‚   β”‚   └── extractors/           # Figure/table extractors
β”‚   β”‚
β”‚   β”œβ”€β”€ generator/
β”‚   β”‚   β”œβ”€β”€ content_planner.py    # Slide/poster planning
β”‚   β”‚   └── image_generator.py    # Image generation
β”‚   β”‚
β”‚   β”œβ”€β”€ prompts/                  # LLM prompt templates
β”‚   └── utils/                    # Utilities
β”‚
β”œβ”€β”€ api/server.py                 # FastAPI backend
β”œβ”€β”€ frontend/src/                 # React frontend
└── scripts/                      # Shell scripts (start/stop)


🌟Found Paper2Slides helpful? Star us on GitHub!

πŸš€ Turn any document into professional presentations in minutes!


Star History

Star History Chart


❀️ Thanks for visiting ✨ Paper2Slides!

Views