[Paper Review] Controllable Text-to-Image Generation with GPT-4
This work introduces Control-GPT, which uses GPT-4 to generate TikZ sketches that guide a ControlNet-based diffusion model, achieving state-of-the-art spatial control in text-to-image generation.
Current text-to-image generation models often struggle to follow textual instructions, especially the ones requiring spatial reasoning. On the other hand, Large Language Models (LLMs), such as GPT-4, have shown remarkable precision in generating code snippets for sketching out text inputs graphically, e.g., via TikZ. In this work, we introduce Control-GPT to guide the diffusion-based text-to-image pipelines with programmatic sketches generated by GPT-4, enhancing their abilities for instruction following. Control-GPT works by querying GPT-4 to write TikZ code, and the generated sketches are used as references alongside the text instructions for diffusion models (e.g., ControlNet) to generate photo-realistic images. One major challenge to training our pipeline is the lack of a dataset containing aligned text, images, and sketches. We address the issue by converting instance masks in existing datasets into polygons to mimic the sketches used at test time. As a result, Control-GPT greatly boosts the controllability of image generation. It establishes a new state-of-art on the spatial arrangement and object positioning generation and enhances users' control of object positions, sizes, etc., nearly doubling the accuracy of prior models. Our work, as a first attempt, shows the potential for employing LLMs to enhance the performance in computer vision tasks.
Motivation & Objective
- Motivate and enable precise, instruction-following text-to-image generation with spatial control.
- Leverage GPT-4 to produce programmatic sketches that guide diffusion models.
- Mitigate the gap between GPT-generated sketches and diffusion model understanding by constructing a polygon-based training dataset.
Proposed method
- Prompt GPT-4 to produce TikZ sketches and object grounding tokens from text prompts.
- Convert instance masks from LVIS/COCO into polygon sketches to training-tune ControlNet with grounding tokens.
- Fine-tune ControlNet on a COCO/LVIS-derived dataset with polygon sketches and grounding tokens while freezing backbone diffusion components.
- Introduce object grounding tokens to explicitly link sketches to object names and locations.
- Query GPT-4 at inference to generate zero-shot sketches and corresponding grounding tokens for new prompts.

Experimental results
Research questions
- RQ1Can GPT-4 generate accurate programmatic sketches (TikZ) that follow text prompts, enabling fine-grained image control?
- RQ2How much does integrating LLM-generated sketches improve spatial accuracy and object grounding in diffusion-based models?
- RQ3Does adding grounding tokens reduce object misidentification when using GPT-4 sketches as guidance?
- RQ4What is the impact of training data construction (polygons from LVIS/COCO) on aligning sketches with image content?
- RQ5How does the framework perform on out-of-distribution prompts and multi-object scenes?
Key findings
- GPT-4 can generate compilable TikZ sketches with about 97% instruction-following accuracy on a spatial-relations benchmark.
- Control-GPT achieves state-of-the-art spatial accuracy, nearly doubling baselines like Stable Diffusion (44.2% vs 18.8% Uncond in Visor metrics).
- Fine-tuning ControlNet with polygon sketches and grounding tokens improves controller fidelity and reduces object-identity errors.
- Control-GPT obtains SOTA performance on object placement tasks and handles complex scenes with multiple objects better than OpenAI DALL-E 2 and other baselines.
- Grounding tokens further reduce ambiguity by linking sketches to explicit object names and positions, improving alignment between prompts and generated content.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.