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/