Trick

Iteratively refine generated diagram code

image-generation · works with GPT-4 · via dair-ai/Prompt-Engineering-Guide

The prompt

Prompt Iteration 1:
Produce TikZ code that draws a person composed from letters in the alphabet. The arms and torso can be the letter Y, the face can be the letter O (add some facial features) and the legs can be the legs of the letter H. Feel free to add other features.

Prompt Iteration 2 (after seeing the first result):
The torso is a bit too long, the arms are too short and it looks like the right arm is carrying the face instead of the face being right above the torso. Could you correct this please?

Prompt Iteration 3:
Please add a shirt and pants.

Expected result

Valid TikZ/LaTeX code that, once compiled, renders a crude but recognizable person built from stylized letterforms — refined over 3 rounds of visual feedback rather than expected to be perfect on the first attempt.

Why it works

Shows that asking a text-only model to "draw" something works best as an iterative loop: generate code, render it, describe what's visually wrong in plain language, and let the model patch just that issue — rather than chasing a perfect one-shot result.

Open in PrompVite to copy, rate, and discuss this prompt →