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를 통해). 본 연구에서는 GPT-4에 의해 생성된 프로그래밍적 스케치를 통해 확산 기반 텍스트-이미지 파이프라인을 안내하는 Control-GPT를 소개하여, 지시를 따르는 능력을 향상시킨다. 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.