TL;DR
This paper introduces RealGeneral, a novel framework that unifies diverse image generation tasks by leveraging pre-trained video models. By reformulating image generation as a conditional frame prediction task, analogous to in-context learning in LLMs, RealGeneral achieves state-of-the-art performance across various tasks with significantly reduced computational cost and data requirements.
What Problem Does This Paper Address?
The field of visual generation has seen remarkable progress, but unifying diverse tasks like customization, inpainting, and depth-to-image generation into a single, generalizable framework remains a significant challenge. Existing approaches often rely on task-specific datasets and extensive training, or adapt pre-trained image models with modifications, limiting their broad applicability. This is in contrast to Large Language Models (LLMs), which have achieved unification through task-agnostic data and a unified generation principle (next-token prediction). The paper argues that visual generation models should follow similar principles: a task-agnostic visual data principle for general visual knowledge acquisition and a task-agnostic visual generation principle that can handle various multi-modal visual tasks.
Methods
RealGeneral's core innovation lies in using pre-trained video models as a foundation, capitalizing on their inherent ability to model temporal correlations. The framework reformulates image generation as a conditional frame prediction task, treating input images as preceding frames in a video sequence. To bridge the gap between video models and condition-image pairs, two key modules are introduced:
- Unified Conditional Embedding (UCE) Module: This module fuses multi-modal inputs (text and condition images) by aligning their semantics. It employs a Subject-Specific Embedding layer for inter-modal alignment and a Condition Embedding layer for intra-modal distinction, ensuring better integration of textual and visual information.
- Unified Stream DiT Block: This is a redesigned transformer block that incorporates:
- Decoupled Adaptive LayerNorm (adaLN): A triple-branch adaLN decouples feature modulation among text, condition frames, and target frames, preventing interference.
- Attention Mask: A custom attention mask is used to prevent text-to-condition interactions while preserving condition-to-target visual attention, mitigating cross-modal confusion.
The paper also details a Separated Condition AdaLN (SC-AdaLN) module that disentangles feature modulation across text, conditional frames, and target frames, and a Frame-Condition Decoupling (FCD) module that uses an attention mask to prevent confusion between text and condition information.
Datasets
The paper uses the following datasets:
- Subject-driven text-to-image generation: A custom dataset derived from FLUX and Subject200k, yielding 40K high-quality pairs, resulting in a 260K two-frame video dataset.
- Spatially-aligned tasks (canny-to-image, depth-to-image): A subset from 512-2M, forming 310K videos.
- Benchmark: For customized generation, testing images from DreamBench are used. For spatially-aligned tasks, the COCO2017 validation set (5000 images) is used.
Key Insights and Ideas
- Video models as a unified visual generation foundation: The paper posits that video models, with their inherent temporal modeling capabilities, are a more natural fit for unified visual generation than image-only models.
- In-context learning analogy: Reformulating image generation as conditional frame prediction mirrors the success of in-context learning in LLMs, enabling a unified approach.
- Importance of disentangling modalities: The UCE, SC-AdaLN, and FCD modules highlight the critical need to carefully manage interactions between different modalities (text, condition image, target image) to avoid interference and improve generation quality.
- Efficiency through pre-training and LoRA: Leveraging large pre-trained video models and fine-tuning with LoRA significantly reduces computational cost and data requirements compared to training from scratch or adapting image models.
Key Results
- Customized Image Generation: RealGeneral achieved a CLIP-I score of 0.849 and a DINO score of 0.668, outperforming existing methods by 0.054 and 0.085 respectively, and a CLIP-T score of 0.314.
- Spatially-aligned tasks: For canny-to-image, RealGeneral achieved superior FID and SSIM scores. For depth-to-image, it attained balanced performance, comparable to existing models.
- Module Effectiveness: Ablation studies showed that removing any of the core modules (UCE, SC-AdaLN, FCD) led to a significant decrease in subject consistency.
- Efficiency: RealGeneral fine-tuned a pre-trained video model using LoRA with only 0.1% of the training samples used by UniReal (a concurrent work), demonstrating substantial computational savings.
Limitations and Future Work
- Limitations: The paper acknowledges that while RealGeneral achieves comparable image quality to SDXL and FLUX, its base model (CogVideoX1.5) is weaker than these state-of-the-art image models. The effectiveness of the framework might be further enhanced by using higher-quality pre-trained video models.
- Future Work: The authors plan to:
- Validate the framework on video models with higher generation quality.
- Focus on developing enhanced video foundation models for higher-quality image synthesis.
- Develop a fully integrated, universal framework instead of relying on task-specific LoRA fine-tuning.
Summary updated