PaperBanana - Academic Illustration Generator

SkillFiles & storage

Multi-agent pipeline (Retriever → Planner → Stylist → Visualizer → Critic) for publication-quality academic diagrams, statistical plots, and presentation slides.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the PaperBanana - Academic Illustration Generator skill

About this capability

Use when user needs academic diagrams, methodology figures, statistical plots, or presentation slides from text descriptions or data files. Also use for evaluating generated figures against references.

What this skill tells your AI

The instructions your AI receives, as published by plutolei/paperbanana-skill in plugins/paperbanana/skills/paperbanana/SKILL.md and read by ahel’s review.

Multi-agent pipeline (Retriever → Planner → Stylist → Visualizer → Critic) for publication-quality academic diagrams, statistical plots, and presentation slides.

API key: Set provider keys in PaperBanana project's .env file. Timeout: 300000 (5 min) for all generation commands.


Commands

All commands run from project root: cd <paperbanana_dir> && python -m paperbanana.cli <cmd>

Command Selection Decision Tree

Route user requests to the right subcommand before looking up parameters:

User intentSignal wordsSubcommand
方法论/架构/流程图 from text or PDF"method figure", "架构图", "流程图", "methodology", "pipeline diagram", "论文配图"generate
Statistical plot from data file"plot", "curve", "bar chart", "scatter", "heatmap", has CSV/JSONplot
Single presentation slide"slide", "一张幻灯片", "封面图", single prompt fileslide
Batch slide generation"all slides", "批量生成", "N 张幻灯片", prompts/ directoryslide-batch
Compare generated vs human reference"evaluate", "对比", "与参考图对比"evaluate
Manage reference dataset"download dataset", "清缓存"data
First-time provider config"setup", "配置 API key"setup

Ambiguous input: If user provides just a description with no subcommand signal, default to generate (see Argument Parsing table for details).

Out-of-scope: Pure code generation (matplotlib/seaborn script) is NOT paperbanana's job — those go to matplotlib / scientific-visualization skills. Paperbanana is for AI-driven image generation + critique loops.

