SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.10431 · 2023

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

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 17 functions out of this paper's own repositories and ran 6 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
mit-han-lab/fastcomposer canonical 6 of 17
FunctionStatusWhere it lives
get_test_transforms Ran mit-han-lab/fastcomposer/fastcomposer/transforms.py
code served (permissive licence) · get_code("addaaf66c3ab7352")
get_train_transforms Ran mit-han-lab/fastcomposer/fastcomposer/transforms.py
code served (permissive licence) · get_code("c036796b62b5952d")
get_train_transforms_with_segmap Ran mit-han-lab/fastcomposer/fastcomposer/transforms.py
code served (permissive licence) · get_code("15ed5aec7f6bd270")
prepare_image_token_idx Ran mit-han-lab/fastcomposer/fastcomposer/data.py
code served (permissive licence) · get_code("817e9d69c2cd23d3")
scatter_object_embeddings Ran mit-han-lab/fastcomposer/fastcomposer/model.py
code served (permissive licence) · get_code("ff242689fdee9a2e")
stable_diffusion_call_with_references_delayed_conditioning Ran mit-han-lab/fastcomposer/fastcomposer/pipeline.py
code served (permissive licence) · get_code("d3c9a29ac1be57e9")
collate_fn Not yet run mit-han-lab/fastcomposer/fastcomposer/data.py
code served (permissive licence) · get_code("1b1c247142456689")
compute_similarity_matrix Not yet run mit-han-lab/fastcomposer/evaluation/single_object/single_object_evaluation.py
code served (permissive licence) · get_code("b77a02409cff8d05")
fuse_object_embeddings Not yet run mit-han-lab/fastcomposer/fastcomposer/model.py
code served (permissive licence) · get_code("2fa8e59bc1db947b")
get_accessory_prompts Not yet run mit-han-lab/fastcomposer/evaluation/single_object/data.py
code served (permissive licence) · get_code("032366a6a60db29a")
get_context_prompts Not yet run mit-han-lab/fastcomposer/evaluation/single_object/data.py
code served (permissive licence) · get_code("4876d90a82330a60")
get_data_loader Not yet run mit-han-lab/fastcomposer/fastcomposer/data.py
code served (permissive licence) · get_code("c39580137a368949")
get_style_prompts Not yet run mit-han-lab/fastcomposer/evaluation/single_object/data.py
code served (permissive licence) · get_code("8d486087a7446edf")
greedy_matching Not yet run mit-han-lab/fastcomposer/evaluation/single_object/single_object_evaluation.py
code served (permissive licence) · get_code("20c814d007b3b03b")
parse_args Not yet run mit-han-lab/fastcomposer/fastcomposer/utils.py
code served (permissive licence) · get_code("15ad961bd4dd81e7")
read_reference_images Not yet run mit-han-lab/fastcomposer/evaluation/single_object/single_object_evaluation.py
code served (permissive licence) · get_code("09e9aa9e75519b16")
unet_store_cross_attention_scores Not yet run mit-han-lab/fastcomposer/fastcomposer/model.py
code served (permissive licence) · get_code("0a5a54048f832e12")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2305.10431")
get_code_for_paper("2305.10431")
have("2305.10431")

Connect an agent — have() is free.