Text-to-image model personalization aims to introduce a user-provided concept to the model, allowing its synthesis in diverse contexts. However, current methods primarily focus on the case of learning a single concept from multiple images with variations in backgrounds and poses, and struggle when adapted to a different scenario. In this work, we introduce the task of textual scene decomposition: given a single image of a scene that may contain several concepts, we aim to extract a distinct text token for each concept, enabling fine-grained control over the generated scenes. To this end, we propose augmenting the input image with masks that indicate the presence of target concepts. These masks can be provided by the user or generated automatically by a pre-trained segmentation model. We then present a novel two-phase customization process that optimizes a set of dedicated textual embeddings (handles), as well as the model weights, striking a delicate balance between accurately capturing the concepts and avoiding overfitting. We employ a masked diffusion loss to enable handles to generate their assigned concepts, complemented by a novel loss on cross-attention maps to prevent entanglement. We also introduce union-sampling, a training strategy aimed to improve the ability of combining multiple concepts in generated images. We use several automatic metrics to quantitatively compare our method against several baselines, and further affirm the results using a user study. Finally, we showcase several applications of our method. Project page is available at: https://omriavrahami.com/break-a-scene/
翻译:文本到图像模型的个性化旨在将用户提供的概念引入模型,使其能够在不同场景中生成。然而,现有方法主要关注从多张具有背景和姿态变化的图像中学习单一概念,在适应不同场景时会遇到困难。本文提出了一项新任务——文本场景分解:给定一张可能包含多个概念的场景图像,我们旨在为每个概念提取不同的文本标记,从而实现对生成场景的精细控制。为此,我们建议用指示目标概念存在情况的掩码对输入图像进行增强。这些掩码可由用户提供,或由预训练的分割模型自动生成。随后,我们提出了一种新颖的两阶段定制流程,该流程优化一组专用的文本嵌入(句柄)以及模型权重,在准确捕获概念与避免过拟合之间取得精妙平衡。我们采用掩码扩散损失使句柄能够生成其指定的概念,并辅以基于交叉注意力图的新损失函数以防止概念纠缠。此外,我们还引入了联合采样训练策略,旨在提升生成图像中多概念组合的能力。我们使用多种自动指标将所提方法与多个基线进行定量比较,并通过用户研究进一步验证结果。最后,我们展示了该方法在若干应用场景中的效果。项目页面请访问:https://omriavrahami.com/break-a-scene/