Edit Banana segments images with SAM3 and OCR or VLM steps to rebuild flowcharts and figures as editable DrawIO XML, with CLI and hosted web processing.
Overview
Edit Banana turns static diagrams, PDFs, and screenshots into editable DrawIO-compatible XML. A pipeline segments elements with a fine-tuned SAM3 decoder, extracts text and formulas via local OCR and Pix2Text, then merges geometry and labels into manipulable shapes.
Users can run python main.py on files locally after installing CUDA-capable PyTorch, SAM3 assets, and Tesseract, or use the web platform for faster feature parity. Outputs preserve layout, colors, strokes, and arrow styles so elements remain individually selectable.
The stack supports concurrent sessions with GPU locking and embedding caches for multi-user operation. Configuration in config.yaml tunes segmentation thresholds, paths, and color extraction.
Researchers and engineers use it to recover editable diagrams from papers, slides, or exports instead of redrawing complex figures by hand.
Key features
- SAM3-based diagram segmentation
- Local OCR and formula recognition
- DrawIO XML output files
- Batch input folder processing
- YAML-tuned pipeline thresholds
- Web service with credit accounts
- High-res crop formula handling
Use cases
- Revive locked flowchart images
- Edit architecture diagrams from PDFs
- Fix scientific figure labels in DrawIO
- Batch convert slide exports