scientific-skills/scientific-schematics/references/QUICK_REFERENCE.md
How it works: Describe your diagram → Nano Banana 2 generates it automatically
# Get API key from https://openrouter.ai/keys
export OPENROUTER_API_KEY='sk-or-v1-your_key_here'
# Add to shell profile for persistence
echo 'export OPENROUTER_API_KEY="sk-or-v1-your_key"' >> ~/.bashrc # or ~/.zshrc
# Describe your diagram, Nano Banana 2 creates it
python scripts/generate_schematic.py "your diagram description" -o output.png
# That's it! Automatic:
# - Iterative refinement (3 rounds)
# - Quality review and improvement
# - Publication-ready output
python scripts/generate_schematic.py \
"CONSORT flow: screened n=500, excluded n=150, randomized n=350" \
-o consort.png
python scripts/generate_schematic.py \
"Transformer architecture with encoder and decoder stacks" \
-o transformer.png
python scripts/generate_schematic.py \
"MAPK pathway: EGFR → RAS → RAF → MEK → ERK" \
-o mapk.png
python scripts/generate_schematic.py \
"Op-amp circuit with 1kΩ resistor and 10µF capacitor" \
-o circuit.png
| Option | Description | Example |
|---|---|---|
-o, --output | Output file path | -o figures/diagram.png |
--iterations N | Number of refinements (1-2) | --iterations 2 |
-v, --verbose | Show detailed output | -v |
--api-key KEY | Provide API key | --api-key sk-or-v1-... |
For input diagram.png, you get:
diagram_v1.png - First iterationdiagram_v2.png - Second iterationdiagram_v3.png - Final iterationdiagram.png - Copy of finaldiagram_review_log.json - Quality scores and critiques{
"iterations": [
{
"iteration": 1,
"score": 7.0,
"critique": "Good start. Font too small..."
},
{
"iteration": 2,
"score": 8.5,
"critique": "Much improved. Minor spacing issues..."
},
{
"iteration": 3,
"score": 9.5,
"critique": "Excellent. Publication ready."
}
],
"final_score": 9.5
}
from scripts.generate_schematic_ai import ScientificSchematicGenerator
# Initialize
gen = ScientificSchematicGenerator(api_key="your_key")
# Generate
results = gen.generate_iterative(
user_prompt="diagram description",
output_path="output.png",
iterations=2
)
# Check quality
print(f"Score: {results['final_score']}/10")
# Check if set
echo $OPENROUTER_API_KEY
# Set it
export OPENROUTER_API_KEY='your_key'
# Install requests
pip install requests
--iterations 2# Verify installation
python test_ai_generation.py
# Should show: "6/6 tests passed"
Typical cost per diagram (max 2 iterations):
Simply describe your diagram in natural language:
Just describe what you want, and it's generated automatically.
# Show help
python scripts/generate_schematic.py --help
# Verbose mode for debugging
python scripts/generate_schematic.py "diagram" -o out.png -v
OPENROUTER_API_KEY environment variablepython test_ai_generation.py (should pass 6/6)python scripts/generate_schematic.py "test diagram" -o test.pngSKILL.mdREADME.mdIMPLEMENTATION_SUMMARY.mdexample_usage.sh