Using "underdrawings" for accurate text and numbers

A new technique called "underdrawings" solves the challenge of generating accurate text and numbers in AI images by combining deterministic layouts with generative models.
I discovered a technique for generating reliable text and numbers in AI generated images. For example, creating a game board with 50 stepping stones arranged in a spiral, numbered consecutively from 1 to 50, is considered impossible with state-of-the-art image models. Even the latest releases from ChatGPT and Gemini often fail this task, producing garbled numbers and incorrect sequences.
The solution is a method I call "underdrawings." The core concept is: "Give it an outline. Ask it to paint on top."
Layer 1: The "underdrawing" (deterministic): You layout the numbers and text in the correct positions and orientations using formats like SVG, Python, or Mermaid. You then export this as an image containing the exact pixels of the numbers and text.
Layer 2: The "painting" (generative): Using a multi-modal image model like Gemini 3.0 Pro, you pass your underdrawing image along with a text prompt. For instance, you can ask the AI to transform an SVG of 50 numbered stones into a photographed claymation diorama of artisan chocolates.
This technique ensures correct numbers, sequencing, and shapes. While it isn't perfect every time, it provides a reliable way to generate complex, data-heavy images that current AI models struggle to produce through text prompts alone.
Source: Hacker News















