DiffusionGPT: LLM-Driven Text-to-Image Generation System

Jie Qin, Jie Wu, Weifeng Chen, Yuxi Ren, Huixia Li, Hefeng Wu, Xuefeng Xiao, Rui Wang, Shilei Wen · OpenReview

Abstract

Diffusion models have opened up new avenues for the field of image generation, resulting in the proliferation of high-quality models shared on open-source platforms. However, a major challenge persists in current text-to-image systems: they are often unable to handle diverse inputs or are limited to single-model results. Current unified attempts often fall into two orthogonal aspects: i) parsing diverse prompts at the input stage; and ii) activating expert models for output. To combine the best of both worlds, we propose DiffusionGPT, which leverages Large Language Models (LLMs) to offer a unified generation system capable of seamlessly accommodating various types of prompts and integrating domain-expert models. DiffusionGPT constructs domain-specific Trees for various generative models based on prior knowledge. When provided with an input, the LLM parses the prompt and employs a Tree-of-Thought approach to guide the selection of an appropriate model, thereby relaxing input constraints and ensuring exceptional performance across diverse domains. Moreover, we introduce Advantage Databases, where the Tree-of-Thought is enriched with human feedback, aligning the model selection process with human preferences. Through extensive experiments, we demonstrate the effectiveness of DiffusionGPT in pushing the boundaries of image synthesis.

Introduction: Bridging the Gap in Text-to-Image Generation

Despite the massive success of foundation models like Stable Diffusion (SD), two major bottlenecks hinder their real-world utility. First, most diffusion models are trained on descriptive captions, while human users often provide diverse, non-descriptive inputs—such as instructions ("Generate a..."), inspirations ("I dream of..."), or hypotheses ("If I had..."). Standard models often fail to extract the core semantic intent from these "noisy" prompts.

Second, a single foundation model is often a jack-of-all-trades but master of none. While the community has created thousands of specialized "expert" models (like LoRAs for specific art styles or subjects), manually finding and matching the right model to a specific prompt is a daunting task for the average user. Existing solutions often use rigid pipelines that lack the flexibility to handle the nuance of human preference and the vast library of available expert models.

DiffusionGPT handles diverse prompt paradigms (Instruction, Inspiration, Hypothesis) and selects expert models, unlike standard systems.

The DiffusionGPT Framework

DiffusionGPT (also referred to as DiffusionAgent) is an agentic framework that treats the image generation process as a multi-step reasoning task managed by an LLM. The system decouples reasoning from execution, using the LLM's cognitive power to translate complex instructions into a format that specialized diffusion models can execute effectively.

The four-step pipeline of DiffusionGPT: Prompt Parsing, Tree-of-Thought Model Navigation, Model Selection, and Execution.

The system consists of four key stages:

1. Prompt Parse Agent

The LLM analyzes the raw user input and categorizes it into one of four paradigms: Prompt-based, Instruction-based, Inspiration-based, or Hypothesis-based. It then extracts the "core prompt" to reduce semantic noise, ensuring the downstream generative model receives a clear signal of the user's intent.

2. Tree-of-Thought (ToT) Model Navigator

To handle a large library of models, DiffusionGPT organizes them into a hierarchical tree based on attributes such as subject and style. The LLM performs a breadth-first search through this "Tree-of-Thought" to narrow down a candidate set of expert models that best match the parsed prompt.

3. Model Selection with Advantage Database

To ensure the selection aligns with human aesthetics, the framework utilizes an "Advantage Database." This database contains results from 10,000 prompts scored by a reward model to provide prior knowledge of model performance. The agent intersects the ToT candidates with these high-performing models to make a final selection that reflects human preference.

4. Prompt Extension Agent

Before the final image is generated, the agent uses in-context learning to "enrich" the user's simple prompt into a detailed, descriptive caption. This extension is tailored to the selected expert model's specific strengths, maximizing the visual quality of the output.

Key Insights and Experimental Results

The core innovation of DiffusionGPT lies in the realization that we do not need to fine-tune diffusion models to understand complex instructions. Instead, we can use the reasoning power of LLMs to act as an intelligent router. Routing a prompt to a specific "expert" (e.g., a model specifically trained on "3D Tigers") consistently yields better results than using a massive general-purpose model.

Quantitative and Qualitative Superiority

In benchmarks against base SD1.5, DiffusionGPT showed significant improvements:

  • Image-reward Score: Improved from 0.28 to 0.63.
  • Aesthetic Score: Increased from 5.26 to 5.70.
  • Human Alignment: In a study with 20 users and 400 total votes, participants consistently favored DiffusionGPT’s outputs over baseline SD1.5 and SDXL models across all 10 tested categories, including difficult targets like human faces and bodies.

Ablation Studies

Ablation experiments confirmed that the "Tree-of-Thought + Human Feedback" (TOT+HF) approach significantly outperformed random model selection. This proves that the intelligent routing mechanism, rather than just the availability of expert models, is the primary driver of quality.

Conclusion and Future Work

DiffusionGPT demonstrates a powerful new paradigm for text-to-image generation by combining LLM reasoning with domain-expert diffusion models. While the system introduces some inference latency due to multiple LLM calls, it significantly lowers the barrier for users to access high-quality, specialized image generation. Future work will focus on optimizing search efficiency and exploring automated ways to ingest and categorize the thousands of new community models produced daily on platforms like Civitai and Hugging Face.

Summary updated

Abstract

Diffusion models have opened up new avenues for the field of image generation, resulting in the proliferation of high-quality models shared on open-source platforms. However, a major challenge persists in current text-to-image systems are often unable to handle diverse inputs, or are limited to single model results. Current unified attempts often fall into two orthogonal aspects: i) parse Diverse Prompts in input stage; ii) activate expert model to output. To combine the best of both worlds, we propose DiffusionGPT, which leverages Large Language Models (LLM) to offer a unified generation system capable of seamlessly accommodating various types of prompts and integrating domain-expert models. DiffusionGPT constructs domain-specific Trees for various generative models based on prior knowledge. When provided with an input, the LLM parses the prompt and employs the Trees-of-Thought to guide the selection of an appropriate model, thereby relaxing input constraints and ensuring exceptional performance across diverse domains. Moreover, we introduce Advantage Databases, where the Tree-of-Thought is enriched with human feedback, aligning the model selection process with human preferences. Through extensive experiments and comparisons, we demonstrate the effectiveness of DiffusionGPT, showcasing its potential for pushing the boundaries of image synthesis in diverse domains.
BibTeX
@misc{qin2024diffusiongpt,
  author = {Jie Qin and Jie Wu and Weifeng Chen and Yuxi Ren and Huixia Li and Hefeng Wu and Xuefeng Xiao and Rui Wang and Shilei Wen},
  title = {{DiffusionGPT: LLM-Driven Text-to-Image Generation System}},
  year = {2024},
  eprint = {2401.10061},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.10061},
}
Figure