ComfyUI_ExtraModels icon indicating copy to clipboard operation
ComfyUI_ExtraModels copied to clipboard

About No VAE weights detected, VAE not initalized.

Open polop08 opened this issue 1 year ago • 3 comments

Thank you for your work. I've followed the steps in README to try to download PIXART and use ComfyUI to demo it. However, after downloading all the necessary files and press the Queue botton, I got this error message.

╭─polop@cluster-MS-7D07 11:27:49 ~/comfy/ComfyUI:master ╰─$ python main.py Total VRAM 24268 MB, total RAM 128708 MB WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.3.0+cu121 with CUDA 1201 (you have 1.13.1+cu116) Python 3.10.14 (you have 3.10.11) Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers) Memory-efficient attention, SwiGLU, sparse and more won't be available. Set XFORMERS_MORE_DETAILS=1 for more details Set vram state to: NORMAL_VRAM╭─polop@cluster-MS-7D07 11:27:49 ~/comfy/ComfyUI:master ╰─$ python main.py Total VRAM 24268 MB, total RAM 128708 MB WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.3.0+cu121 with CUDA 1201 (you have 1.13.1+cu116) Python 3.10.14 (you have 3.10.11) Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers) Memory-efficient attention, SwiGLU, sparse and more won't be available. Set XFORMERS_MORE_DETAILS=1 for more details Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 3090 : VAE dtype: torch.float32 Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention Torch version too old for FP8

Import times for custom nodes: 0.0 seconds: /home/polop/comfy/ComfyUI/custom_nodes/ComfyUI_ExtraModels

Starting server

To see the GUI go to: http://127.0.0.1:8188 got prompt model_type EPS

######################################## PixArt: Not using xformers! Expect images to be non-deterministic! Batch sizes > 1 are most likely broken ########################################

Loading T5 from '/home/polop/comfy/ComfyUI/models/t5/t5-v1_1-xxl' Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:11<00:00, 5.76s/it] You are using the default legacy behaviour of the <class 'transformers.models.t5.tokenization_t5.T5Tokenizer'>. This is expected, and simply means that the legacy (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set legacy=False. This should only be set if you understand what it means, and thoroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565 WARNING: No VAE weights detected, VAE not initalized. !!! Exception during processing!!! 'VAE' object has no attribute 'vae_dtype' Traceback (most recent call last): File "/home/polop/comfy/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/home/polop/comfy/ComfyUI/execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "/home/polop/comfy/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "/home/polop/comfy/ComfyUI/nodes.py", line 294, in encode t = vae.encode(pixels[:,:,:,:3]) File "/home/polop/comfy/ComfyUI/comfy/sd.py", line 320, in encode memory_used = self.memory_used_encode(pixel_samples.shape, self.vae_dtype) AttributeError: 'VAE' object has no attribute 'vae_dtype'

Prompt executed in 21.43 seconds Device: cuda:0 NVIDIA GeForce RTX 3090 : VAE dtype: torch.float32 Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention Torch version too old for FP8

Import times for custom nodes: 0.0 seconds: /home/polop/comfy/ComfyUI/custom_nodes/ComfyUI_ExtraModels

Starting server

To see the GUI go to: http://127.0.0.1:8188 got prompt model_type EPS

######################################## PixArt: Not using xformers! Expect images to be non-deterministic! Batch sizes > 1 are most likely broken ########################################

Loading T5 from '/home/polop/comfy/ComfyUI/models/t5/t5-v1_1-xxl' Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:11<00:00, 5.76s/it] You are using the default legacy behaviour of the <class 'transformers.models.t5.tokenization_t5.T5Tokenizer'>. This is expected, and simply means that the legacy (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set legacy=False. This should only be set if you understand what it means, and thoroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565 WARNING: No VAE weights detected, VAE not initalized. !!! Exception during processing!!! 'VAE' object has no attribute 'vae_dtype' Traceback (most recent call last): File "/home/polop/comfy/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/home/polop/comfy/ComfyUI/execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "/home/polop/comfy/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "/home/polop/comfy/ComfyUI/nodes.py", line 294, in encode t = vae.encode(pixels[:,:,:,:3]) File "/home/polop/comfy/ComfyUI/comfy/sd.py", line 320, in encode memory_used = self.memory_used_encode(pixel_samples.shape, self.vae_dtype) AttributeError: 'VAE' object has no attribute 'vae_dtype'

Prompt executed in 21.43 seconds

may i ask what could probably cause this and how to fix it? Thank you for your time and hard work.

polop08 avatar Apr 30 '24 03:04 polop08

That error doesn't seem to be caused by the code in this repo I don't think? The warning that seems noteworthy is defined here and has to do with the VAE not being loaded.

Maybe the file you're using got corrupted somehow? Which VAE is that? You could test it with something like this (image below) to see if it still fails with none of the custom nodes in the workflow. Also, for PixArt, you can use any SD v1.5 (PixArt Alpha) or SDXL (PixArt Sigma) VAE if you already have them.

image

Also, just a small note, this warning kinda sticks out:

WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
PyTorch 2.3.0+cu121 with CUDA 1201 (you have 1.13.1+cu116)

That pytorch version is ancient and not many things are tested on 1.X anymore, so I'd upgrade if you don't have a strong reason for sticking with it.

city96 avatar Apr 30 '24 13:04 city96

Thank you for your reply I use VAE SD v1.5 for PixArt Alpha and try to test the VAE with the same setting as you did.

123

still I got the exact same error message. I couldn't get what you mean by the file is "corrupted". I simply use

git clone https://huggingface.co/mrsteyk/consistency-decoder-sd15

to download the file inside the ComfyUI/models/vae directory. I understand that the pytorch version is too old and that is due to the fact that cuda version is too old so that i can't use latest version of pytorch. Thank you for your suggestion. But still, is this error related to the pytorch version? or i did something wrong when downloading vae file. Thank you for your help and hardwork.

polop08 avatar May 01 '24 14:05 polop08

Ah, you're also using the consistency decoder. I would recommend with sticking to the regular VAE found here for 1.5 models.

The consistency decoder is supported by this node pack, but requires the "ExtraVAELoader" node to load. The quality improvement is not worth the speed/VRAM requirements it needs, so the normal 1.5 VAE I linked above is preferrable.

image

city96 avatar May 01 '24 17:05 city96