GPT-4を用いた制御可能なテキストから画像への生成
Controllable Text-to-Image Generation with GPT-4
May 29, 2023
著者: Tianjun Zhang, Yi Zhang, Vibhav Vineet, Neel Joshi, Xin Wang
cs.AI
要旨
現在のテキストから画像を生成するモデルは、特に空間的推論を必要とするテキスト指示に従うことが困難な場合が多い。一方、GPT-4のような大規模言語モデル(LLMs)は、テキスト入力をグラフィカルにスケッチするためのコードスニペットを生成する際に、驚くべき精度を示している(例:TikZを使用)。本研究では、Control-GPTを導入し、GPT-4によって生成されたプログラム的なスケッチを用いて、拡散ベースのテキストから画像へのパイプラインをガイドし、指示に従う能力を強化する。Control-GPTは、GPT-4にTikZコードを生成させることで動作し、生成されたスケッチはテキスト指示と共に拡散モデル(例:ControlNet)の参照として使用され、写真のようなリアルな画像を生成する。このパイプラインを訓練する上での主要な課題は、テキスト、画像、スケッチが整列したデータセットの欠如である。この問題を解決するため、既存のデータセットのインスタンスマスクをポリゴンに変換し、テスト時に使用されるスケッチを模倣する。その結果、Control-GPTは画像生成の制御性を大幅に向上させ、空間配置やオブジェクトの位置決め生成において新たな最先端を確立し、ユーザーのオブジェクトの位置やサイズなどの制御を強化し、従来のモデルの精度をほぼ倍増させた。本研究は、LLMsをコンピュータビジョンタスクの性能向上に活用する可能性を示す最初の試みである。
English
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.