Generate publication-quality academic methodology diagrams and statistical plots from text descriptions using a multi-agent Gemini pipeline. Use when the user wants to create scientific figures, methodology diagrams, architecture diagrams, or statistical plots for academic papers. Triggers on requests like "generate a diagram", "create a methodology figure", "make a plot for my paper", or "illustrate this architecture".
Single-file multi-agent pipeline for academic illustration generation using Google Gemini. Distills the full PaperBanana framework into one script.
# Download reference dataset (one-time setup, or done automatically on first run)
uv run scripts/paperbanana_lite.py setup
# Diagram generation
uv run scripts/paperbanana_lite.py generate \
--input methodology.txt \
--caption "Overview of our encoder-decoder architecture"
# Plot generation
uv run scripts/paperbanana_lite.py plot \
--data results.json \
--intent "Bar chart comparing model accuracy"
Requires GEMINI_API_KEY (or GOOGLE_API_KEY as fallback):
export GEMINI_API_KEY="your-key"
Install dependencies:
pip install google-genai pillow tenacity
Phase 1 — Linear Planning:
Phase 2 — Iterative Refinement (up to N iterations): 4. Visualizer — renders image (Gemini image gen for diagrams, matplotlib code for plots) 5. Critic — evaluates quality, provides revision feedback; loops back to step 4
setup (download references)Downloads the curated reference dataset (~937 KB) from GitHub to a local cache. This is optional — references are fetched automatically on first generate or plot run if not already present.
| Option | Required | Default | Description |
|---|---|---|---|
--target-dir | No | ~/.paperbanana/reference_sets | Where to store references |
Reference lookup order during generation:
--reference-dir if explicitly provideddata/reference_sets (local repo directory)~/.paperbanana/reference_sets (shared cache)generate (methodology diagrams)| Option | Required | Default | Description |
|---|---|---|---|
--input | Yes | — | Text file with methodology section |
--caption | Yes | — | Figure caption |
--reference-dir | No | data/reference_sets | Reference set directory |
--iterations | No | 3 | Refinement iterations |
--output-dir | No | outputs | Output directory |
plot (statistical plots)| Option | Required | Default | Description |
|---|---|---|---|
--data | Yes | — | JSON file with raw data |
--intent | Yes | — | Visual intent caption |
--reference-dir | No | data/reference_sets | Reference set directory |
--iterations | No | 3 | Refinement iterations |
--output-dir | No | outputs | Output directory |
Results saved to outputs/run_<timestamp>/:
final_output.png — final generated imageplanning.json — retrieved examples and descriptioniter_N.png — image from each iterationiter_N_details.json — description and critic feedback per iterationReferences are automatically downloaded from GitHub on first use. You can also manually set up references:
# Explicit setup to default cache (~/.paperbanana/reference_sets)
uv run scripts/paperbanana_lite.py setup
# Setup to a custom location
uv run scripts/paperbanana_lite.py setup --target-dir ./my-references
For custom reference sets, the --reference-dir must point to a directory containing an index.json with curated examples. Each example needs: id, source_context, caption, image_path. See references/reference-set-format.md for the schema.