A User-Friendly Framework for Generating Model-Preferred Prompts in Text-to-Image Synthesis

Nailei Hei, Qianyu Guo, Zihao Wang, Yan Wang, Haofen Wang, Wenqiang Zhang

Abstract

Text-to-image (T2I) diffusion models often require highly descriptive, technical prompts to generate high-quality images, creating a "distribution gap" for novice users who provide simple, coarse-grained inputs. We present UF-FGTG, a framework designed to bridge this gap by translating simple human requests into model-preferred prompts. By leveraging a novel dataset of over 80,000 prompt-image triplets and incorporating direct feedback from the image generation process, UF-FGTG enables the production of detailed, diverse, and aesthetically pleasing images without requiring expert prompt engineering.

Introduction: The Distribution Gap

Novice users typically interact with T2I models using short, natural language prompts like "a green tree." However, models like Stable Diffusion are optimized for complex, technical captions common in their training data (e.g., "8k resolution, cinematic lighting"). This discrepancy, known as the distribution gap, often leads to generic or low-quality outputs for non-expert users.

Figure 1: The distribution gap between novice user prompts and model-preferred data, and how UF-FGTG refines simple inputs into descriptive prompts.

While Large Language Models (LLMs) can expand prompts, they lack visual grounding and do not inherently understand the specific keywords that trigger optimal performance in vision models like Stable Diffusion.

Methodology: The UF-FGTG Framework

The User-Friendly Fine-Grained Text Generation (UF-FGTG) framework acts as a bridge between human intent and model preference. Its architecture is built on three primary components:

  1. Prompt Refiner: Utilizing a CLIP text encoder and a T5 decoder, this module rewrites coarse prompts. It includes a Domain Adapter to align text features with the T2I model's internal representation.
  2. Image-Related Supervision: Unlike text-only refiners, UF-FGTG is trained using loss functions derived directly from the Stable Diffusion UNet. This ensures that the generated text is specifically optimized to produce high-quality visual results.
  3. Adaptive Feature Extraction Module: To maintain stylistic diversity and prevent the model from converging on a single "aesthetic," this module dynamically adjusts weights based on image features, ensuring semantically rich and varied outputs.
Figure 2: Detailed architecture of the UF-FGTG framework, highlighting the Prompt Refiner, Domain Adapter, and Adaptive Feature Extraction Module.

The Coarse-Fine Granularity Prompts (CFP) Dataset

To train the framework, the researchers developed the CFP dataset, containing 81,910 instances. Each instance consists of a fine-grained prompt (sourced from Lexica.art), a corresponding Stable Diffusion image, and three coarse-grained prompts generated via a BART summarization model to simulate novice input. This structure allows the model to learn the direct mapping from simple user thoughts to complex, model-preferred instructions.

Key Insights and Results

The core innovation of UF-FGTG is aligning prompt generation with the visual "expectations" of the diffusion model. Key findings include:

  • Bridging the Modality Gap: By using the T2I model's own denoising loss to train the prompt rewriter, the framework aligns the text generation process with the visual expectations of the diffusion model.
  • The Length Paradox: Analysis revealed that while longer prompts generally improve quality, there is a point of diminishing returns. Prompts around 6 tokens in length (within the coarse-to-fine mapping) provided the best balance of performance and generalization.
  • Performance: UF-FGTG outperformed GPT-3.5, GPT-4, and FLAN-T5, showing a 5% improvement across aesthetic metrics like NIMA and MUSIQ. It produced more detailed and stylistically sophisticated images without the "hallucinations" sometimes seen in LLM-based expansion.
  • Efficiency: The system is lightweight; during inference, only the Prompt Refiner is required, making it easily integrable into existing T2I pipelines.

Limitations and Future Work

Currently, the framework is optimized for Stable Diffusion v2.1. Future research is needed to determine the transferability of these "preferred" prompts to other architectures like Midjourney or DALL-E 3. Additionally, while the system minimizes semantic drift, there remains a risk of adding unwanted details during the refinement process. Future iterations may explore multi-turn conversational refining to better capture complex user intentions.

Summary updated

BibTeX
@inproceedings{hei2024user,
  author = {Nailei Hei and Qianyu Guo and Zihao Wang and Yan Wang and Haofen Wang and Wenqiang Zhang},
  title = {{A User-Friendly Framework for Generating Model-Preferred Prompts in Text-to-Image Synthesis}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i3.27986},
}
Figure