Stencil: Subject-Driven Generation with Context Guidance

Gordon Chen, Ziqi Huang, Cheston Tan, Ziwei Liu
9/21/2025
cs.CV

No confident code implementation found for this paper.

Abstract

Recent text-to-image diffusion models can generate striking visuals from text prompts, but they often fail to maintain subject consistency across generations and contexts. One major limitation of current fine-tuning approaches is the inherent trade-off between quality and efficiency. Fine-tuning large models improves fidelity but is computationally expensive, while fine-tuning lightweight models improves efficiency but compromises image fidelity. Moreover, fine-tuning pre-trained models on a small set of images of the subject can damage the existing priors, resulting in suboptimal results. To this end, we present Stencil, a novel framework that jointly employs two diffusion models during inference. Stencil efficiently fine-tunes a lightweight model on images of the subject, while a large frozen pre-trained model provides contextual guidance during inference, injecting rich priors to enhance generation with minimal overhead. Stencil excels at generating high-fidelity, novel renditions of the subject in less than a minute, delivering state-of-the-art performance and setting a new benchmark in subject-driven generation.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{chen2025stencil,
  title  = {Stencil: Subject-Driven Generation with Context Guidance},
  author = {Gordon Chen and Ziqi Huang and Cheston Tan and Ziwei Liu},
  year   = {2025},
  eprint = {2509.17120},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.17120v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2509.17120.svg)](https://codeofpaper.com/paper/2509.17120)

Discussion