Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Hsiao, Teng-Fang, Ruan, Bo-Kai, Tsai, Sung-Lin, Wu, Yi-Lun, Shuai, Hong-Han
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:https://arxiv.org/abs/2412.00427
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866910722369257472
author Hsiao, Teng-Fang
Ruan, Bo-Kai
Tsai, Sung-Lin
Wu, Yi-Lun
Shuai, Hong-Han
author_facet Hsiao, Teng-Fang
Ruan, Bo-Kai
Tsai, Sung-Lin
Wu, Yi-Lun
Shuai, Hong-Han
contents In this study, we aim to determine and solve the deficiency of Stable Diffusion Inpainting (SDI) in following the instruction of both prompt and mask. Due to the training bias from masking, the inpainting quality is hindered when the prompt instruction and image condition are not related. Therefore, we conduct a detailed analysis of the internal representations learned by SDI, focusing on how the mask input influences the cross-attention layer. We observe that adapting text key tokens toward the input mask enables the model to selectively paint within the given area. Leveraging these insights, we propose FreeCond, which adjusts only the input mask condition and image condition. By increasing the latent mask value and modifying the frequency of image condition, we align the cross-attention features with the model's training bias to improve generation quality without additional computation, particularly when user inputs are complicated and deviate from the training setup. Extensive experiments demonstrate that FreeCond can enhance any SDI-based model, e.g., yielding up to a 60% and 58% improvement of SDI and SDXLI in the CLIP score.
format Preprint
id arxiv_https___arxiv_org_abs_2412_00427
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle FreeCond: Free Lunch in the Input Conditions of Text-Guided Inpainting
Hsiao, Teng-Fang
Ruan, Bo-Kai
Tsai, Sung-Lin
Wu, Yi-Lun
Shuai, Hong-Han
Computer Vision and Pattern Recognition
Artificial Intelligence
In this study, we aim to determine and solve the deficiency of Stable Diffusion Inpainting (SDI) in following the instruction of both prompt and mask. Due to the training bias from masking, the inpainting quality is hindered when the prompt instruction and image condition are not related. Therefore, we conduct a detailed analysis of the internal representations learned by SDI, focusing on how the mask input influences the cross-attention layer. We observe that adapting text key tokens toward the input mask enables the model to selectively paint within the given area. Leveraging these insights, we propose FreeCond, which adjusts only the input mask condition and image condition. By increasing the latent mask value and modifying the frequency of image condition, we align the cross-attention features with the model's training bias to improve generation quality without additional computation, particularly when user inputs are complicated and deviate from the training setup. Extensive experiments demonstrate that FreeCond can enhance any SDI-based model, e.g., yielding up to a 60% and 58% improvement of SDI and SDXLI in the CLIP score.
title FreeCond: Free Lunch in the Input Conditions of Text-Guided Inpainting
topic Computer Vision and Pattern Recognition
Artificial Intelligence
url https://arxiv.org/abs/2412.00427