AutoFigure: Generating and Refining Publication-Ready Scientific Illustrations [ICLR 2026]

June 5, 2026 ยท View on GitHub

AutoFigure Logo

AutoFigure: Generating and Refining Publication-Ready Scientific Illustrations [ICLR 2026]

ICLR 2026 License: MIT Python HuggingFace Website Demo

From Text to Publication-Ready Diagrams
AutoFigure is an intelligent system that leverages Large Language Models (LLMs) with iterative refinement to generate high-quality scientific figures from text descriptions or research papers.

Quick Start โ€ข Web Interface โ€ข Configuration โ€ข API Reference


https://github.com/user-attachments/assets/d0c954a9-9cf3-4c8b-8b04-71d75a68854c

๐Ÿ”ฅ News

  • [2026.03.24] ๐Ÿง  Our sister project DeepScientist v1.5 is now officially released. It is a local-first open-source autonomous research system for end-to-end scientific discovery. Explore it on GitHub or read the ICLR 2026 paper.
  • [2026.03.11] ๐Ÿ“„ Our AutoFigure-Edit paper is now available on arXiv and featured in ๐Ÿค—Hugging Face Daily Papers! If you find our work helpful, please consider giving us an upvote on Hugging Face and citing our paper. Thank you! โค๏ธ
  • [2026.02.17] ๐Ÿš€ The AutoFigure-Edit online platform is now live! It is free for all scholars to use. Try it out at deepscientist.cc or check out our open-source code on GitHub. This new Edit version achieves much better performance!
  • [2026.01.26] ๐ŸŽ‰ AutoFigure has been accepted to ICLR 2026! You can read the paper on arXiv.

โœจ Features

FeatureDescription
๐Ÿ“ Text-to-FigureGenerate figures directly from natural language descriptions.
๐Ÿ“„ Paper-to-FigureExtract methodology from PDFs and create visual diagrams automatically.
๐Ÿ”„ Iterative RefinementDual-agent system (Generation + Evaluation) for continuous quality optimization.
๐ŸŽจ Multiple FormatsOutput as SVG or mxGraph XML (fully compatible with draw.io).
๐Ÿ’… Image EnhancementOptional AI-powered post-processing for aesthetic beautification.
๐Ÿ–ฅ๏ธ Web InterfaceInteractive Next.js frontend for easy generation and editing.

๐Ÿš€ How It Works

AutoFigure employs a Review-Refine loop to ensure high accuracy and aesthetic quality.

AutoFigure method

Process:

  1. Generate: The agent creates initial SVG/XML based on description & references.
  2. Evaluate: The critic scores quality (0-10) and provides specific feedback.
  3. Refine: The loop continues until the figure meets publication standards.

๐ŸŒŸ Generated Examples

Here are examples of figures generated by AutoFigure across different domains, showcasing its versatility in handling various levels of complexity.

Category & Visualization
๐Ÿ“„ Paper Case
Paper Case
๐Ÿ“Š Survey Case
Survey Case
๐Ÿ“ Blog Case
Blog Case
๐Ÿ“˜ Textbook Case
Textbook Case

โšก Quick Start

You can install via cloning the repo:

git clone https://github.com/ResearAI/AutoFigure.git
cd AutoFigure
pip install -e .
playwright install chromium  # Required for rendering

1. Basic Usage (Text-to-Figure)

from autofigure import AutoFigureAgent, Config

# 1. Configure
config = Config(
    generation_api_key="your-api-key",
    generation_provider="openrouter",  # options: 'openrouter', 'gemini', 'bianxie'
    generation_model="google/gemini-3.1-pro-preview",
)

# 2. Generate
agent = AutoFigureAgent(config)
result = agent.generate(
    description="A flowchart showing transformer training pipeline",
    max_iterations=5,
    output_format="svg",
    topic="paper" # 'paper', 'survey', 'blog', 'textbook'
)

print(f"โœ… Generated: {result.svg_path} (Score: {result.final_score}/10)")

2. Generate from Paper (PDF/Markdown)

Extract methodology from a paper and generate a figure automatically.

# Generate figure from paper (PDF or Markdown)
result = agent.generate_from_paper(
    paper_path="./paper.pdf",
    max_iterations=5,
    output_format="svg",
    enable_enhancement=True, # Enhance the result
)

