[Paper Review] Designing a Better Asymmetric VQGAN for StableDiffusion
This paper proposes an asymmetric VQGAN for StableDiffusion that reduces distortion in non-edited image regions during inpainting and local editing. By introducing a conditional decoder branch using task-specific priors (e.g., unmasked image regions) and a significantly deeper decoder than the encoder, the method preserves fine details while maintaining low inference cost, achieving state-of-the-art results on inpainting and editing benchmarks.
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}.
Motivation & Objective
- To identify and address the root cause of distortion artifacts in non-edited regions during StableDiffusion-based image editing.
- To improve the fidelity and detail preservation of edited images, especially in regions with fine-grained structures like text.
- To design a VQGAN variant that maintains compatibility with existing StableDiffusion pipelines while enhancing performance on editing tasks.
- To ensure the new architecture remains efficient in both training and inference, enabling broad deployment.
Proposed method
- The decoder is restructured as a conditional decoder that takes both the VQGAN encoder output and task-specific priors (e.g., unmasked image regions in inpainting) as inputs.
- A deeper and wider decoder is used compared to the encoder, enabling better reconstruction of high-fidelity details from quantized latent representations.
- The model is trained by replacing some masks with full masks during pretraining, allowing the decoder to learn to reconstruct full images without priors.
- Only the decoder is retrained; the original VQGAN encoder and StableDiffusion model remain unchanged, enabling plug-and-play integration.
- The conditional branch is enabled only during editing tasks; during text-to-image generation, it is disabled, preserving generative capability.
- The architecture supports both editing tasks (with priors) and pure text-to-image generation (without priors) through dynamic input routing.
Experimental results
Research questions
- RQ1Why do existing StableDiffusion-based editing methods produce severe distortion in non-edited image regions?
- RQ2Can a conditional decoder branch that incorporates task-specific priors reduce reconstruction artifacts in non-edited regions?
- RQ3Does increasing decoder capacity relative to the encoder improve detail recovery and reduce quantization-induced distortions?
- RQ4Can the proposed asymmetric VQGAN maintain high performance in both editing and text-to-image generation tasks without retraining the main diffusion model?
- RQ5What is the trade-off between improved image quality and inference cost in the proposed asymmetric design?
Key findings
- The proposed asymmetric VQGAN achieves a 1.03 FID score on the Place dataset for image inpainting, representing state-of-the-art performance.
- On the COCOEE dataset, the model achieves a 86.35% CLIP score in paint-by-example editing, significantly outperforming prior methods.
- The ablation study shows that the conditional branch reduces preserving error from 588.86 to 0.76 in the paint-by-example task, demonstrating strong detail preservation.
- Even without the conditional branch, the larger decoder recovers more intricate details than the baseline, indicating its intrinsic capability for high-fidelity reconstruction.
- The model maintains comparable or better performance than the original StableDiffusion in pure text-to-image generation tasks, confirming its generality.
- Visual results in Figures 5, 6, and 7 confirm consistent improvement in harmonization and detail preservation across diverse editing and generation scenarios.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.