Skip to main content
QUICK REVIEW

[论文解读] Controllable Text-to-Image Generation with GPT-4

Tianjun Zhang, Yi Zhang|arXiv (Cornell University)|May 29, 2023
Multimodal Machine Learning ApplicationsComputer Science被引用 10
一句话总结

本工作提出 Control-GPT,它使用 GPT-4 生成 TikZ 草图来引导基于 ControlNet 的扩散模型,在文本到图像生成中实现了最先进的空间控制。

ABSTRACT

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.

研究动机与目标

  • 为具空间控制的精准、遵循指令的文本到图像生成提供动机与实现路径。
  • 利用 GPT-4 生成程序化草图以指导扩散模型。
  • 通过构建基于多边形的训练数据集,缓解 GPT 生成草图与扩散模型理解之间的差距。

提出的方法

  • 从文本提示中提示 GPT-4 生成 TikZ 草图和对象定位令牌。
  • 将 LVIS/COCO 的实例掩模转换为多边形草图,以训练微调 ControlNet 及其定位令牌。
  • 在 COCO/LVIS 派生的数据集上对 ControlNet 进行微调,使用多边形草图与定位令牌,同时冻结骨干扩散组件。
  • 引入对象定位令牌以明确将草图与对象名称和位置相关联。
  • 在推理阶段查询 GPT-4 以生成对新提示的零-shot 草图及相应的定位令牌。
Figure 1 : Controllable text-to-image generation with GPT-4 in the loop . Among all the models, Control-GPT is both good at generating multiple objects, and the generated image follows exactly the TikZ sketch. Both DALL-E 2 and Stable Diffusion are not only unable to generate all the objects stated
Figure 1 : Controllable text-to-image generation with GPT-4 in the loop . Among all the models, Control-GPT is both good at generating multiple objects, and the generated image follows exactly the TikZ sketch. Both DALL-E 2 and Stable Diffusion are not only unable to generate all the objects stated

实验结果

研究问题

  • RQ1GPT-4 是否能够生成符合文本提示、并可实现细粒度图像控制的程序化草图(TikZ)?
  • RQ2将 LLM 生成的草图整合到扩散模型中在空间准确性和对象定位方面提升多少?
  • RQ3添加定位令牌是否在使用 GPT-4 草图作为引导时降低对象身份错误?
  • RQ4训练数据构造(来自 LVIS/COCO 的多边形)对使草图与图像内容对齐有何影响?
  • RQ5框架在分布外提示和多对象场景上表现如何?

主要发现

  • GPT-4 能生成可编译的 TikZ 草图,在空间关系基准测试上具有约 97% 的指令遵循准确性。
  • Control-GPT 实现了最先进的空间精准度,接近将基线如 Stable Diffusion 的翻倍提升(44.2% 对 18.8% Uncond 在 Visor 指标)。
  • 对 ControlNet 进行多边形草图和定位令牌的微调提升了控制器保真度并减少了对象身份错误。
  • Control-GPT 在对象放置任务上取得了最先进的性能,并且在包含多对象的复杂场景中表现优于 OpenAI DALL-E 2 及其他基线。
  • 定位令牌通过将草图与显式的对象名称和位置相关联,进一步降低了歧义性,提升了提示与生成内容的对齐度。
Figure 2 : Control-GPT Architecture . Our model is built on top of ControlNet to take additional grounding text. The model takes in both reference images and grounding object text, fusing them using attention layers before feeding to Stable Diffusion.
Figure 2 : Control-GPT Architecture . Our model is built on top of ControlNet to take additional grounding text. The model takes in both reference images and grounding object text, fusing them using attention layers before feeding to Stable Diffusion.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。