LLMGA: Multimodal Large Language Model based Generation Assistant

Bin Xia, Shiyin Wang, Yingfan Tao, Yitong Wang, Jiaya Jia

TL;DR

LLMGA (Multimodal Large Language Model-based Generation Assistant) is an interactive system that bridges the gap between user intent and high-quality image generation. Unlike previous models that use noisy, "black-box" embeddings to control Stable Diffusion, LLMGA leverages an MLLM to generate detailed, interpretable text prompts, resulting in superior image quality and more precise interactive editing.

What Problem Does This Paper Address?

Generating the "perfect" image or performing complex edits (like outpainting or instruction-based modification) usually requires expert-level prompt engineering. While recent Multimodal Large Language Models (MLLMs) have tried to automate this by predicting fixed-size visual embeddings to control Diffusion Models, this approach faces two major hurdles:

  1. Noise: Predicted embeddings are often filled with noise that degrades image quality over multiple conversation turns.
  2. Lack of Interpretability: Users cannot see or modify the "hidden" instructions the MLLM is sending to the generator.

The authors of LLMGA argue that language itself is the best control signal. By forcing the MLLM to output detailed descriptive text instead of abstract embeddings, they filter out noise and allow the user to participate in the "reasoning" process of the generation.

Methods

LLMGA utilizes a two-stage training scheme to turn a standard MLLM (like LLaVA) into a generation expert.

  1. Stage 1: MLLM Training. The model is trained to understand the properties of image generation and editing. It learns to take a simple user request (e.g., "make this image funnier") and expand it into a rich, detailed prompt (e.g., "add a husky wearing a giant pumpkin hat...").
  2. Stage 2: Diffusion Alignment. Standard Stable Diffusion (SD) is typically trained on short, simple captions. To make it compatible with LLMGA’s verbose descriptions, the authors fine-tune the SD U-Net to follow these detailed prompts.

Technical Innovations: * Long Prompt Handling: Since SD's CLIP encoder is limited to 75 tokens and LLMGA often generates >150 tokens, the team implemented an iterative encoding process to ensure no detail is lost. * DiffRIR (Diffusion-based Reference Restoration Network): To solve the common problem of "seams" or color mismatches during inpainting and outpainting, they proposed a restoration network that uses the original image as a reference to align texture, brightness, and contrast.

Fig. 2: The overview of LLMGA. (a) In the first training stage, we train the MLLM to produce generation prompts based on provided instructions. Moreover, we construct a training dataset including four categories: prompt refinement, similar image generation, inpainting & outpainting, and instruction-based editing. (b) In the second training stage, we optimize SD to adapt to the detailed generation prompts from MLLM. (c) In the inference stage, LLMGA can respond to user queries and assist in various tasks, such as image generation, inpainting & outpainting, and editing.

Datasets

The authors curated a comprehensive dataset to train these specialized capabilities:

  • Prompt Refinement: Pairs of short MSCOCO captions and detailed GPT-4V descriptions.
  • Similar Image Generation: Training the model to describe an existing image well enough to recreate its essence.
  • Instruction-based Editing: A dataset generated by fine-tuning Mixtral-8x7B to create "before and after" descriptions based on editing instructions.
  • General VQA: Integrated LLaVA v1.5 and Alpaca datasets to maintain the model's general conversational abilities.

Key Insights and Ideas

  • Language as a Denoising Filter: By mapping the MLLM's internal states back to a fixed language domain (text), the model effectively "filters" the noise that typically plagues embedding-based control schemes.
  • Interpretability is a Feature: Because the model outputs text prompts (wrapped in <gen_img> tags), users can see exactly what the model intends to generate. This makes the system more transparent and easier to debug.
  • Reasoning-Driven Editing: Because it's built on an LLM, the model can leverage world knowledge. If you ask to "add a space elevator," the model knows what that is and how it should look in context, even if the concept wasn't in the original diffusion training set.

Key Results

LLMGA demonstrates significant improvements over both base Stable Diffusion and contemporary MLLM-generators like GILL:

  • T2I Quality: On the MSCOCO dataset, LLMGA-7B achieved an FID of 18.52, a massive improvement over SD 1.5's 24.00.
  • Multi-turn Stability: Unlike embedding-based methods, which see image quality plummet as a conversation gets longer (due to accumulated noise), LLMGA maintains high generation quality across many turns.
  • Zero-Shot Editing: Despite not being explicitly trained on the MagicBrush editing benchmark, LLMGA outperformed InstructPix2Pix, proving the strength of its reasoning-based approach.
Fig. 1: Some examples of LLMGA for assisting in image generation and editing. (1) T2I generation. LLMGA can refine the user’s generation prompt to produce more vivid and vibrant images. (2) Similar image generation. LLMGA can understand the com- ponent and layout of the input images and generate a similar image. (3) Inpainting & Outpainting. LLMGA can provide detailed generation prompts based on user prefer- ences and input images. (4) Instruction based editing. LLMGA can understand user instructions and realize accurate editing. (5) Interactive image generation and editing exemplify the comprehensive capabilities of LLMGA. Users can design satisfactory im- ages by engaging in interactions with LLMGA, leveraging its vast knowledge.

Limitations and Future Work

  • Inference Latency: Generating a long, detailed text prompt before starting the diffusion process adds a small amount of time to the total generation pipeline compared to direct embedding methods.
  • Dependency on MLLM Quality: The system's "creativity" is capped by the underlying LLM's ability to describe scenes.
  • Future Directions: The authors suggest extending this framework to more complex modalities, such as interactive video generation and 3D asset creation.

Summary updated

BibTeX
@inproceedings{xia2024llmga,
  author = {Bin Xia and Shiyin Wang and Yingfan Tao and Yitong Wang and Jiaya Jia},
  title = {{LLMGA: Multimodal Large Language Model based Generation Assistant}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72920-1\_22},
}
Figure