Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

FastComposer: Tuning-Free Multi-Subject Image Generation with Localized Attention

  • Problem Personalizing a diffusion model to a new person usually means fine-tuning it for that person, which is costly, and multi-subject prompts make different people's features bleed into each other.
  • Method Adds identity features from reference photos to the text embeddings of Stable Diffusion with a CLIP-based MLP, supervises cross-attention maps with subject masks during training, and switches on subject conditioning only after the early denoising steps.
  • Results Reached 51.41% identity preservation on single-subject generation against 43.37% for Custom Diffusion, and 43.11% on multi-subject pairs against 13.52% for Textual-Inversion.

Figure 3: Training and inference pipeline of FastComposer. Given a text description and images of multiple sub-
jects, FastComposer uses an image encoder to ex…

Figure 3 : Training and inference pipeline of FastComposer. Given a text description and images of multiple sub- jects, FastComposer uses an image encoder to extract the features of the subjects and augments the corresponding text tokens. The diffusion model is trained to generate multi-subject images with augmented conditioning. We use cross-attention localization (Sec. 4.2) to boost multi-subject generation quality, and delayed subject conditioning to avoid subject overfitting (Sec. 4.3).

Original paper · CC BY 4.0 · Guangxuan Xiao, Tianwei Yin, William T. Freeman, Frédo Durand, Song Han · FastComposer: Tuning-Free Multi-Subject Image Generation with Localized Attention · Original paper figure · Extracted the figure area from page 4 of the original PDF.

Why personalization and multi-subject prompts are hard

Subject-driven generation adapts a text-to-image model to a person seen only in a few sample images. Most existing approaches reach their best fidelity by fine-tuning the model for each new subject. Fine-tuning needs backpropagation, which raises memory use and computation, so these methods cannot run comfortably on phones and are hard to scale in the cloud.

With several people in one prompt, the same model tends to mix their features, so one subject takes on traits of another. The authors call this identity blending. Figure 2 illustrates the failure: a generated Newton picks up features of Einstein, and in a second failure the model overfits the reference photo and ignores the edit requested in the text.

How reference images enter the text embedding

FastComposer keeps Stable Diffusion as the backbone and changes only the conditioning. The embeddings of the words that name subjects are augmented with identity features from reference images, rather than the weights being tuned for each subject. The prompt and the reference subject images are encoded with the pre-trained CLIP text encoder ψ and image encoder φ.

The index list maps each reference subject to the word in the prompt it replaces in the conditioning.

Each subject word's embedding is concatenated with the image feature of its matched subject and passed through a multilayer perceptron. Words that are not matched to any subject keep their original embedding. Formally, the augmented embedding is defined as follows, where n is the number of prompt words and I is the set of subject indices.

