Comfy-Org / Comfy-Org/ComfyUI

When performing VAE encoding on high-resolution images, there is a high probability that the original image will be changed and artifacts will be generated.

Open
#3,964 3 comments 0 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 6h
Merged PRs (30d)
155

Description

### Expected Behavior

Since upscaling is an important feature, it is very important to remove these artifacts to preserve the original image content. These artifacts are difficult to remove at low denosing levels, making the result poor.

### Actual Behavior

Original image
https://files.catbox.moe/uxrle2.png
After VAE encoding
https://files.catbox.moe/4f9mbh.png
Artifacts:
![image](https://github.com/comfyanonymous/ComfyUI/assets/83766753/5c74c798-0f1b-4fc2-ac10-fd7764a1de73)

### Steps to Reproduce

[VAE_encode.json](https://github.com/user-attachments/files/16118483/VAE_encode.json)
If you use any high-resolution image to encode with the SD15 series VAE, you should be able to observe this problem. The SDXL series VAE will not have this problem. There is a post on reddit discussing this issue.https://www.reddit.com/r/StableDiffusion/comments/1agd5pz/a_recent_post_went_viral_claiming_that_the_vae_is/
So this could be a problem with the VAE itself, but I'm curious if there are any tricks in the code that can avoid this artifact? Or is there a way to fix the VAE in the SD15 series?

### Debug Logs

```powershell
No debug logs
```

### Other

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.