안정적인 디퓨전을 위한 향상된 비대칭 VQGAN 설계
Designing a Better Asymmetric VQGAN for StableDiffusion
June 7, 2023
저자: Zixin Zhu, Xuelu Feng, Dongdong Chen, Jianmin Bao, Le Wang, Yinpeng Chen, Lu Yuan, Gang Hua
cs.AI
초록
StableDiffusion은 이미지 생성 및 편집 분야에서 혁신을 일으키고 있는 텍스트-이미지 생성기입니다. 기존의 픽셀 공간에서 확산 모델을 학습하는 방법과 달리, StableDiffusion은 VQGAN을 통해 잠재 공간에서 확산 모델을 학습함으로써 효율성과 품질을 동시에 보장합니다. 이 모델은 이미지 생성 작업을 지원할 뿐만 아니라, 이미지 인페인팅 및 지역 편집과 같은 실제 이미지 편집도 가능하게 합니다. 그러나 StableDiffusion에서 사용되는 기본 VQGAN은 상당한 정보 손실을 초래하여, 편집되지 않은 이미지 영역에서도 왜곡 아티팩트를 유발하는 것으로 관찰되었습니다. 이를 해결하기 위해, 우리는 두 가지 간단한 설계를 포함한 새로운 비대칭 VQGAN을 제안합니다. 첫째, 인코더의 입력 외에도 디코더는 인페인팅에서 마스크되지 않은 이미지 영역과 같은 작업별 사전 정보를 통합하는 조건부 분기를 포함합니다. 둘째, 디코더는 인코더보다 훨씬 더 무거워져, 전체 추론 비용을 약간만 증가시키면서도 더 세밀한 복구를 가능하게 합니다. 우리의 비대칭 VQGAN의 학습 비용은 저렴하며, 기본 VQGAN 인코더와 StableDiffusion을 변경하지 않고도 새로운 비대칭 디코더만 재학습하면 됩니다. 이 비대칭 VQGAN은 StableDiffusion 기반의 인페인팅 및 지역 편집 방법에 광범위하게 적용될 수 있습니다. 광범위한 실험을 통해 이 모델이 원본 텍스트-이미지 기능을 유지하면서도 인페인팅 및 편집 성능을 크게 향상시킬 수 있음을 입증했습니다. 코드는 https://github.com/buxiangzhiren/Asymmetric_VQGAN에서 확인할 수 있습니다.
English
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
https://github.com/buxiangzhiren/Asymmetric_VQGAN.