\[ c'_i = \begin{cases} \psi(P)_i, & i \notin I \\ \mathrm{MLP}(\psi(P)_i \,\|\, \varphi(s_j)), & i = i_j \in I \end{cases} \] Because the identity enters as a forward pass through the image encoder, a new subject needs no new weights. The abstract states that this requires zero extra storage for new subjects.

Training data and training setup

The training pairs are built from FFHQ-wild. BLIP-2 generates a caption for each image, Mask2Former produces panoptic masks, and spaCy extracts the noun phrases from the captions. Noun phrases are matched to image segments greedily, using the product of an OpenCLIP image-text similarity and a Sentence-Transformer label-text similarity. A set of 1000 images is held out for validation and testing.

Backgrounds of the subjects are masked with random noise before encoding, so that natural photos can be used at inference without a separate background segmentation step.

Only segments labelled "person" are augmented, with at most 4 reference subjects per training example, and each subject has a 10% chance of being dropped. Some samples are trained text-only, and some with no condition, to keep text generation and classifier-free guidance working.

Supervising cross-attention with subject masks

The authors identify this unregulated cross-attention as the main reason for identity blending: when two "person" tokens are present, each token's map covers both people rather than one.

The fix is to supervise each subject token's attention map with the segmentation mask of its reference subject. The loss compares the mean attention outside the mask with the mean attention inside it. \[ L_{loc} = \frac{1}{m}\sum_{j=1}^{m}\left(\mathrm{mean}(A_{ij}[\bar{m}_j]) - \mathrm{mean}(A_{ij}[m_j])\right) \] Minimizing this term raises attention inside each subject's mask relative to the region outside it, which pushes the subjects toward non-overlapping regions.

The total objective adds this term to the denoising loss, \[ L = L_{noise} + \lambda L_{loc}, \] with λ = 0.001. The loss is applied to the middle 5 blocks of the U-Net, which the authors chose because these blocks hold more semantic information. Segmentation masks and this regularization are used only in training, not at test time.

Delaying subject conditioning during denoising

Applying the augmented embedding from the first step makes the image copy the reference face and drop the text instruction. The authors explain this by the layout forming in the early denoising steps, while premature subject features push it away from the prompt. The fix borrows the idea of Style Mixing: the layout is fixed with the text-only prompt first, and subject identity is added later.

The noise prediction uses the original embedding c while the timestep is above αT, and the augmented embedding c′ otherwise. \[ \epsilon_t = \begin{cases} \epsilon_\theta(z_t,t,c) & \text{if } t > \alpha T, \\ \epsilon_\theta(z_t,t,c') & \text{otherwise} \end{cases} \] Here α is the ratio of steps that use subject conditioning. The authors report that α between 0.6 and 0.8 gives a good balance between prompt consistency and identity preservation.

Single-subject results against optimization baselines

The test set uses 15 subjects derived from Celeb-A, each with 30 prompts covering recontextualization, stylization, accessorization and actions. Identity preservation detects faces with MTCNN and scores pairs with FaceNet, while prompt consistency is the average CLIP-L/14 image-text similarity. The baselines use five images per subject, whereas FastComposer uses one randomly selected image.

FastComposer reached 51.41% identity preservation and 24.30% prompt consistency in Table 1. Custom Diffusion scored 43.37% and 23.29%, Textual-Inversion 29.26% and 21.91%, and DreamBooth 27.27% and 23.91%. Text-only Stable Diffusion, with no subject conditioning, scored 3.85% identity preservation and the highest prompt consistency at 26.79%.

The time column includes fine-tuning for the tuning-based methods, and FastComposer takes 2 s against 789 s to 2500 s for them. Peak memory is 6 GB for FastComposer against 17 GB, 40 GB and 29 GB for the baselines. The single-subject comparison reports a 300×-1200× speedup and a 2.8× reduction in memory usage. The abstract gives a wider 300×-2500× range for fine-tuning-based methods.

Multi-subject results on subject pairs

In Table 2, FastComposer reached 43.11% identity preservation and 24.25% prompt consistency, with a total time of 2 s and 6 GB peak memory. Textual-Inversion reached 13.52% identity preservation and 21.08% prompt consistency at 4998 s, and Custom Diffusion reached 5.37% and 25.84% at 789 s. Table 2 has no DreamBooth row, and text-only Stable Diffusion reached 1.88% identity preservation.

The authors say the optimization baselines often produce generic images or blend the identities of different reference subjects, which the identity score reflects. They describe FastComposer's prompt consistency as on par with the tuning-based approaches Textual-Inversion and Custom Diffusion. Figure 1 gives qualitative comparisons, and three-subject examples appear in Figure 7.

What the localization loss and the timestep ratio contribute

Table 3 compares the same training setting with and without the cross-attention localization loss. Only the localization term is removed, and the denoising loss is kept. Identity preservation is 43.11% with the loss and 37.66% without it. Prompt consistency is 24.25% with the loss and 25.03% without it.

The identity gain comes with a slightly lower prompt consistency in this comparison. The authors attribute the identity gain to the model focusing on particular reference subjects, which avoids identity blending.

Figure 5 varies the ratio of timesteps that use subject conditioning. As the ratio grows, identity preservation improves while editability falls, and a ratio between 0.6 and 0.8 gives the favorable tradeoff the authors chose.

Limitations

The training set is FFHQ, which is small and mostly contains headshots of faces. Its long-tailed distribution of person counts limits generation to more than three subjects, according to the authors. Training allows up to 4 reference subjects, but the authors state that the dataset limits generation beyond three subjects.

The work is primarily human-centric because large-scale multi-subject datasets with other subjects, such as animals, are scarce. The authors expect a broader dataset to widen the range of actions and scenarios.

Paper info

Authors
Guangxuan Xiao, Tianwei Yin, William T. Freeman, Frédo Durand, Song Han
Venue
arXiv · Preprint
First published
2023-5-17
Added
2026-11-6
Updated
2023-5-21
Version
v2
arXiv
2305.10431
Category
cs.CV
Original paper terms
CC BY 4.0
What we show
Paper info, commentary and permitted figures from the original paper

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Abstract

Diffusion models excel at text-to-image generation, especially in subject-driven generation for personalized images. However, existing methods are inefficient due to the subject-specific fine-tuning, which is computationally intensive and hampers efficient deployment. Moreover, existing methods struggle with multi-subject generation as they often blend features among subjects. We present FastComposer which enables efficient, personalized, multi-subject text-to-image generation without fine-tuning. FastComposer uses subject embeddings extracted by an image encoder to augment the generic text conditioning in diffusion models, enabling personalized image generation based on subject images and textual instructions with only forward passes. To address the identity blending problem in the multi-subject generation, FastComposer proposes cross-attention localization supervision during training, enforcing the attention of reference subjects localized to the correct regions in the target images. Naively conditioning on subject embeddings results in subject overfitting. FastComposer proposes delayed subject conditioning in the denoising step to maintain both identity and editability in subject-driven image generation. FastComposer generates images of multiple unseen individuals with different styles, actions, and contexts. It achieves 300$\times$-2500$\times$ speedup compared to fine-tuning-based methods and requires zero extra storage for new subjects. FastComposer paves the way for efficient, personalized, and high-quality multi-subject image creation. Code, model, and dataset are available at https://github.com/mit-han-lab/fastcomposer.

Quote from the paper

Guangxuan Xiao, Tianwei Yin, William T. Freeman, Frédo Durand, Song Han (2023). FastComposer: Tuning-Free Multi-Subject Image Generation with Localized Attention. arXiv:2305.10431v2. https://arxiv.org/abs/2305.10431v2

BibTeX
@misc{xiao2023fastcomposer,
  title = {{FastComposer: Tuning-Free Multi-Subject Image Generation with Localized Attention}},
  author = {Guangxuan Xiao and Tianwei Yin and William T. Freeman and Frédo Durand and Song Han},
  year = {2023},
  eprint = {2305.10431},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.10431v2}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up