DeTikZify: synthesizing TikZ graphics programs from figures and sketches
Synthesizing Graphics Programs for Scientific Figures and Sketches with TikZ.
At a glance
- What is it?
- DeTikZify is an Apache-2.0 multimodal model that takes a scientific figure or a hand-drawn sketch and produces a TikZ program that redraws it. It is aimed at researchers who want editable LaTeX vector graphics instead of a static image.
- Who is it for?
- Adopt DeTikZify if you write LaTeX papers and want figures or sketches converted into editable TikZ source you can tweak and recompile, and you either have the hardware for an 8b model or are content with the hosted Space. Do not expect turnkey, always-compilable output: budget for a LaTeX toolchain and a review pass on generated code.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 18, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What DeTikZify turns a figure or a sketch into
Creating a clean scientific figure in TikZ by hand takes time, and once a figure exists only as a rendered image, editing it means starting over. DeTikZify attacks that from the other direction. You give it a figure image or a rough hand-drawn sketch, and it synthesizes a TikZ program, the LaTeX drawing language, that reproduces the picture. The output is code, not a raster, so you can open it, adjust a coordinate, change a label and recompile. The audience is researchers and students who already write papers in LaTeX and want their figures as editable source. The project's own description frames it plainly: synthesizing graphics programs for scientific figures and sketches with TikZ.
From a raster image to a TikZ program
DeTikZify is a multimodal model built on a Llama-family language model with a vision component, which is why the repository topics list llama, transformers, multimodal and inverse-graphics. It reads the pixels of your input and emits TikZ source token by token. The distributed model, detikzify-v2.5-8b, is an 8-billion-parameter network and is the default in the project's Hugging Face Space. According to the v0.3.0 release notes, that version was produced with reinforcement learning from self-feedback, abbreviated RLSF in the release, which trains the model against the quality of the figures it generates rather than reference code alone. The Python package pulls in torch, torchvision and transformers as its core, plus PyMuPDF, pdf2image and pdfCropMargins to handle the PDF side of rendering, so the compile-and-render path is part of the dependency set.
Installing the Python package
DeTikZify is a pip-installable Python package named detikzify, and pyproject.toml pins the interpreter to Python 3.11. Install it with pip:
pip install detikzifyThe project declares optional dependency groups you can request as extras: evaluate for the scoring metrics, examples for the runnable examples that also pull in diffusers, legacy for older model support, and deepspeed. Release v0.3.0 states that inference works on Linux, macOS and Windows, so the package is not restricted to one operating system. After installation the model weights are fetched from the Hugging Face model cards referenced in the releases; the package itself does not bundle them.
The hosted Space, Docker, and TikZero text conditioning
If you do not want to host an 8-billion-parameter model locally, the project runs a Hugging Face Space at the address given as its homepage, and release v0.3.0 documents running that Space locally with Docker. The web interface is built on gradio and fastapi, which the dependency list confirms. A separate capability arrived with v0.2.1: the TikZero adapters plug into DeTikZify and add zero-shot text conditioning, so you can drive generation from a text description rather than an image, with TikZero+ offering additional end-to-end fine-tuning. That matters because the base model is image-to-code; TikZero is what extends it toward text-to-code without retraining the whole network.
Where it falls short: compilation, model size, and an aging release
The honest limits follow from what the model is. It generates TikZ, and generated code can fail to compile or can drift from the input figure, so a working LaTeX and TikZ toolchain plus a review step are part of using it, not optional. The default model has 8 billion parameters, which is heavy to run locally; the hosted Space exists precisely because not everyone can serve that on their own hardware. There is also a maintenance signal worth noting: while the last push to the repository was on 2026-09-17, the most recent tagged release is v0.3.0 from 2025-07-07, more than a year earlier. Development continues on the default branch, but anyone depending on a pinned release is depending on a year-old one.
DeTikZify versus svg2tikz and AutomaTikZ
Two alternatives sit on either side of it. svg2tikz is a deterministic converter: it translates an existing SVG's vector paths into TikZ by rule, with no model involved. That is the right tool when you already have clean vector source and want a faithful, predictable conversion, but it cannot start from a raster screenshot or a pencil sketch, which is exactly DeTikZify's input. AutomaTikZ, the authors' earlier project, generates TikZ from a text caption rather than an image. DeTikZify's distinction is the inverse-graphics direction: image or sketch in, program out, with the TikZero adapters bridging back toward text input. If your source is already an SVG, reach for svg2tikz first; if it is a picture, DeTikZify is the one that applies.
Apache-2.0 and what recent activity looks like
DeTikZify is licensed under Apache-2.0, a permissive license that allows commercial use, modification and redistribution with attribution and a patent grant, which is a comfortable footing for building on it. The model weights are distributed separately through Hugging Face and carry their own model cards, so check those terms before shipping the models themselves. On activity, the repository was last pushed on 2026-09-17 and the work is documented in a paper on arXiv and reviewed on OpenReview, which gives the method a citable reference the code links to directly. Treat the released package as stable and the newer model work as living on the main branch and the model hub.
Editorial conclusion
Adopt DeTikZify if you write LaTeX papers and want figures or sketches converted into editable TikZ source you can tweak and recompile, and you either have the hardware for an 8b model or are content with the hosted Space. Do not expect turnkey, always-compilable output: budget for a LaTeX toolchain and a review pass on generated code. If your input is already vector SVG, use svg2tikz instead; DeTikZify earns its place when the input is a raster image or a hand-drawn sketch.
Frequently asked questions
What does DeTikZify do?
It takes a scientific figure image or a hand-drawn sketch and synthesizes a TikZ program, the LaTeX drawing language, that reproduces it, so you get editable vector source instead of a static image.
Do I need a GPU to run DeTikZify?
The default model, detikzify-v2.5-8b, has 8 billion parameters and is heavy to run locally. If your hardware cannot serve it, the project offers a hosted Hugging Face Space that you can also run locally with Docker.
Can DeTikZify generate TikZ from a text prompt?
The base model is image-to-code, but the TikZero adapters released in v0.2.1 plug in to add zero-shot text conditioning, so generation can be driven from a text description rather than an image.
Community notes