[论文解读] Designing a Better Asymmetric VQGAN for StableDiffusion
本文提出一种用于StableDiffusion的非对称VQGAN,通过在修复和局部编辑过程中减少未编辑图像区域的失真,实现了显著改进。通过引入利用任务特定先验(如未掩码图像区域)的条件解码分支,以及比编码器深得多的解码器,该方法在保持低推理成本的同时,有效保留了精细细节,在图像修复与编辑基准测试中达到最先进性能。
StableDiffusion is a revolutionary text-to-image generator that is causing a stir in the world of image generation and editing. Unlike traditional methods that learn a diffusion model in pixel space, StableDiffusion learns a diffusion model in the latent space via a VQGAN, ensuring both efficiency and quality. It not only supports image generation tasks, but also enables image editing for real images, such as image inpainting and local editing. However, we have observed that the vanilla VQGAN used in StableDiffusion leads to significant information loss, causing distortion artifacts even in non-edited image regions. To this end, we propose a new asymmetric VQGAN with two simple designs. Firstly, in addition to the input from the encoder, the decoder contains a conditional branch that incorporates information from task-specific priors, such as the unmasked image region in inpainting. Secondly, the decoder is much heavier than the encoder, allowing for more detailed recovery while only slightly increasing the total inference cost. The training cost of our asymmetric VQGAN is cheap, and we only need to retrain a new asymmetric decoder while keeping the vanilla VQGAN encoder and StableDiffusion unchanged. Our asymmetric VQGAN can be widely used in StableDiffusion-based inpainting and local editing methods. Extensive experiments demonstrate that it can significantly improve the inpainting and editing performance, while maintaining the original text-to-image capability. The code is available at \url{https://github.com/buxiangzhiren/Asymmetric_VQGAN}.
研究动机与目标
- 识别并解决基于StableDiffusion的图像编辑中,未编辑区域出现失真伪影的根本原因。
- 提升编辑图像的保真度与细节保留能力,特别是在文本等细粒度结构区域。
- 设计一种与现有StableDiffusion流程兼容的VQGAN变体,同时在编辑任务中实现性能增强。
- 确保新架构在训练与推理阶段均保持高效,支持广泛部署。
提出的方法
- 将解码器重构为条件解码器,同时接收VQGAN编码器输出与任务特定先验(如图像修复中的未掩码区域)作为输入。
- 相较于编码器,采用更深更宽的解码器结构,从而更有效地从量化潜在表征中重建高保真细节。
- 在预训练阶段,通过将部分掩码替换为全掩码,使解码器学习在无先验条件下重建完整图像。
- 仅对解码器进行微调;原始VQGAN编码器与StableDiffusion模型保持不变,实现即插即用的集成。
- 条件分支仅在编辑任务中启用;在文生图生成过程中则禁用,以保持原始生成能力。
- 通过动态输入路由机制,该架构可同时支持带先验的编辑任务与无先验的纯文生图生成。
实验结果
研究问题
- RQ1为何现有基于StableDiffusion的编辑方法会在未编辑区域产生严重失真?
- RQ2引入结合任务特定先验的条件解码分支,能否有效减少未编辑区域的重建伪影?
- RQ3相较于编码器,提升解码器容量是否能改善细节恢复并降低量化引起的失真?
- RQ4所提出的非对称VQGAN能否在不重训练主扩散模型的前提下,同时在编辑与文生图任务中保持高性能?
- RQ5在所提出的非对称设计中,图像质量提升与推理成本之间的权衡关系如何?
主要发现
- 在Place数据集上,所提非对称VQGAN在图像修复任务中取得1.03的FID分数,达到当前最先进水平。
- 在COCOEE数据集上,模型在示例绘画编辑任务中取得86.35%的CLIP分数,显著优于先前方法。
- 消融实验表明,条件分支将示例绘画任务中的保留误差从588.86降低至0.76,充分证明其在细节保留方面的强大能力。
- 即使不启用条件分支,更大的解码器仍能比基线模型恢复更多复杂细节,表明其本身具备高保真重建的内在潜力。
- 在纯文生图生成任务中,模型性能与原始StableDiffusion相当或更优,验证了其通用性。
- 图5、6和7的视觉结果一致表明,无论在何种编辑与生成场景下,该方法在和谐性与细节保留方面均有稳定提升。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。