Draw figures with AI
Describe the figure; the assistant draws it. The figure studio turns “a transformer encoder with 6 stacked blocks” or a selected paragraph of your paper into real, editable TikZ, compiled and previewed before a single character lands in your document.
Opening the studio
Section titled “Opening the studio”Three ways in:
- The sparkles toggle in the chat panel header (“Draw a figure”).
- Generate a figure with AI in the search omnibar.
- Right-click a paragraph in the editor and choose Generate figure from selection: the paragraph becomes the brief, and the finished figure can replace it.
How it works
Section titled “How it works”The studio is an agent specialized for figures:
- It drafts TikZ (or PGFPlots) from your description.
- It compiles the figure in isolation, in its own build sandbox, so a broken draft never touches your document or its PDF.
- It iterates: compile errors feed back into the next draft automatically.
- With a vision model (GPT-4o and friends, Claude, vision-tagged Ollama models), it goes further: after each compile it looks at the rendered image and fixes overlaps, spacing, and alignment on its own before showing you.
- When you accept, it inserts the figure at your cursor (or over the selected paragraph), wrapped in a proper
figureenvironment with caption and label, and saves a PNG copy underfigures/.
The insert is an approval card like any other AI edit, with an image preview of exactly what you’re accepting.
With a text-only model you still get the full loop; you steer visually using the preview in the approval card while the model works from the compile log.
From a sketch
Section titled “From a sketch”Drop a photo of a hand-drawn sketch into the project (or attach it in chat) and ask the studio to reproduce it as a clean figure. The load_image tool lets the model study any image already in your project.
Fix with AI, in the composer
Section titled “Fix with AI, in the composer”The manual diagram composer has its own one-shot AI assist: when a compile of your hand-written TikZ fails, a Fix with AI button sends the code plus the error log to your active model, drops the corrected code back into the editor, and recompiles. One click, no conversation.
Why TikZ output matters
Section titled “Why TikZ output matters”The studio never hands you a PNG as the primary artifact. You get LaTeX-native vector source: it scales to any size, matches your document’s fonts, diffs cleanly in Git history, and remains editable by hand or by the composer forever. The saved figures/<name>.png is a convenience copy, not the source of truth.
Requirements
Section titled “Requirements”A connected provider (set up AI), with vision refinement kicking in automatically when the model supports it. Everything else, including the isolated compiles, runs locally.