if result.success:
    print(f"Extracted methodology: {result.methodology_text[:200]}...")
    print(f"Generated figure: {result.svg_path}")

3. With Image Enhancement

Generate multiple enhanced aesthetic variants of the figure.

result = agent.generate(
    description="Neural network architecture diagram",
    enable_enhancement=True,
    enhancement_count=3,     # Generate 3 variants
    art_style="Modern scientific illustration with clean lines",
    enhancement_input_type="code2prompt" # Best quality mode
)

if result.success:
    print(f"Original Preview: {result.preview_path}")
    print(f"Enhanced variants: {result.enhanced_paths}")

Option 2: Web Interface

Ideally suited for visual interaction and editing.

./start.sh
# Then open http://localhost:6002 in your browser

๐Ÿ“Š FigureBench Dataset

We introduce FigureBench, the first large-scale benchmark for generating scientific illustrations from long-form text.

figurebench

Dataset Overview

CategorySamplesAvg. TokensText DensityComplexity
๐Ÿ“„ Paper3,20012,73242.1%High
๐Ÿ“ Blog204,04746.0%Med
๐Ÿ“Š Survey402,17943.8%High
๐Ÿ“˜ Textbook4035225.0%Low
Total3,30010k+41.2%~5.3 Components

Download

Download
from datasets import load_dataset
dataset = load_dataset("WestlakeNLP/FigureBench")

โš™๏ธ Configuration

AutoFigure is highly configurable. You can set these in Config() or via environment variables.

Supported LLM Providers

ProviderBase URLRecommended Text / SVG ModelRecommended Image Model
OpenRouteropenrouter.ai/api/v1google/gemini-3.1-pro-previewgoogle/gemini-3.1-flash-image-preview
Bianxieapi.bianxie.ai/v1 (bianxieai)gemini-3.1-pro-previewgemini-3.1-flash-image-preview
Googlegenerativelanguage...gemini-3.1-pro-previewgemini-3.1-flash-image-preview

The Bianxie AI aggregate API provides mainland China-friendly access to AutoFigure's recommended Gemini models without requiring a foreign credit card. Register at bianxieai.

Generation Settings

OptionDescriptionDefault
generation_api_keyAPI key for figure generationRequired
generation_base_urlBase URL for APIProvider default
generation_modelModel nameProvider default
generation_providerProvider: 'openrouter', 'bianxie', 'gemini''openrouter'

Methodology Extraction Settings

OptionDescriptionDefault
methodology_api_keyAPI key for methodology extractionSame as generation
methodology_modelModel for methodology extractionSame as generation
methodology_providerProvider for methodology extractionSame as generation

Enhancement Settings

OptionDescriptionDefault
enhancement_api_keyAPI key for image enhancementNone
enhancement_providerEnhancement provider'openrouter'
enhancement_modelModel for image enhancementProvider default
enhancement_input_typeInput type: 'none', 'code', 'code2prompt''code2prompt'
enhancement_countNumber of enhanced variants to generate1
art_styleArt style description for enhancement''

Pipeline Settings

OptionDescriptionDefault
max_iterationsMaximum refinement iterations5
quality_thresholdQuality threshold (0-10)9.0
output_dirOutput directory'./autofigure_output'
custom_referencesCustom reference figure pathsNone

๐Ÿ“š API Reference

generate() Parameters

ParameterDescription
descriptionText description of the figure to generate
max_iterationsMaximum iterations (overrides config)
output_format'svg' or 'mxgraphxml'
quality_thresholdQuality threshold (overrides config)
enable_enhancementWhether to enhance the final image
art_styleArt style for enhancement (overrides config)
enhancement_input_type'none', 'code', or 'code2prompt' (overrides config)
enhancement_countNumber of enhanced variants (overrides config)
topicContent type: 'paper', 'survey', 'blog', 'textbook'
custom_referencesCustom reference figure paths

generate_from_paper() Parameters

Accepts all parameters from generate() plus:

ParameterDescription
paper_pathPath to paper file (PDF or Markdown)
methodology_api_keyAPI key for extraction (overrides config)
methodology_providerProvider for extraction (overrides config)

Result Object (GenerationResult)

AttributeDescription
successWhether generation was successful
svg_pathPath to generated SVG file
mxgraph_pathPath to generated mxGraph XML file
preview_pathPath to PNG preview image
enhanced_pathsList of all enhanced image paths
final_scoreFinal quality score (0-10)
methodology_textExtracted methodology (from paper)
errorError message if failed

Enhancement Modes

ModeDescription
noneDirect beautification without code reference
codeUse generated code (SVG/XML) as reference
code2promptUse LLM to analyze code and generate detailed prompt (recommended)

๐Ÿ“ Project Structure

Click to expand directory tree
AutoFigure/
โ”œโ”€โ”€ autofigure/              # ๐Ÿ“ฆ Python SDK
โ”‚   โ”œโ”€โ”€ agent.py             # Main Agent
โ”‚   โ”œโ”€โ”€ generator.py         # Generation Pipeline
โ”‚   โ”œโ”€โ”€ enhancer.py          # Image Enhancement
โ”‚   โ””โ”€โ”€ extractor.py         # PDF Method Extraction
โ”œโ”€โ”€ frontend/                # ๐Ÿ–ฅ๏ธ Next.js Web UI
โ”œโ”€โ”€ backend/                 # ๐Ÿ”Œ Flask API Server
โ”œโ”€โ”€ scripts/                 # ๐Ÿ› ๏ธ Utility Scripts
โ””โ”€โ”€ pyproject.toml           # Config

๐Ÿค Community & Support

WeChat Discussion Group
Scan the QR code to join our community. If the QR code has expired, please add WeChat ID nauhcutnil or contact tuchuan@mail.hfut.edu.cn. When sending a friend request, please use the format "University/Company - Degree/Position - Name" as your remark.

WeChat 1 WeChat 2

๐Ÿ“œ Citation & License

If you use AutoFigure, AutoFigure-Edit, or FigureBench in your research, please cite:

@inproceedings{
zhu2026autofigure,
title={AutoFigure: Generating and Refining Publication-Ready Scientific Illustrations},
author={Minjun Zhu and Zhen Lin and Yixuan Weng and Panzhong Lu and Qiujie Xie and Yifan Wei and Sifan Liu and Qiyao Sun and Yue Zhang},
booktitle={The Fourteenth International Conference on Learning Representations},
year={2026},
url={https://openreview.net/forum?id=5N3z9JQJKq}
}

@misc{lin2026autofigureeditgeneratingeditablescientific,
      title={AutoFigure-Edit: Generating Editable Scientific Illustration}, 
      author={Zhen Lin and Qiujie Xie and Minjun Zhu and Shichen Li and Qiyao Sun and Enhao Gu and Yiran Ding and Ke Sun and Fang Guo and Panzhong Lu and Zhiyuan Ning and Yixuan Weng and Yue Zhang},
      year={2026},
      eprint={2603.06674},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2603.06674}, 
}

Repository metadata and usage guidance:

๐Ÿ™ Acknowledgments

We thank the following sponsor for supporting this project:

SponsorLinkSupportNote
Bianxie AI Aggregate APIhttps://api.bianxie.aiProvides mainland China-friendly access to AutoFigure's recommended Gemini modelsNo foreign credit card required

This project is licensed under the MIT License - see LICENSE for details. Name and logo usage are covered separately in TRADEMARK.md.


More From ResearAI

Explore more open-source research tools from ResearAI:

ProjectWhat it does
DeepScientistautonomous scientific discovery system
AutoFigure-Editeditable vector paper figures
DeepReviewer-v2review papers and drafts
Awesome-AI-Scientistcurated AI scientist landscape

The optimal configuration for this project uses gemini-3.1-flash-image-preview from Google AI Studio [https://aistudio.google.com/] as the image generation model and gemini-3.1-pro-preview as the Text model. Each run costs approximately $0.50, consumes about 30,000 tokens, and takes around 20 minutes.

[Mainland China Notice] Gemini's Terms of Service do not permit access or usage by users in mainland China. If OpenRouter throws an error, it is often because an account registered in mainland China lacks the necessary permissions to use Gemini. It is recommended to use an OpenRouter account registered in the United States or Europe and to ensure compliant usage.