[ PROMPT_NODE_27299 ]
Scientific Schematics
[ SKILL_DOCUMENTATION ]
# Scientific Schematics - Nano Banana Pro
**Generate any scientific diagram by describing it in natural language.**
Nano Banana Pro creates publication-quality diagrams automatically - no coding, no templates, no manual drawing required.
## Quick Start
### Generate Any Diagram
```bash
# Set your OpenRouter API key
export OPENROUTER_API_KEY='your_api_key_here'
# Generate any scientific diagram
python scripts/generate_schematic.py "CONSORT participant flow diagram" -o figures/consort.png
# Neural network architecture
python scripts/generate_schematic.py "Transformer encoder-decoder architecture" -o figures/transformer.png
# Biological pathway
python scripts/generate_schematic.py "MAPK signaling pathway" -o figures/pathway.png
```
### What You Get
- **Up to two iterations** (v1, v2) with progressive refinement
- **Automatic quality review** after each iteration
- **Detailed review log** with scores and critiques (JSON format)
- **Publication-ready images** following scientific standards
## Features
### Iterative Refinement Process
1. **Generation 1**: Create initial diagram from your description
2. **Review 1**: AI evaluates clarity, labels, accuracy, accessibility
3. **Generation 2**: Improve based on critique
4. **Review 2**: Second evaluation with specific feedback
5. **Generation 3**: Final polished version
### Automatic Quality Standards
All diagrams automatically follow:
- Clean white/light background
- High contrast for readability
- Clear labels (minimum 10pt font)
- Professional typography
- Colorblind-friendly colors
- Proper spacing between elements
- Scale bars, legends, axes where appropriate
## Installation
### For AI Generation
```bash
# Get OpenRouter API key
# Visit: https://openrouter.ai/keys
# Set environment variable
export OPENROUTER_API_KEY='sk-or-v1-...'
# Or add to .env file
echo "OPENROUTER_API_KEY=sk-or-v1-..." >> .env
# Install Python dependencies (if not already installed)
pip install requests
```
## Usage Examples
### Example 1: CONSORT Flowchart
```bash
python scripts/generate_schematic.py
"CONSORT participant flow diagram for RCT.
Assessed for eligibility (n=500).
Excluded (n=150): age> ~/.bashrc
```
### Import Errors
```bash
# Install requests library
pip install requests
# Or use the package manager
pip install -r requirements.txt
```
### Generation Fails
```bash
# Use verbose mode to see detailed errors
python scripts/generate_schematic.py "diagram" -o out.png -v
# Check API status
curl https://openrouter.ai/api/v1/models
```
### Low Quality Scores
If iterations consistently score below 7/10:
1. Make your prompt more specific
2. Include more details about layout and labels
3. Specify visual requirements explicitly
4. Increase iterations: `--iterations 2`
## Testing
Run verification tests:
```bash
python test_ai_generation.py
```
This tests:
- File structure
- Module imports
- Class initialization
- Error handling
- Prompt engineering
- Wrapper script
## Cost Considerations
OpenRouter pricing for models used:
- **Nano Banana Pro**: ~$2/M input tokens, ~$12/M output tokens
Typical costs per diagram:
- Simple diagram (1 iteration): ~$0.05-0.15
- Complex diagram (2 iterations): ~$0.10-0.30
## Examples Gallery
See the full SKILL.md for extensive examples including:
- CONSORT flowcharts
- Neural network architectures (Transformers, CNNs, RNNs)
- Biological pathways
- Circuit diagrams
- System architectures
- Block diagrams
## Support
For issues or questions:
1. Check SKILL.md for detailed documentation
2. Run test_ai_generation.py to verify setup
3. Use verbose mode (-v) to see detailed errors
4. Review the review_log.json for quality feedback
## License
Part of the scientific-writer package. See main repository for license information.