PaperBanana: A Multi-Agent Framework for Automated Academic Illustration
What Problem Does PaperBanana Solve
PaperBanana transforms raw paper text into publication-quality academic diagrams and statistical plots through a multi-agent framework. Forked from Google Research’s PaperVizAgent, it’s now community-maintained and accepted as an ICML 2026 Spotlight.
The system orchestrates five specialized agents in a pipeline. Retriever Agent finds reference diagrams from PaperBananaBench. Planner Agent translates method content and intent into detailed textual descriptions. Stylist Agent modifies descriptions using automatically synthesized style guidelines to meet academic aesthetic standards. Visualizer Agent calls image generation models to turn text into visuals. Critic Agent forms a feedback loop with Visualizer, iterating through multiple rounds until quality targets are met.
Environment Setup and API Configuration Pitfalls
The smoothest way to get this running is following the official uv toolchain recommendation. API configuration only needs one key.
Clone the repository and install uv. Run uv venv to create a virtual environment and activate it. Install Python with uv python install 3.12, then execute uv pip install -r requirements.txt to install dependencies.
API configuration is where people get stuck. Copy configs/model_config.template.yaml to configs/model_config.yaml. Fill in defaults.main_model_name and defaults.image_gen_model_name in the YAML file. You only need one API key. Fill google_api_key for Gemini, or openrouter_api_key for OpenRouter’s aggregated models. If both are configured, the system prioritizes OpenRouter.
If you need to generate multiple candidates simultaneously, your API key must support high concurrency, otherwise you’ll hit frequent timeout errors.
Dataset Download and Retrieval Strategy
You must download the reference dataset and lock the retrieval parameter to auto.
Run python scripts/prepare_bench.py to download PaperBananaBench into the data/PaperBananaBench/ directory.
Download this dataset. The framework is designed to run without it, but Retriever Agent needs these reference examples for in-context learning. Without reference images, generation quality drops significantly.
The CLI’s --retrieval_setting and the Web UI’s Retrieval Setting must stay at the default auto. If data/PaperBananaBench/diagram/ref.json is missing, auto falls back to none, causing the system to lose style references. Never manually change it to none.
Three Launch Methods and Parameter Mapping
Gradio suits quick parameter tuning, Streamlit works for watching evolution processes, CLI handles batch processing.
Run python app.py to launch the Gradio Web App. Note the Figure Size mapping rules. 1-3cm and 4-6cm map to 1k resolution, 7-9cm and 10-13cm map to 2k, 14-17cm maps to 4k. This mapping only applies to Gemini and OpenRouter calls. OpenAI’s gpt-image uses fixed-size API paths.
Run streamlit run demo.py to launch the Streamlit Demo. The Generate Candidates tab supports parallel generation of up to 20 candidate diagrams and shows evolution timelines. The Refine Image tab lets you upload original images for local modifications or super-resolution upscaling to 2K/4K.
Run python main.py for command-line usage. Experiment modes include the following. vanilla generates directly without planning or refinement. dev_planner goes Retriever → Planner → Visualizer. dev_full runs the complete pipeline with all 5 agents. demo_full runs the full pipeline without evaluation, suitable for quick result viewing.
Quick Reference Checklist
-
Clone the repository and enter the directory -
Use uv to create a Python 3.12 virtual environment and install dependencies -
Copy the YAML template, fill in at least one API key and model name -
Run prepare_bench.pyto download the reference dataset -
Launch Gradio or Streamlit interface, keep retrieval at auto
Frequently Asked Questions
Do I need to configure both Google and OpenRouter API keys
No. Configure either one. If both are set, the system prioritizes OpenRouter for routing.
Why is the generated image quality poor and lacks academic feel
Check whether you downloaded the PaperBananaBench dataset and ensure retrieval setting stays at auto. Missing reference examples prevent Stylist Agent from applying academic style guidelines.
What should I do when parallel candidate generation frequently errors
Check your API key quota and concurrency limits. Generating multiple candidates simultaneously requires API keys supporting high concurrency. Standard free tiers easily trigger rate limiting.
What’s the relationship between Gradio’s size options and actual generated image resolution
1-3cm and 4-6cm correspond to 1k resolution, 7-9cm and 10-13cm correspond to 2k resolution, 14-17cm corresponds to 4k resolution. This rule applies to Gemini and OpenRouter models.
What’s the difference between dev_full and demo_full in the command line
dev_full runs the complete agent pipeline including evaluation, while demo_full runs the full pipeline but skips evaluation, suitable for scenarios where you only want to quickly view generation results.
Does the framework support generating statistical data plots
Yes. Specify the task type through --task_name "plot" in the command line to handle data plots. The default value diagram handles conceptual flow diagrams.

