Skip to content

genmini-ai/OpenCanvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

66 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OpenCanvas

Python 3.8+ License: MIT

AI-powered presentation generation system that creates beautiful HTML slide decks from topics or PDF documents, with automatic quality evaluation and continuous improvement.

✨ Features

  • 🎨 Dual Input Support - Generate from text topics or PDF documents
  • πŸ” Smart Research - Automatic web research when knowledge is insufficient
  • πŸ“Š AI Evaluation - Comprehensive quality assessment with Claude, GPT, or Gemini
  • 🎯 Multiple Themes - Professional themes for different presentation contexts
  • πŸ”„ HTML to PDF - High-quality PDF conversion with customizable zoom
  • πŸ“ Organized Output - Structured folders with timestamps and source tracking
  • πŸš€ REST API - Full RESTful interface for programmatic access
  • πŸ€– Self-Evolution - Autonomous system that improves presentation quality over time

presentation example

Example presentation generated from: Training Large Language Models to Reason in a Continuous Latent Space https://arxiv.org/pdf/2412.06769

## πŸš€ Quick Start

Installation

git clone https://github.com/genmini-ai/OpenCanvas.git
cd OpenCanvas
pip install -e .
playwright install chromium

Configuration

cp .env.example .env
# Edit .env with your API keys

Required: ANTHROPIC_API_KEY (get from console.anthropic.com) Optional: BRAVE_API_KEY, GEMINI_API_KEY, OPENAI_API_KEY

Generate Your First Presentation

# From a topic
opencanvas generate "AI in healthcare" --purpose "academic presentation"

# From a PDF
opencanvas generate "https://arxiv.org/pdf/2505.20286" --purpose "research seminar"

# Full pipeline (generate + convert + evaluate)
opencanvas pipeline "quantum computing" --purpose "conference talk" --evaluate

πŸ“– Usage

CLI Commands

Generate

# Topic-based generation
opencanvas generate "sustainable energy solutions" \
  --purpose "corporate presentation" \
  --theme "natural earth"

# PDF-based generation (images extracted by default)
opencanvas generate "paper.pdf" --purpose "conference presentation"

# Disable image extraction
opencanvas generate "paper.pdf" --no-extract-images

Convert to PDF

opencanvas convert output/slides.html \
  --output presentation.pdf \
  --zoom 1.5

Evaluate Quality

opencanvas evaluate evaluation_folder/

Complete Pipeline

opencanvas pipeline "machine learning ethics" \
  --purpose "academic seminar" \
  --evaluate \
  --zoom 1.3

API Usage

Start the API server:

opencanvas api --host 0.0.0.0 --port 8000

Make requests:

curl -X POST "http://localhost:8000/api/v1/generate" \
  -H "Content-Type: application/json" \
  -d '{
    "input_source": "AI in healthcare",
    "purpose": "academic presentation",
    "theme": "professional blue"
  }'

Documentation: http://localhost:8000/docs Full API Guide: API_README.md

πŸ“ Output Structure

OpenCanvas creates organized directories for all outputs:

output/
└── quantum_computing_20241128_120000/
    β”œβ”€β”€ slides/
    β”‚   β”œβ”€β”€ quantum_computing_slides.html
    β”‚   └── quantum_computing_presentation.pdf
    β”œβ”€β”€ evaluation/
    β”‚   └── quantum_computing_evaluation.json
    └── sources/
        β”œβ”€β”€ source_content.txt          # For topic-based
        └── source.pdf                  # For PDF-based

βš™οΈ Configuration

Environment Variables

Variable Required Default Description
ANTHROPIC_API_KEY βœ… - Claude API key (generation)
BRAVE_API_KEY ❌ - Web search API key
GEMINI_API_KEY ❌ - Gemini API key (evaluation)
OPENAI_API_KEY ❌ - OpenAI API key (evaluation)
EVALUATION_PROVIDER ❌ gemini claude, gpt, or gemini
EVALUATION_MODEL ❌ gemini-2.5-flash Model for evaluation
DEFAULT_THEME ❌ professional blue Presentation theme
DEFAULT_ZOOM ❌ 1.2 PDF zoom factor

Available Themes

  • professional blue - Clean corporate design
  • clean minimalist - Simple elegant layout
  • natural earth - Warm earth tones
  • modern contemporary - Trendy cutting-edge
  • warm earth tones - Cozy approachable
  • bold high contrast - High-impact design

Full list: See themes.py

πŸ§ͺ Testing

# Run full test suite
python run_tests.py

# Light mode (faster)
python run_tests.py light

# Specific tests
python run_tests.py topic  # Topic generation only
python run_tests.py pdf    # PDF generation only

πŸ€– Evolution System

OpenCanvas includes an autonomous improvement system that learns from evaluation results:

# Run evolution cycle
opencanvas evolve --max-iterations 3 --improvement-threshold 0.15

The system automatically:

  • Evaluates presentation quality
  • Identifies improvement opportunities
  • Evolves prompts and generates new tools
  • Tracks performance improvements

Learn more: docs/architecture/evolution-system.md

πŸ“š Documentation

πŸ”§ Troubleshooting

Common Issues

"opencanvas command not found"

pip install -e .
which opencanvas

"ANTHROPIC_API_KEY is required"

cat .env | grep ANTHROPIC_API_KEY

Playwright not available

playwright install chromium
# Or use selenium
opencanvas convert slides.html --method selenium

Web research not working

# Add BRAVE_API_KEY to .env for web research
# Without it, generation uses only Claude's knowledge

More troubleshooting: docs/troubleshooting.md

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Setup

git clone https://github.com/genmini-ai/OpenCanvas.git
cd OpenCanvas
pip install -r requirements-all.txt
playwright install chromium

Running Tests

python run_tests.py
pytest tests/

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

Built with:


Star this repo if you find it useful! ⭐

About

Generate stunning presentations from any topic or PDF in minutes - with AI evaluation and self-evolution

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •