FigForge
AI-powered scientific figure generator using LLM analysis and nano banana for publication-quality visualizations
Install / Use
/learn @hengzzzhou/FigForgeREADME
AI Scientific Figure Generator
🎨 Generate publication-quality scientific figures using AI models
This tool uses a sophisticated two-step workflow to create NeurIPS/ICLR-style scientific figures from your research text:
- GPT-5 analyzes your scientific text and generates a structured MODULE LIST
- Gemini-2.5-flash-image (nano banana) creates a professional figure based on the MODULE LIST
✨ Features
- 🤖 Integrated AI Workflow: GPT-5 analysis guides nano banana for optimal results
- 📊 Publication-Ready: Generates clean, NeurIPS-style scientific figures
- 🎯 Structured Approach: Two-step process ensures logical, accurate visualizations
- 🔧 Easy Configuration: Simple
.envfile setup - 💾 Automatic Saving: Saves both MODULE LIST and generated figures
- 🖥️ CLI Interface: User-friendly command-line tool
🚀 Quick Start
1. Installation
# Clone the repository
git clone git@github.com:hengzzzhou/FigForge.git
cd FigForge
# Install dependencies
pip install -r requirements.txt
2. Configuration
Create a .env file from the template:
cp .env.example .env
Edit .env and add your API credentials:
Option 1: OpenAI-Compatible API (default, for relay endpoints)
API_TYPE=openai
OPENAI_BASE_URL=
OPENAI_API_KEY=
ANALYSIS_MODEL=gpt-5
IMAGE_MODEL=gemini-2.5-flash-image
OUTPUT_DIR=outputs
Option 2: Native Google Gemini API
API_TYPE=gemini
GEMINI_API_KEY=
OPENAI_BASE_URL=
OPENAI_API_KEY=
ANALYSIS_MODEL=gpt-5
IMAGE_MODEL=gemini-2.5-flash-image
OUTPUT_DIR=outputs
Note: When using
API_TYPE=gemini, the MODULE LIST generation still uses the OpenAI-compatible API, but image generation uses the native Google Gemini API.
3. Usage
Generate from a file:
python scientific_plotter.py -i examples/sample_input.txt
Generate from text directly:
python scientific_plotter.py -t "Your scientific text describing your model architecture..."
Specify output location:
python scientific_plotter.py -i input.txt -o my_awesome_figure.png
Generate MODULE LIST only:
python scientific_plotter.py -i input.txt --module-list-only
📸 Examples
Here are some scientific figures generated using FigForge:
Sample Input - Neural Architecture

LiveSearchBench

ReSo

VIKI-R

All figures are generated with clean conference-style design, featuring flat aesthetics, consistent line weights, and professional color palettes.
📖 How It Works
Step 1: MODULE LIST Generation (GPT-5)
The GPT-5 model analyzes your scientific text and creates a structured MODULE LIST that breaks down your architecture into:
- Input(s): Data sources and preprocessing
- Preprocessing/Encoding/Embedding: Feature extraction layers
- Core Architecture/Stages/Blocks: Main model components in sequence
- Special Mechanisms: Attention, memory, routing, etc.
- Output Head: Final prediction layers
Step 2: Figure Generation (Gemini-2.5-flash-image)
Using the MODULE LIST as a guide, nano banana generates a clean, professional figure following these design principles:
- ✅ Flat, clean conference style (no gradients, shadows)
- ✅ Consistent thin line weights
- ✅ Professional pastel color palette
- ✅ Rounded rectangles for module blocks
- ✅ Clear arrows indicating data flow
- ✅ Concise labels (no long sentences)
- ✅ Pure white background with clean spacing
📁 Project Structure
NBP/
├── scientific_plotter.py # Main application script
├── requirements.txt # Python dependencies
├── .env.example # Environment variable template
├── .gitignore # Git ignore patterns
├── prompts/
│ ├── step1_module_generation.txt # Prompt for MODULE LIST
│ └── step2_figure_generation.txt # Prompt for figure generation
├── examples/
│ └── sample_input.txt # Sample scientific text
├── outputs/ # Generated figures (auto-created)
└── README.md # This file
🎯 Example Workflow
$ python scientific_plotter.py -i examples/sample_input.txt
================================================================================
🚀 Starting Scientific Figure Generation Workflow
================================================================================
📊 Step 1: Generating MODULE LIST using gpt-5...
✅ MODULE LIST generated successfully!
================================================================================
MODULE LIST:
================================================================================
[Structured breakdown of your architecture...]
================================================================================
📝 MODULE LIST saved to: outputs/sample_input_module_list_20231125_143022.txt
🎨 Step 2: Generating figure using gemini-2.5-flash-image...
💾 Downloading image from: [URL]
✅ Figure saved to: outputs/sample_input_20231125_143022.png
================================================================================
🎉 Workflow completed successfully!
================================================================================
📄 MODULE LIST: outputs/sample_input_module_list_20231125_143022.txt
🖼️ Figure: outputs/sample_input_20231125_143022.png
================================================================================
⚙️ Configuration Options
Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| API_TYPE | API type for image generation: openai or gemini | openai |
| OPENAI_BASE_URL | OpenAI-compatible API endpoint URL | Required |
| OPENAI_API_KEY | API key for OpenAI-compatible endpoint | Required |
| GEMINI_API_KEY | Google Gemini API key (required when API_TYPE=gemini) | - |
| ANALYSIS_MODEL | Model for MODULE LIST generation | gpt-5 |
| IMAGE_MODEL | Model for figure generation | gemini-2.5-flash-image |
| OUTPUT_DIR | Directory for output files | outputs |
Command-Line Options
| Option | Short | Description |
|--------|-------|-------------|
| --input FILE | -i | Path to input text file |
| --text TEXT | -t | Scientific text as string |
| --output FILE | -o | Custom output path |
| --module-list-only | | Generate MODULE LIST only |
| --help | | Show help message |
🔍 Tips for Best Results
- Provide Clear Text: The more detailed and structured your input text, the better the MODULE LIST
- Describe Flow: Explicitly mention data flow and connections between components
- Specify Components: Name specific layers, blocks, or mechanisms in your architecture
- Review MODULE LIST: Check the generated MODULE LIST before proceeding to figure generation
- Iterate: You can regenerate figures with modified MODULE LIST for fine-tuning
🐛 Troubleshooting
Problem: Error initializing plotter
- Solution: Make sure
.envfile exists and contains valid API credentials
Problem: FileNotFoundError: Prompt template not found
- Solution: Ensure
prompts/directory exists with both template files
Problem: API connection errors
- Solution: Verify your
OPENAI_BASE_URLandOPENAI_API_KEYare correct
Problem: Image generation fails
- Solution: Check that
gemini-2.5-flash-imagemodel is available on your API endpoint
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📝 License
This project is open source and available under the MIT License.
🙏 Acknowledgments
- Prompt templates based on NeurIPS/ICLR figure design principles
- Powered by OpenAI-compatible API endpoints
- Uses GPT-5 for analysis and Gemini-2.5-flash-image (nano banana) for generation
Happy Scientific Plotting! 🎨✨
For questions or issues, please open an issue on GitHub.
Related Skills
node-connect
328.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
80.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
328.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
80.9kCommit, push, and open a PR
