-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Open
Labels
Potential BugUser is reporting a bug. This should be tested.User is reporting a bug. This should be tested.bug-cop:answeredbug-cop:taking-a-look
Description
Custom Node Testing
- I have tried disabling custom nodes and the issue persists (see how to disable custom nodes if you need help)
Expected Behavior
Honestly, every single person claims this model should work fine with 24GB+ VRAM.
Each time I want to use it, it tries to take over 100GB VRAM. For a video 640x640 61 length.
Any ideas why?!
Using:
- ComfyUI v0.3.51
- Torch 2.9.0a0+rocm7.0.0rc20250821
- Torchvision 0.24.0a0+rocm7.0.0rc20250821
- Ryzen AI Max+ 395, allocated 122GB VRAM
- Parameters: --preview-method auto --use-pytorch-cross-attention
- Using --highvram doesn't make any difference
Actual Behavior
According to many sources, a video like that should take less than 20GB VRAM
Steps to Reproduce
Open ComfyUI
Load Templates
Pick WAN 2.2 14B Text to Video
Reduce length, just in case.
Try
Debug Logs
[ComfyUI-Manager] All startup tasks have been completed.
got prompt
Requested to load WAN21
loaded completely 9.5367431640625e+25 13627.512924194336 True
0%| | 0/2 [00:03<?, ?it/s]
!!! Exception during processing !!! HIP out of memory. Tried to allocate 48.83 GiB. GPU 0 has a total capacity of 120.00 GiB of which 33.29 GiB is free. Of the allocated memory 77.16 GiB is allocated by PyTorch, and 3.16 GiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)
Traceback (most recent call last):
File "/home/waltercool/ComfyUI/execution.py", line 496, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/execution.py", line 315, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/execution.py", line 289, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "/home/waltercool/ComfyUI/execution.py", line 277, in process_inputs
result = f(**inputs)
File "/home/waltercool/ComfyUI/nodes.py", line 1555, in sample
return common_ksampler(model, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise, disable_noise=disable_noise, start_step=start_at_step, last_step=end_at_step, force_full_denoise=force_full_denoise)
File "/home/waltercool/ComfyUI/nodes.py", line 1488, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
denoise=denoise, disable_noise=disable_noise, start_step=start_step, last_step=last_step,
force_full_denoise=force_full_denoise, noise_mask=noise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
File "/home/waltercool/ComfyUI/comfy/sample.py", line 45, in sample
samples = sampler.sample(noise, positive, negative, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
File "/home/waltercool/ComfyUI/comfy/samplers.py", line 1150, in sample
return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
File "/home/waltercool/ComfyUI/comfy/samplers.py", line 1040, in sample
return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/comfy/samplers.py", line 1025, in sample
output = executor.execute(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
File "/home/waltercool/ComfyUI/comfy/patcher_extension.py", line 111, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/comfy/samplers.py", line 993, in outer_sample
output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
File "/home/waltercool/ComfyUI/comfy/samplers.py", line 976, in inner_sample
samples = executor.execute(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
File "/home/waltercool/ComfyUI/comfy/patcher_extension.py", line 111, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/comfy/samplers.py", line 755, in sample
samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
File "/home/waltercool/ComfyUI/venv/lib/python3.13/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context
return func(*args, **kwargs)
File "/home/waltercool/ComfyUI/comfy/k_diffusion/sampling.py", line 190, in sample_euler
denoised = model(x, sigma_hat * s_in, **extra_args)
File "/home/waltercool/ComfyUI/comfy/samplers.py", line 407, in __call__
out = self.inner_model(x, sigma, model_options=model_options, seed=seed)
File "/home/waltercool/ComfyUI/comfy/samplers.py", line 956, in __call__
return self.predict_noise(*args, **kwargs)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/comfy/samplers.py", line 959, in predict_noise
return sampling_function(self.inner_model, x, timestep, self.conds.get("negative", None), self.conds.get("positive", None), self.cfg, model_options=model_options, seed=seed)
File "/home/waltercool/ComfyUI/comfy/samplers.py", line 387, in sampling_function
out = calc_cond_batch(model, conds, x, timestep, model_options)
File "/home/waltercool/ComfyUI/comfy/samplers.py", line 205, in calc_cond_batch
return _calc_cond_batch_outer(model, conds, x_in, timestep, model_options)
File "/home/waltercool/ComfyUI/comfy/samplers.py", line 213, in _calc_cond_batch_outer
return executor.execute(model, conds, x_in, timestep, model_options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/comfy/patcher_extension.py", line 111, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/comfy/samplers.py", line 332, in _calc_cond_batch
output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/comfy/model_base.py", line 155, in apply_model
return comfy.patcher_extension.WrapperExecutor.new_class_executor(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...<2 lines>...
comfy.patcher_extension.get_all_wrappers(comfy.patcher_extension.WrappersMP.APPLY_MODEL, transformer_options)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
).execute(x, t, c_concat, c_crossattn, control, transformer_options, **kwargs)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/comfy/patcher_extension.py", line 111, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/comfy/model_base.py", line 194, in _apply_model
model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/venv/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/venv/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
File "/home/waltercool/ComfyUI/comfy/ldm/wan/model.py", line 599, in forward
return self.forward_orig(x, timestep, context, clip_fea=clip_fea, freqs=freqs, transformer_options=transformer_options, **kwargs)[:, :, :t, :h, :w]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/comfy/ldm/wan/model.py", line 563, in forward_orig
x = block(x, e=e0, freqs=freqs, context=context, context_img_len=context_img_len)
File "/home/waltercool/ComfyUI/venv/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/venv/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
File "/home/waltercool/ComfyUI/comfy/ldm/wan/model.py", line 221, in forward
y = self.self_attn(
self.norm1(x) * (1 + repeat_e(e[1], x)) + repeat_e(e[0], x),
freqs)
File "/home/waltercool/ComfyUI/venv/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/waltercool/ComfyUI/venv/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
File "/home/waltercool/ComfyUI/comfy/ldm/wan/model.py", line 72, in forward
x = optimized_attention(
q.view(b, s, n * d),
...<2 lines>...
heads=self.num_heads,
)
File "/home/waltercool/ComfyUI/comfy/ldm/modules/attention.py", line 451, in attention_pytorch
out = comfy.ops.scaled_dot_product_attention(q, k, v, attn_mask=mask, dropout_p=0.0, is_causal=False)
File "/home/waltercool/ComfyUI/comfy/ops.py", line 47, in scaled_dot_product_attention
return torch.nn.functional.scaled_dot_product_attention(q, k, v, *args, **kwargs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
torch.OutOfMemoryError: HIP out of memory. Tried to allocate 48.83 GiB. GPU 0 has a total capacity of 120.00 GiB of which 33.29 GiB is free. Of the allocated memory 77.16 GiB is allocated by PyTorch, and 3.16 GiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)
Got an OOM, unloading all loaded models.
Prompt executed in 16.75 seconds
Other
No response
Metadata
Metadata
Assignees
Labels
Potential BugUser is reporting a bug. This should be tested.User is reporting a bug. This should be tested.bug-cop:answeredbug-cop:taking-a-look