# Edit Banana: Converting Static Diagrams to Editable DrawIO with AI Segmentation

> Edit Banana is a Python-based research platform from Beijing Institute of Technology that uses fine-tuned SAM3 segmentation and multimodal language models to convert raster images of flowcharts and architecture diagrams into fully editable DrawIO XML, preserving shape styles, text and layout.

**BIT-DataLab/Edit-Banana** — Edit Banana: A framework for converting statistical formats into editable.

- Repository: https://github.com/BIT-DataLab/Edit-Banana
- Website: https://www.editbanana.net
- Stars: 5,497 · Forks: 356
- Language: Python
- License: AGPL-3.0
- Published: 2026-09-09 · Updated: 2026-09-09 · Language: en
- Canonical page: https://hysenlabs.com/projects/bit-datalab-edit-banana

## The Problem Edit Banana Addresses

Engineers and researchers frequently encounter diagrams in PDFs, slides or screenshots that they need to modify. Recreating a complex architecture diagram or flowchart from scratch in a diagramming tool can take hours. Edit Banana targets this specific task: given a raster image of a diagram, produce an editable DrawIO XML file that preserves the original layout, shape styles, arrow types and text content, so the recipient can open the file in draw.io or diagrams.net and make changes directly.

The README describes four representative scenarios: basic flowcharts, multi-level architecture diagrams, technical schematics and scientific formulas. For each, the claim is 1:1 restoration of shape stroke and fill, arrow styles including dashed lines and thickness, and accurate text recognition. The project is led by professors from the School of Computer Science at Beijing Institute of Technology, with academic backgrounds in database systems, graph data management and data-centric AI.

## Architecture: SAM3, OCR and DrawIO XML Generation

The pipeline runs in four stages as documented in the README. First, the input image (PNG, JPG, BMP, TIFF or WebP) is passed to a fine-tuned SAM3 mask decoder for element segmentation. SAM3 (Segment Anything Model 3) separates individual shapes and regions in the diagram.

In parallel, text extraction runs on two tracks. Local OCR using Tesseract detects text bounding boxes. High-resolution crops of text and formula regions are sent to Pix2Text for LaTeX conversion of mathematical expressions. The crop-guided strategy extracts small regions and sends them to the formula engine at full resolution, which is intended to improve accuracy on dense text.

Finally, spatial data from the SAM3 masks and text positions from OCR are merged into DrawIO XML. The output is a file that draw.io can open, where every shape is an independently selectable and draggable element.

For multi-user scenarios, the README describes a Global Lock mechanism for thread-safe GPU access and an LRU Cache that persists image embeddings across requests. New users of the web service receive ten free credits on registration, with further use on a pay-per-use model.

## Trying Edit Banana Online and the GitHub Repository Gap

The fastest route to evaluating Edit Banana is the web service at editbanana.net, which requires no local setup. The README explicitly states: "Our GitHub repository currently trails behind our web-based service. For the most up-to-date features and performance, we recommend using our web platform."

This is an important signal. The open-source codebase lags the hosted product, which means self-hosting may produce different results than the demo. Anyone evaluating the tool should test on their specific diagram types using the web demo before deciding whether to set up the local pipeline.

The repository does include a WeChat community group for questions, with instructions to open a GitHub issue if the QR code has expired. For academic or commercial licensing inquiries, the README gives the contact email ccl@bit.edu.cn.

## Installing and Running the Local Pipeline

The README structures installation into phases starting with environment setup and directory creation. The repository ships a requirements.txt listing the core Python dependencies:

```
pyyaml
opencv-python-headless
numpy
Pillow
scikit-image
requests
fastapi
uvicorn[standard]
pytesseract
```

Optional extras noted in the file include PaddleOCR for better Chinese and English mixed text, Pix2Text for formula recognition, and onnxruntime or onnxruntime-gpu for background removal. PyTorch and SAM3 must be installed separately following the README instructions, which require a CUDA-capable NVIDIA GPU.

The project structure shows a config directory where `config.yaml.example` must be copied to `config.yaml` before running. Model weights for SAM3 go in the models directory. Input images go in the input directory; results appear in the output directory. The `flowchart_text/main.py` file serves as an OCR-only entry point for testing the text extraction module independently.

