Latent upscale causes black image on some resolutions
Using a base resolution of 576x960, going with ~1.5x latent upscale (to 896x1472) is possible
However, trying to do ~2x latent upscale (1152x1920) just causes a black image to be output by the upscaler
Here is my pip freeze https://pastebin.com/kZvQpFYH
I'm using a 4090 wth a Ryzen 7 5800x with 40gb of ram. I'm not running out of vram or ram either.
Is this a one off bug or something you are constantly able to reproduce even after restarting the backend?
It is consistent, I haven't been able to do certain resolutions since I installed it. It seems to be about image area rather than any specific resolution (maybe somehow related to a pillow decompression bomb protection?)
I can confirm that I'm getting this issue as well with a 4090. At first I thought it was specific VAE causing it, but after seeing this it's actually changing resolutions that is producing this issue, similar to what sALTaccount said.
Can you test if the VAEDecodeTiled node in the _for_testing also gives you black images so that I can know if the problem is because of the VAE decoding or because of something else.
yup it does appear to be VAE related, tiled VAE works just fine
no vram spikes or anything though and no error messages
Black images from decoding is usually actually because VRAM hit a limit and the tensor zeroed out. This is a problem with diffusers, a1111, etc,
This is a problem related to xformers 0.0.18, downgrading to 0.0.17 will fix it. I have filed an issue with xformers so they can fix it: https://github.com/facebookresearch/xformers/issues/719
Damn, was trying to avoid having to compile xformers for the 5483th time 😢 thanks for looking into this. I'll close the issue as its upstream
Although maybe a warning should be added if xformers 0.0.18 is detected 🤔 . I also think I remember seeing something like this before with auto and it was solved by upcasting attention to fp32 (i think?), when I'm home i'll experiment with it
ComfyUI runs the VAE in full precision. I just disabled xformers in the VAE for 0.0.18 so it will use the split optimization instead which is slower but will actually work. https://github.com/comfyanonymous/ComfyUI/commit/e46b1c3034a23eeb048e279d0d285737d39a4b1a
FYI, I don't use xformers in WebUI, or Diffusers, and it still happens if VRAM hits the ceiling. I do use xformers in comfyui though as I try to keep settings absolutely vanilla while developing.
I'm getting this issue on the latest commit, which is f84f250

How did you install comfyUI and which xformers version do you have exactly?
I used git clone on the repo in WSL, installed the requirements using pip install -r requirements, and am running it using python main.py. According to A1111 WebUI, I'm using xformers 0.0.14.dev
I used
git cloneon the repo in WSL, installed the requirements usingpip install -r requirements, and am running it usingpython main.py. According to A1111 WebUI, I'm using xformers 0.0.14.dev
Are you running within WebUI? WebUI holds on to models and other stuff into VRAM which leaves very little for ComfyUI. I actually haven't used A1111 except to train, cause I can make significantly larger images in ComfyUI due to much better memory management.
I used
git cloneon the repo in WSL, installed the requirements usingpip install -r requirements, and am running it usingpython main.py. According to A1111 WebUI, I'm using xformers 0.0.14.devAre you running within WebUI? WebUI holds on to models and other stuff into VRAM which leaves very little for ComfyUI. I actually haven't used A1111 except to train, cause I can make significantly larger images in ComfyUI due to much better memory management.
I'm not exactly sure, but I'm running ComfyUI separately from WebUI
Installing xformers 0.0.17 solved black images issue for me.
ComfyUI and A1111 probably use different Python environment, so the version info from A1111 is unreliable.
To know which version of xformers you have, go to where you deployed ComfyUI and look into the folder python_embeded\Lib\site-packages\. If there's a folder named xformers-0.0.18.dist-info, then you have xformers 0.0.18 installed.
To downgrade to xformers 0.0.17, open a command prompt where you deploy ComfyUI and run this
python_embeded\python.exe -s -m pip install xformers==0.0.17
This should uninstall whichever xformers you have and install 0.0.17.
Obviously this is for Windows, but if you're using Linux, chances are you already know what to do already.
The latest ComfyUI prints your xformers version on startup along with a warning if it's 0.0.18