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

FastComposer：局所アテンションを活用したチューニング不要の複数被写体画像生成

Guangxuan Xiao, Tianwei Yin, William T. Freeman, Frédo Durand, Song Han · arXiv · 2023年5月17日

- **課題** 既存のパーソナライズされた生成では、被写体ごとにファインチューニングが必要で、複数の被写体を含めると同一性が混ざります。
- **手法** FastComposerは、被写体の画像埋め込みでテキスト条件を拡張し、学習中はcross-attentionマップをマスクで監督します。推論の初期にはテキストだけを使います。
- **結果** 単一被写体の比較では、FastComposerはIdentity preservationが51.41%、複数被写体の比較では43.11%だったと報告しています。アブレーション実験でlocalization損失を除くと、同一性保持は37.66%に下がります。

## 複数被写体のパーソナライズ生成における2つの課題

既存の被写体ベースのテキストから画像への生成では、新しい被写体ごとに拡散モデルをファインチューニングする必要があり、計算コストとハードウェア要件が大きくなります。また、複数の被写体を1つの場面に入れると、互いの同一性が混ざるidentity blending問題が現れます。論文では、この2つの問題の解決を目標として掲げています。

![Figure 2: Two challenges faced by existing subject-driven image generation methods. Firstly, current methods blend the distinct characteristics of different su…](https://refivu.com/papers/da96ee97-6c27-4d11-88b7-679762995493/figures/figure-1847d09b59a157bf5b7dddd0527e97e3.png?thumb=512)

**Figure 2** : Two challenges faced by existing subject-driven image generation methods. Firstly, current methods blend the distinct characteristics of different subjects ( identity blending), shown by the right ﬁgure where Newton resembles Einstein. Cross-attention localization (Sec 4.2) solves this problem. Secondly, they suffer from subject overﬁtting, where they overﬁt the input image and ignore the text instruction. Delayed subject conditioning (Sec 4.3) addresses this issue.

[出典](https://arxiv.org/abs/2305.10431v2) · [CC BY 4.0](https://creativecommons.org/licenses/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 · 論文の図を引用 · 元のPDFの2ページ目から図の部分を抽出しています。

論文では、被写体1つをファインチューニングで学習する最適化ベースの手法は、複数の被写体を組み合わせると、同じ人物を2度生成したり同一性を混ぜたりすると説明されています。そのため、この研究は、チューニングを行わずに参照画像を入力として、複数の被写体を生成する問題を扱います。

## 被写体埋め込みによるテキスト条件の拡張

FastComposerはStable Diffusionをバックボーンとして使い、テキストプロンプトの単語埋め込みのうち被写体に対応する位置を、画像エンコーダが作った被写体の特徴で補強します。論文の式(2)は、対応しないトークンはそのまま残し、被写体に対応するトークンは単語埋め込みと視覚特徴を連結してMLPに通した値に置き換える処理を示しています。

![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…](https://refivu.com/papers/da96ee97-6c27-4d11-88b7-679762995493/figures/figure-7be4523b1f0e48b6ed6865bf4bd893e2.png?thumb=512)

**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 overﬁtting (Sec. 4.3).

[出典](https://arxiv.org/abs/2305.10431v2) · [CC BY 4.0](https://creativecommons.org/licenses/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 · 論文の図を引用 · 元のPDFの4ページ目から図の部分を抽出しています。

この過程ではCLIPテキストエンコーダと画像エンコーダが使われ、学習時には画像エンコーダ、MLP、U-Netをdenoising損失で共に学習します。推論時には被写体画像だけを入力し、追加のファインチューニングなしで拡張された条件を適用します。

## cross-attentionマップのセグメンテーションによる監督

論文では、既存のcross-attentionマップが複数の被写体トークンを同じ生成人物に同時に結びつけ、そのため同一性の混合が起きると解釈されています。この解釈は著者らの仮説であり、図4は正規化していないモデルで、2つの被写体トークンが同じ人物に影響を与える様子を示しています。

![Figure 4: In the absence of cross-attention regularization (top), the diffusion model attends to multiple subjects’ input tokens and merge their identity. By a…](https://refivu.com/papers/da96ee97-6c27-4d11-88b7-679762995493/figures/figure-1aa217c60a35b63196a9c806d076e0fa.png?thumb=512)

**Figure 4** : In the absence of cross-attention regularization (top), the diffusion model attends to multiple subjects’ input tokens and merge their identity. By applying cross-attention regularization (bottom), the diffusion model learns to focus on only one reference token while generating a subject. This ensures that the features of multiple subjects in the generated image are more separated.

[出典](https://arxiv.org/abs/2305.10431v2) · [CC BY 4.0](https://creativecommons.org/licenses/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 · 論文の図を引用 · 元のPDFの5ページ目から図の部分を抽出しています。

FastComposerは学習中、参照被写体のセグメンテーションマスクM\_jと、被写体トークンのcross-attentionマップA\_ijを合わせます。損失は、マスク外の平均とマスク内の平均の差を用いるbalanced L1の形で、全体の目的関数L = L\_noise + λL\_locにおいてλは0.001に設定されます。この監督は学習中のみ使われ、推論時には使われません。

## 遅延被写体条件付け

論文では、推論で拡張されたテキスト表現を最初から使うと、レイアウトが形成される初期のデノイジング段階から参照画像に偏り、テキストの指示を無視する過学習が起きると説明されています。そこで、デノイジング初期はテキストだけを使うcでレイアウトを作り、時間条件比率α以降は被写体拡張条件c′を使います。

論文の式(5)は、t \> αTの区間では元のテキスト埋め込みc、それ以外の区間ではc′を用いる、時間依存のノイズ予測です。論文は、αが0.6から0.8の間のとき、プロンプトへの一致と同一性保持のバランスが良いと報告しています。

![Figure 5: Effects of using different ratios of timesteps for subject conditioning. A ratio between 0.6 to 0.8 yields good results and achieve a balance between…](https://refivu.com/papers/da96ee97-6c27-4d11-88b7-679762995493/figures/figure-f0d15d76bc76bbd520c0541962cfbe95.png?thumb=512)

**Figure 5** : Effects of using different ratios of timesteps for subject conditioning. A ratio between 0.6 to 0.8 yields good results and achieve a balance between prompt consistency and identity preservation.

[出典](https://arxiv.org/abs/2305.10431v2) · [CC BY 4.0](https://creativecommons.org/licenses/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 · 論文の図を引用 · 元のPDFの6ページ目から図の部分を抽出しています。

## 単一被写体の生成比較

単一被写体の評価は、Celeb-Aから取った15名の被写体と、被写体あたり30個のテキストプロンプトで構成されます。ベースラインのTextual-Inversion、DreamBooth、Custom Diffusionは被写体ごとに5枚の画像でファインチューニングされ、FastComposerは被写体ごとにランダムに選んだ参照画像1枚を使いました。

![Figure 6: Comparison of different methods on single subject image generation. For text-only methods (i.e., StableDiffusion and Midjourney), we use scientists’…](https://refivu.com/papers/da96ee97-6c27-4d11-88b7-679762995493/figures/figure-b7307d128d81580882dafedbb7dae14e.png?thumb=512)

**Figure 6** : Comparison of different methods on single subject image generation. For text-only methods (i.e., StableDiffusion and Midjourney), we use scientists’ names in the text prompt.

[出典](https://arxiv.org/abs/2305.10431v2) · [CC BY 4.0](https://creativecommons.org/licenses/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 · 論文の図を引用 · 元のPDFの7ページ目から図の部分を抽出しています。

この設定で、FastComposerはIdentity preservation 51.41%、Prompt consistency 24.30%、総時間2 s、ピークメモリ6 GBを報告しています。論文は、この結果が最適化ベースのベースラインと比べて300×-1200×の速度向上と2.8×のメモリ削減を意味すると報告しています。

## 複数被写体の生成とアブレーション実験

複数被写体の評価では、15名の被写体から作った105個のペアの組み合わせを使い、組み合わせごとに21個のプロンプトを割り当てます。この比較でFastComposerは、Identity preservation 43.11%、Prompt consistency 24.25%、総時間2 sを報告しています。論文は、Textual-InversionとCustom Diffusionが同一性保持で低いと報告しており、これは同じ表に示されたベースラインの値と比べた結果です。

![Figure 1: Comparison with baselines for multi-subject image generation. We use scientists’ names in the text prompt for text-only methods (SD, MJ). Text-only m…](https://refivu.com/papers/da96ee97-6c27-4d11-88b7-679762995493/figures/figure-5812f4621e32740f7e8cd5b1793ee373.png?thumb=512)

**Figure 1** : Comparison with baselines for multi-subject image generation. We use scientists’ names in the text prompt for text-only methods (SD, MJ). Text-only methods only perform well when subjects are present in the training dataset but struggle to maintain the identity otherwise. Fine-tuning-based methods blend the identity of different persons (TI rows 1 and 2, CD rows 1, 2, 4), deviate from the text instruction and only generate a single subject (TI row 4), or generate images that do not resemble any speciﬁc reference (CD row 3).

[出典](https://arxiv.org/abs/2305.10431v2) · [CC BY 4.0](https://creativecommons.org/licenses/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 · 論文の図を引用 · 元のPDFの2ページ目から図の部分を抽出しています。

アブレーション実験では、cross-attentionの局所化損失を除いた同じ設定のモデルと比較します。除いたモデルはIdentity Pres. 37.66%、Prompt Cons. 25.03%で、損失を含むモデルは43.11%と24.25%です。これは、この損失が同一性保持を高める一方で、プロンプトへの一致はわずかに下げた結果と捉えられます。

![Table 3: Ablation studies on the cross-attention localization supervision. We compare with the model trained in the same setting without cross-attention locali…](https://refivu.com/papers/da96ee97-6c27-4d11-88b7-679762995493/figures/figure-6efa1634e685b25d0975ca42063b5489.png?thumb=512)

**Table 3** : Ablation studies on the cross-attention localization supervision. We compare with the model trained in the same setting without cross-attention localization.

[出典](https://arxiv.org/abs/2305.10431v2) · [CC BY 4.0](https://creativecommons.org/licenses/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 · 論文の図を引用 · 元のPDFの9ページ目から図の部分を抽出しています。

## データと適用範囲の限界

論文では、学習データのFFHQは小規模で、主に人間の顔のヘッドショットから構成されており、人数分布がロングテールであるため、3人を超える被写体の生成に限界があると説明されています。また、動物など他のカテゴリの複数被写体データが不足しているため、研究は主に人を中心としていると明らかにされています。

そのため、この結果は人間の顔を中心としたデータとStable Diffusionベースの設定で得られたものです。論文は、モデルがベースモデルとデータのバイアスも引き継ぐと明らかにしています。

## 論文情報

- **著者**: Guangxuan Xiao, Tianwei Yin, William T. Freeman, Frédo Durand, Song Han
- **学会・ジャーナル**: arXiv · プレプリント
- **公開日**: 2023年5月17日
- **登録日**: 2026年11月6日
- **更新日**: 2023年5月21日
- **バージョン**: v2
- **arXiv**: 2305.10431
- **カテゴリ**: cs.CV
- **ライセンス**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **掲載内容**: 論文情報・解説・論文の図

[元論文 ↗](https://arxiv.org/abs/2305.10431v2) · [PDF ↗](https://arxiv.org/pdf/2305.10431v2)

この解説は、Refivuの韓国語解説をAIで翻訳したものです。不正確な翻訳や誤りが含まれる可能性があります。論文と図の利用条件は各出典に従います。

## アブストラクト

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.

## この論文を引用

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}
}
```

## この論文の用語

- [U-Net](https://refivu.com/ja/terms/f49a93d54ad5-u-net)
- [CLIP](https://refivu.com/ja/terms/b5b5b48d5f4e-clip)
- [MTCNN](https://refivu.com/ja/terms/d2e74557ef38-mtcnn)
- [balanced L1 loss](https://refivu.com/ja/terms/b5acbf241583-balanced-l1-loss)
- [DreamBooth](https://refivu.com/ja/terms/0469e4e7700d-dreambooth)
- [FaceNet](https://refivu.com/ja/terms/bbc4f927d331-facenet)

## ほかの論文解説

- [An Introduction to Deep Generative Modeling](https://refivu.com/ja/papers/02e18aa5-91fb-46d1-afb1-87e9dbd71146-an-introduction-to-deep-generative-modeling.md)
- [MagicAnimate: Temporally Consistent Human Image Animation using Diffusion Model](https://refivu.com/ja/papers/d7e4c79d-ac46-4e0f-aef6-34e570d43e2f-magicanimate-temporally-consistent-human-image-animation.md)
- [Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusions](https://refivu.com/ja/papers/64d5ed83-79ac-4425-8629-7aff772bd0c4-train-for-the-worst-plan-for-the-best.md)
- [Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow](https://refivu.com/ja/papers/a0c4439d-88d7-4d0f-be30-5509d158003e-flow-straight-and-fast-learning-to-generate-and.md)
- [Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding](https://refivu.com/ja/papers/eaa0c3ba-e0e4-4517-8ef7-d6ec6ba261b6-photorealistic-text-to-image-diffusion-models-with-deep.md)
- [Consistency Models](https://refivu.com/ja/papers/f97e5129-1522-4b93-9b60-0a1f3af22d42-consistency-models.md)
- [Interpretable and Explainable Machine Learning for Materials Science and Chemistry](https://refivu.com/ja/papers/77f32892-bb87-467e-b149-940994557a38-interpretable-and-explainable-machine-learning-for-materials.md)
- [Clustering Algorithms: A Comparative Approach](https://refivu.com/ja/papers/49073458-c398-4adb-b4eb-f71401de6b77-clustering-algorithms-a-comparative-approach.md)
- [Neural-Symbolic Computing: An Effective Methodology for Principled Integration of Machine Learning and Reasoning](https://refivu.com/ja/papers/587df0e3-05ee-43a3-99c8-d8f40d9fdee1-neural-symbolic-computing-an-effective-methodology-for.md)
- [Continuous online sequence learning with an unsupervised neural network model](https://refivu.com/ja/papers/2850b462-149b-4637-8186-0e3a02a69df4-continuous-online-sequence-learning-with-an-unsupervised.md)
- [A Cost-Sensitive Deep Belief Network for Imbalanced Classification](https://refivu.com/ja/papers/140fac18-43ea-4f02-a761-0549f84a0de3-a-cost-sensitive-deep-belief-network-for-imbalanced.md)
- [Multi-Temporal Land Cover Classification with Sequential Recurrent Encoders](https://refivu.com/ja/papers/fbc752d9-1a2a-4b13-ac64-8967dd7bd971-multi-temporal-land-cover-classification-with-sequential.md)

---

AI解説には誤りが含まれることがあります。 [Refivu](https://refivu.com/ja/papers/da96ee97-6c27-4d11-88b7-679762995493-fastcomposer-tuning-free-multi-subject-image-generation-with)