## Limitations and Cases Where Edit Banana Is the Wrong Tool

Edit Banana requires a CUDA GPU for local use. The SAM3 segmentation runs entirely on GPU, and the README does not document a CPU fallback. Teams without CUDA hardware must use the hosted web service.

The output format is DrawIO XML only. There is no documented option to export to Visio, Lucidchart, Mermaid or other formats. If your workflow depends on a different diagramming tool, the output requires manual conversion.

Complex diagrams with overlapping elements, non-standard color schemes or highly stylized shapes may produce imperfect segmentations. The SAM3 model was fine-tuned for typical diagram conventions; unusual visual styles are a known risk area, though the README does not quantify failure rates.

The AGPL-3.0 licence imposes a strong requirement: if you run Edit Banana as part of a networked service, you must release the corresponding source code to users of that service. This makes it unsuitable for inclusion in a proprietary SaaS product without publishing the modifications.

## Edit Banana Versus Manual Redrawing and Other AI Tools

The conventional alternative to Edit Banana is manual redrawing in draw.io or Lucidchart. For a simple flowchart with a dozen nodes, that takes minutes. For a multi-tier architecture diagram with dozens of labeled connections and styled shapes, it can take an hour or more. Edit Banana targets the upper end of that range, where the cost of manual work justifies tolerating some imperfections in the automated output.

General-purpose multimodal language models can describe diagram contents or generate new diagram code from an image, but they do not produce editable vector geometry that preserves spatial layout. Edit Banana's pipeline is differentiated by the SAM3 segmentation step that extracts per-element geometry, which is what makes the DrawIO output independently draggable rather than a visual approximation.

## Project Status, Licence and Academic Context

The last push to the GitHub repository was on 2026-09-13, indicating the codebase is under active development. The project does not have formal GitHub releases, which aligns with the README note that the web service leads the repository.

The AGPL-3.0 licence is one of the more restrictive open-source licences. Beyond the standard copyleft terms, it extends the share-alike requirement to software offered over a network. Organizations running Edit Banana as an internal or public service must make their modified source available.

The project is associated with Beijing Institute of Technology's School of Computer Science. The leadership team holds backgrounds in database systems, graph data management and large language model research. Academic cooperation, technical integration, commercial licensing and project customization inquiries are directed to ccl@bit.edu.cn.

## Conclusion

Edit Banana is the right fit for researchers or technical writers who regularly need to re-edit diagrams from PDFs, screenshots or published papers, and who can accept beta software backed by a GPU-equipped server or local CUDA hardware. It is not a good fit for teams that need a stable, audited API, offline batch processing without a GPU, or a permissive licence: AGPL-3.0 requires any networked service built on the code to release its modifications. The GitHub repository currently trails the web service at editbanana.net, so check the web demo first to confirm the output quality matches your diagram types before committing to a local deployment.

## FAQ

### What file formats does Edit Banana accept as input?

According to the README architecture section, Edit Banana accepts PNG, JPG, BMP, TIFF and WebP images as input.

### Does Edit Banana require a GPU to run locally?

The README requires a CUDA-capable GPU for the SAM3 segmentation step. The requirements.txt lists onnxruntime or onnxruntime-gpu as optional dependencies, but the core SAM3 pipeline is documented as GPU-dependent. No CPU fallback is mentioned.

### What does Edit Banana's AGPL-3.0 licence mean for commercial use?

AGPL-3.0 requires that anyone providing a networked service based on Edit Banana must make the corresponding source code available to users of that service. Commercial use is permitted, but distributing a modified version as a service without releasing the source is not allowed under AGPL-3.0. The README provides a contact email for commercial licensing inquiries.

## Sources

- [BIT-DataLab/Edit-Banana on GitHub](https://github.com/BIT-DataLab/Edit-Banana)
- [Issues](https://github.com/BIT-DataLab/Edit-Banana/issues)
- [License: AGPL-3.0](https://github.com/BIT-DataLab/Edit-Banana/blob/main/LICENSE)
- [Project website](https://www.editbanana.net)
- [README](https://github.com/BIT-DataLab/Edit-Banana/blob/main/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/bit-datalab-edit-banana