Note (upstream sync pending): Upstream paperbanana CLI also adds subcommands (plot-batch #123, sweep #118) not yet reflected in this table. See the llmsresearch/paperbanana CHANGELOG for the authoritative CLI surface.

generate — Methodology Diagrams

python -m paperbanana.cli generate --input '<file>' --caption '<caption>' --optimize --verbose

When user provides inline text (no file): write to temp file, use as --input.

ParameterDefaultDescription
--input / -iPath to methodology text file or PDF (.pdf requires pip install 'paperbanana')
--caption / -cFigure caption / communicative intent
--output / -oautoOutput image path
--vlm-providergeminiVLM provider: gemini, anthropic, openai, bedrock, openrouter, ollama, claude_code, litellm
--vlm-modelautoVLM model name
--image-providerautoImage gen provider: google_imagen, openai, bedrock, openrouter
--image-modelautoImage gen model name
--iterations / -n3Max critic rounds
--autooffLoop until critic is satisfied (safety cap via --max-iterations)
--max-iterations30Safety cap for --auto mode
--optimizeoffPreprocess inputs (parallel enrichment + caption sharpening)
--continueoffContinue from the latest run
--continue-runContinue from a specific run ID
--feedbackUser feedback for the critic when continuing a run
--aspect-ratio / -arautoTarget aspect ratio: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9
--format / -fpngOutput format: png, jpeg, webp
--dry-runoffValidate inputs without making API calls
--exemplar-retrievaloffEnable external exemplar retrieval before planning
--seedRandom seed for reproducible generation
--verbose / -voffShow detailed agent progress and timing
--auto-download-dataoffAuto-download expanded reference set (~257MB) on first run
--venueAcademic venue style: neurips, icml, acl, ieee, custom
--pagesPage range for PDF input (e.g., 3-5)
--configPath to config YAML file

Venue styles: --venue neurips applies NeurIPS-specific methodology and plot style guides from data/guidelines/. Each venue has distinct color palettes, layout conventions, and typography expectations.

PDF input: --input paper.pdf --pages 3-5 extracts text from the specified pages as source context.

Exemplar advanced flags: --exemplar-retrieval enables retrieval; see generate --help for additional config flags (--exemplar-endpoint, --exemplar-mode, --exemplar-top-k, --exemplar-timeout, --exemplar-retries).

plot — Statistical Plots

python -m paperbanana.cli plot --data '<data.csv>' --intent '<intent>' --optimize --verbose
ParameterDefaultDescription
--data / -dPath to data file (CSV or JSON) [required]
--intentCommunicative intent for the plot [required]
--output / -oautoOutput image path
--vlm-providergeminiVLM provider
--iterations / -n3Refinement iterations
--format / -fpngOutput format
--aspect-ratio / -arautoTarget aspect ratio
--optimizeoffEnrich context and sharpen caption
--autooffLoop until critic satisfied
--verbose / -voffDetailed progress

slide — Presentation Slides

python -m paperbanana.cli slide --input '<prompt.md>' --resolution 4k
ParameterDefaultDescription
--input / -iPath to slide prompt markdown file [required]
--caption / -cautoSlide intent description
--output / -oautoOutput image path
--image-modelautoImage gen model
--vlm-modelautoVLM model name
--iterations / -n3Max critic rounds
--style / -sStyle preset name (see table below)
--list-stylesoffList all available style presets and exit
--resolution / -r4kOutput resolution: 1k, 2k, 4k
--configPath to config YAML file

slide-batch — Batch Slide Generation

python -m paperbanana.cli slide-batch --prompts-dir '<dir>' --resolution 4k
ParameterDefaultDescription
--prompts-dirDirectory containing slide prompt markdown files [required]
--output-dirautoOutput directory
--image-modelautoImage gen model
--style / -sStyle preset applied to all slides
--iterations / -n3Max critic rounds per slide
--resolution / -r4kOutput resolution
--concurrent / -c2 (settings.batch_concurrent)Slides generated concurrently; 3 is the sweet spot, never exceed 4. Requires a paperbanana build ≥ 2026-08-03 (maintainer's fork)

Wave-Parallel Batch Generation (speed default for ≥2 slides)

With a concurrency-enabled paperbanana build, batch generation runs slides in parallel with identical per-slide quality — every slide keeps its full Critic loop, its own pipeline instance, and its own run directory:

python -m paperbanana.cli slide-batch --prompts-dir '<dir>' --output-dir '<out>' --resolution 4k --concurrent 3

Measured (2026-08-03): 6 slides at --concurrent 3 in 309s vs 768s serial estimate (0.40x, ~2.5x speedup). Built-in resilience: 5s start-up stagger (same-second bursts to the image API fail or hang server-side long before per-minute quotas are near), in-batch delayed retry for transient 503s (recovery overlaps with other slides), and an end-of-batch serial retry pass for stragglers. Delivery quality is protected twice over: the final image per slide is the highest-critic-score iteration (not simply the last), and critic_score_threshold=9.0 skips provably-done rounds early — calibrated on 69 historical runs with zero false early-stops.

If the installed paperbanana lacks --concurrent, fall back to serial slide-batch — do NOT spawn more than 3 parallel slide processes yourself, as there is no cross-process rate-limit coordination.

Style Presets (23 available)

Use --style <name> with slide or slide-batch. Use --list-styles to see all.

StyleSourceBest For
blueprintbaoyuArchitecture, system design, technical
chalkboardbaoyuClassroom, teaching, education
corporatebaoyuBusiness, investor, quarterly reports
minimalbaoyuExecutive briefings, clean/simple
sketch-notesbaoyuTutorials, guides, beginner content
watercolorbaoyuLifestyle, wellness, artistic
dark-atmosphericbaoyuEntertainment, gaming, cinematic
notionbaoyuSaaS, product, dashboards
bold-editorialbaoyuProduct launches, keynotes, marketing
editorial-infographicbaoyuScience communication, explainers
fantasy-animationbaoyuStorytelling, magical, children
intuition-machinebaoyuAcademic research, bilingual
pixel-artbaoyuGaming, retro, developer culture
scientificbaoyuBiology, chemistry, medical
vector-illustrationbaoyuCreative, children, flat design
vintagebaoyuHistorical, heritage, expedition
tech-keynoteelite-pptApple/Tesla premium minimalism
creative-boldelite-pptGoogle/Airbnb energetic innovation
financial-eliteelite-pptGoldman Sachs/McKinsey sophistication
biotechsci-slidesLife sciences, genomics
neurosciencesci-slidesBrain research, cognitive science
ml-aisci-slidesMachine learning, deep learning
environmentalsci-slidesEcology, climate, sustainability

evaluate — Comparative Evaluation

python -m paperbanana.cli evaluate --generated '<gen.png>' --reference '<ref.png>' \
  --context '<text_file>' --caption '<caption>'
ParameterDefaultDescription
--generated / -gPath to generated image [required]
--reference / -rPath to human reference image [required]
--contextPath to source context text file [required]
--caption / -cFigure caption [required]
--vlm-providergeminiVLM provider for evaluation
--verbose / -voffDetailed progress

data — Manage Reference Datasets

python -m paperbanana.cli data download   # Download expanded reference set (~257MB)
python -m paperbanana.cli data info       # Show cached dataset info
python -m paperbanana.cli data clear      # Remove cached dataset

ablate-retrieval — Retrieval Ablation (Advanced)

Research utility for running baseline vs retrieval ablation (k sweep). See ablate-retrieval --help for details.

setup — Interactive Setup Wizard

python -m paperbanana.cli setup

Guides through API key configuration and provider selection. No flags needed.


Provider Selection

ProviderVLMImage GenSetup
Google GeminiFlash / ProImagen 3GOOGLE_API_KEY
Anthropic ClaudeClaude 4ANTHROPIC_API_KEY
OpenAIGPT-4oDALL-E 3OPENAI_API_KEY
AWS BedrockClaude / NovaNova CanvasAWS credentials
OpenRouterVariousVariousOPENROUTER_API_KEY
LiteLLM100+ backendsvia backendLITELLM_MODEL / LITELLM_API_KEY
OllamaLocal modelsOLLAMA_BASE_URL / OLLAMA_MODEL
Claude Codevia claude CLIClaude Code signed in (no key)

Use --vlm-provider and --image-provider flags to select providers per command.

⚠️ Provider naming asymmetry (common trap): VLM providers use short names (gemini / openai / anthropic / bedrock / openrouter), but image providers require the _imagen suffix: google_imagen (not gemini), openai_imagen (not openai), bedrock_imagen, openrouter_imagen. The error ValueError: Unknown image provider: openai. Available: google_imagen, openrouter_imagen, openai_imagen, bedrock_imagen means you hit this. Every --image-provider example in this document uses the X_imagen form.

Auto-routing decision table

When the user doesn't specify an image model, pick --image-provider by the first matching rule (top priority wins). Calibrated from a controlled 16-prompt two-provider comparison (2026-04) plus slide-deck production use:

#ConditionFlag to passWhy
1User explicitly names a provider ("use GPT" / "use Gemini" / "nano banana")That providerExplicit override beats all auto-rules
1User asks for a side-by-side ("both providers", "对比一下")Run once with each, show bothDual comparison
2Submission-ready venue figures ("投稿用", journal/conference figure)--image-provider openai_imagen --image-model gpt-image-2Rigor and text fidelity priority
3slide / slide-batch AND the prompt contains CJK text--image-provider openai_imagen --image-model gpt-image-2Avoids a documented Gemini duplicate-character bug on CJK slide titles
3≥2 reference images for editing/composition--image-provider openai_imagen --image-model gpt-image-2Avoids Gemini multi-image hallucination (invented text fields)
4Traditional East-Asian aesthetics (水墨 / 书法 / 古风 / ukiyo-e etc.)--image-provider google_imagenGemini dominates this space (3-0 sweep in comparison test)
4generate with dense multi-module figures (architecture / ablation / encoder-decoder)--image-provider openai_imagen --image-model gpt-image-2GPT wins on structural preservation
5Everything else--image-provider google_imagen (default)Better aesthetics on ordinary tasks, ~2x faster, cheaper

Never second-guess an explicit user choice. If the user says which provider to use, use it — even when the auto-rules would pick differently.

Argument Parsing

Input PatternAction
generate <file.txt> <caption>Generate with file + caption
generate <text>Write to temp file, auto-caption, generate
plot <data.csv> <intent>Plot mode
slide <prompt.md>Generate presentation slide
slide-batch <dir>Batch generate slides
evaluate <gen.png> <ref.png>Comparative evaluation
Just a description (no subcommand)Default to generate

Error Handling

Two types of API failure can occur during generation. Handle them differently:

Type 1: Image Generation API Failure (Visualizer)

The image provider (Gemini Imagen, DALL-E, Nova Canvas) fails to return an image.

ErrorCauseAction
429 / ResourceExhaustedRate limitWait 30s, retry up to 3 times
500 / 503 / ServerErrorProvider outageSwitch to fallback provider (see chain below)
400 / InvalidArgumentBad prompt (too long, policy violation)Shorten/rephrase prompt, retry once
401 / 403Invalid API keyStop and ask user to run setup
Timeout (>60s no response)Network or provider hangRetry once, then switch provider

Fallback chain: google_imagenopenaibedrockopenrouter. Use the next provider in chain that has a valid API key in .env. If all fail, stop and report the error.

Type 2: VLM Critic API Failure

The VLM provider (Gemini Flash, Claude, GPT-4o) fails during quality evaluation.

ErrorCauseAction
429 / Rate limitToo many requestsWait 15s, retry up to 3 times
JSON parse failureVLM returned malformed responseDo NOT treat as "approved". Retry once with stricter prompt. If still fails, mark output as UNREVIEWED
500 / 503Provider outageSwitch VLM provider (see chain below)
Timeout (>30s)Network hangRetry once, then skip Critic and mark as UNREVIEWED

VLM fallback chain: geminianthropicopenaiopenrouter.

Critical rule: A Critic failure must NEVER silently approve an image. If Critic cannot evaluate, the output status must be UNREVIEWED, not APPROVED. Report this clearly to the user.

Recovery with --continue

Use --continue to resume after any failure:

ScenarioCommand
Pipeline crashed mid-generation--continue (resumes latest run)
Want to iterate on a specific run--continue-run <run_id>
Want to provide feedback for next iteration--continue --feedback "make the arrows thicker"

The run directory preserves all intermediate state (plans, images, critic feedback). --continue picks up from the last successful step.

Batch Mode (slide-batch) Resilience

When generating multiple slides, a single slide failure should NOT kill the batch:

  1. Log the failure for the specific slide
  2. Continue generating remaining slides
  3. At the end, report which slides succeeded and which failed
  4. User can re-run with --continue to retry only failed slides

🔴 User Confirmation Checkpoints

Paperbanana is CLI-first, but three user-facing actions are expensive or irreversible. 🛑 STOP and ask for explicit confirmation before running any row below — do not proceed on assumed consent.

🔴 Trigger🛑 STOP — Confirm before proceeding
--auto with --max-iterations > 5🛑 STOP. Show: cap, est. API cost (≈ iterations × $0.04), est. wall time (≈ iterations × 30s). Ask: "Proceed with up to N iterations?" Do not kick off until user says yes.
--auto-download-data on first run🛑 STOP. Announce: "reference dataset will be downloaded to cache (~257MB full_bench, or lightweight curated set in upstream ≥ #112)". Ask: "Continue?" Do not download until confirmed.
setup wizard🛑 STOP. Before writing to .env, show the exact keys and preview of values (redact secrets after 4 chars). Ask: "Save to .env?" Do not write until confirmed.

✅ No checkpoint needed: normal generate / plot / slide (no --auto, within iteration cap 3) — these are short, cheap, and the Critic loop is self-bounded. Run them directly.


⛔ Anti-Patterns — Red-Line Blacklist

Hard "do NOT" rules. Each maps to a failure mode already encoded above — this section consolidates them into one scannable list.

⛔ Anti-patternWhy it's wrongDo this instead
Treating a Critic API failure as "approved"Ships an unreviewed image as if it passed QAMark UNREVIEWED, never APPROVED; report to user
Proceeding past a 🔴 checkpoint without confirmationBurns API budget / overwrites .env on assumed consent🛑 STOP at every checkpoint row; wait for explicit yes
Writing matplotlib/seaborn scriptsThat's scientific-visualization's job, not paperbananaRoute code-gen away; paperbanana = AI image gen + critique loop
Killing the whole slide-batch on one slide failureLoses N−1 good slides over 1 bad oneLog the failure, continue, report survivors, retry via --continue
Full regeneration after a mid-run crashThrows away plans/images/critic state, wastes API spendResume with --continue / --continue-run <id>
Routing every "make a figure" to generateplot (data files) and slide (presentation) have dedicated pathsRun the Command Selection Decision Tree first
Inventing CLI flags not in the parameter tablesUpstream CLI surface drifts (see #115/#118/#123 note)Verify with <cmd> --help; don't fabricate flags

After Generation

  1. Parse output to find image path
  2. Use Read tool to display the generated image
  3. Report Run ID, iteration count, and Critic feedback
  4. If any outputs are marked UNREVIEWED, warn the user explicitly
  5. If user expresses dissatisfaction OR status is UNREVIEWED, proactively suggest: python -m paperbanana.cli <cmd> --continue --feedback "<specific fix>" — preserves run state, avoids full regeneration

Signals

GitHub stars
47
Forks
2
Last commit
Sep 2026

ahel review

  • K1binfo
    installs-packages

Automated review, not a security audit. Ruleset v1+k2.

Others that do the same job

Advanced
Catalog kind
skill
Gateway key
paperbanana-plutolei
Source
github.com/plutolei/paperbanana-skill