RealGeneral: Unifying Visual Generation via Temporal In-Context Learning with Video Models

Yijing Lin, Mengqi Huang, Shuhan Zhuang, Zhendong Mao · DOI

Abstract

RealGeneral is a novel framework that unifies diverse image generation tasks—including subject customization, inpainting, and spatial control—by repurposing pre-trained video diffusion models. By treating image generation as a "conditional next-frame prediction" task, RealGeneral leverages the inherent temporal consistency of video models to achieve state-of-the-art results. This approach requires significantly less training data and compute than previous unified models, demonstrating a 14.5% improvement in subject similarity and a 10% improvement in image quality for spatially-aligned tasks.

Introduction

In the domain of Large Language Models (LLMs), a single architecture can handle a vast array of tasks because they are all framed as "next-token prediction." In contrast, visual generation remains fragmented, often requiring specialized models like ControlNet for specific tasks or massive, task-specific datasets to train unified systems from scratch.

RealGeneral unifies diverse image generation tasks by treating them as conditional next-frame predictions.

The authors of RealGeneral identify two missing pillars in visual generation: a task-agnostic data principle and a task-agnostic generation principle. They argue that video models are the ideal foundation for unification because they are pre-trained to maintain consistency between frames. This property translates directly to maintaining consistency between a "condition" image (e.g., a sketch or reference photo) and a "generated" target image.

Methods

RealGeneral builds upon CogVideoX1.5, a Diffusion Transformer (DiT) video model. It reformulates image generation as a two-frame video sequence where Frame 1 is the condition and Frame 2 is the target output. To optimize this for general visual tasks, the framework introduces three core innovations:

The RealGeneral architecture featuring Unified Conditional Embedding (UCE), Separated Condition AdaLN (SC-AdaLN), and Frame-Condition Decoupling (FCD).
  1. Unified Conditional Embedding (UCE): This module aligns multi-modal inputs by anchoring textual descriptions to specific regions in the condition image using keyword matching, ensuring precise subject preservation.
  2. Separated Condition AdaLN (SC-AdaLN): Standard video models share parameters across frames. RealGeneral decouples the Adaptive Layer Normalization (AdaLN) into three branches (text, condition frame, and target frame) to prevent "cross-modal interference" and better learn transition patterns.
  3. Frame-Condition Decoupling (FCD): To prevent text tokens from interfering with the structural integrity of the condition frame, a custom attention mask allows text to guide only the target frame while maintaining the condition's structure.

The model is fine-tuned using LoRA (Low-Rank Adaptation), making the training process highly efficient.

Key Insights: Video Models as In-Context Learners

The central insight of RealGeneral is that temporal consistency in video is mathematically analogous to task consistency in image generation. If a model can maintain a subject's identity across dozens of video frames, it can effectively maintain that identity between a reference photo and a newly generated scene. By leveraging this pre-existing knowledge, RealGeneral requires only 0.1% of the training samples used by from-scratch unified models like UniReal.

Results and Evaluation

RealGeneral was benchmarked against state-of-the-art models using DreamBench for customization and COCO2017 for spatial tasks.

  • Subject Customization: The model achieved a 14.5% improvement in subject similarity (CLIP-I and DINO scores) over competitors like MS-Diffusion and Emu2.
  • Spatially-Aligned Tasks: In tasks like Canny-to-Image, RealGeneral improved image quality (FID) by 10%, demonstrating superior adherence to complex edge maps.
  • Qualitative Performance: RealGeneral produces images with significantly higher texture detail and better prompt adherence than "all-in-one" competitors like OmniGen.

Conclusion

RealGeneral demonstrates that video foundation models can serve as powerful, unified engines for image generation. While the current framework relies on task-specific LoRA weights and carries the computational weight of a video DiT, it sets a new standard for efficiency and quality in unified visual generation. Future work will focus on fully integrating these capabilities into a single set of weights and distilling the model for faster inference.

Summary updated

BibTeX
@inproceedings{lin2025realgeneral,
  author = {Yijing Lin and Mengqi Huang and Shuhan Zhuang and Zhendong Mao},
  title = {{RealGeneral: Unifying Visual Generation via Temporal In-Context Learning with Video Models}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure