3SGen: Unified Subject, Style, and Structure-Driven Image Generation with Adaptive Task-specific Memory

Xinyang Song, Libin Wang, Weining Wang, Zhiwei Li, Jianxin Sun, Dandan Zheng, Jingdong Chen, Qi Li, Zhenan SunarXiv 2025 · DOI

Introduction

Recent advancements in text-to-image (T2I) generation have shifted the focus from simple prompt-based synthesis to more complex, controllable generation tasks. These tasks typically fall into three categories: Subject-driven (preserving the identity of a specific object or person), Style-driven (capturing the artistic essence of a reference), and Structure-driven (adhering to spatial constraints like depth maps or edge outlines).

Overview of 3SGen's multi-task capabilities across subject, style, and structure domains.

While specialized models exist for each, unifying them into a single framework often leads to "feature entanglement." For instance, a model might inadvertently leak the background of a subject reference into a style-driven task, or lose fine-grained subject details when strictly following a structural layout. 3SGen addresses these challenges by introducing a unified architecture that disentangles these visual priors through a novel memory-based mechanism.

Methodology

3SGen is built upon three architectural pillars designed to balance high-level semantics with low-level visual fidelity.

Architectural Pillars

  1. MLLM as a Semantic Bridge: The framework utilizes a Multimodal Large Language Model (MLLM) to jointly encode text and image inputs. Rather than relying solely on final LLM outputs, 3SGen employs learnable semantic queries that act as resamplers, extracting task-relevant features from the MLLM's internal representations.
  2. The VAE Branch: To compensate for the loss of high-frequency details (like intricate textures) often seen in LLM-based encoders, a Variational Autoencoder (VAE) branch feeds fine-grained visual information directly into the Diffusion Transformer (DiT) blocks.
  3. Adaptive Task-specific Memory (ATM): This is the core innovation of 3SGen. The ATM module consists of dedicated memory slots for subject, style, and structure priors. An Adaptive Gate identifies the incoming task and routes information to the appropriate slot, while Soft Aggregation allows the model to dynamically retrieve and update task-specific knowledge during inference.
The 3SGen architecture highlighting the Adaptive Task-specific Memory (ATM) module and the dual MLLM/VAE encoding branches.

Hierarchical Training

The model follows a three-stage training schedule to ensure stability. It first trains the adaptive gate to categorize tasks, followed by the semantic queries to refine feature extraction. Finally, a joint training phase integrates the VAE features with the DiT blocks, harmonizing the high-level semantics with low-level details.

Datasets and Evaluation

To train 3SGen, the authors utilized a massive multi-source dataset, including Subject200K and UNO for subjects, StyleBooth for styles, and UniWorld for structural data.

To rigorously test the model, the authors introduced 3SGen-Bench, a comprehensive benchmark containing 1,200 samples. This benchmark spans humans, animals, and objects, paired with 40 distinct style types and various structural maps (Canny edges, depth maps, and poses), providing a robust framework for evaluating multi-task performance.

Key Results

3SGen demonstrates significant improvements over state-of-the-art baselines like OmniGen2, FLUX.1-Kontext, and ControlNet across several metrics:

  • Structural Precision: In structure-driven tasks, 3SGen achieved a 35.71 Structure Similarity score, notably higher than UniControl's 31.04.
  • Style and Text Fidelity: The model recorded the highest scores in CSD (Style Similarity) and CLIP-T (Text Fidelity), indicating it can adopt a reference style without sacrificing the integrity of the text prompt.
  • Compositional Generation: Qualitatively, 3SGen excels at "multi-source" tasks, such as rendering a specific person's face in a complex artistic style while maintaining a specific physical pose. This success is attributed to the ATM module's ability to disentangle and then recombine different visual priors.
  • Human Preference: A user study with 85 participants ranked 3SGen highest in visual appearance, subject consistency, and overall task adherence.

Conclusion

3SGen represents a significant step toward a truly unified and controllable image generation system. By leveraging an Adaptive Task-specific Memory module, the framework successfully overcomes the feature entanglement issues that plague previous multi-task models. While the current implementation focuses on static images, the authors suggest that this task-aware memory approach could be extended to video generation, where maintaining consistency across temporal and structural dimensions is a critical challenge.

Summary updated

Abstract

Recent image generation approaches often address subject, style, and structure-driven conditioning in isolation, leading to feature entanglement and limited task transferability. In this paper, we introduce 3SGen, a task-aware unified framework that performs all three conditioning modes within a single model. 3SGen employs an MLLM equipped with learnable semantic queries to align text-image semantics, complemented by a VAE branch that preserves fine-grained visual details. At its core, an Adaptive Task-specific Memory (ATM) module dynamically disentangles, stores, and retrieves condition-specific priors, such as identity for subjects, textures for styles, and spatial layouts for structures, via a lightweight gating mechanism along with several scalable memory items. This design mitigates inter-task interference and naturally scales to compositional inputs. In addition, we propose 3SGen-Bench, a unified image-driven generation benchmark with standardized metrics for evaluating cross-task fidelity and controllability. Extensive experiments on our proposed 3SGen-Bench and other public benchmarks demonstrate our superior performance across diverse image-driven generation tasks.
BibTeX
@misc{song2025sgen,
  author = {Xinyang Song and Libin Wang and Weining Wang and Zhiwei Li and Jianxin Sun and Dandan Zheng and Jingdong Chen and Qi Li and Zhenan Sun},
  title = {{3SGen: Unified Subject, Style, and Structure-Driven Image Generation with Adaptive Task-specific Memory}},
  year = {2025},
  eprint = {2512.19271},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.19271},
}
Figure