torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 28.87 GiB. GPU 0 has a total capacity of 8.00 GiB of which 3.68 GiB is free.
Currently enabled native sdp backends: ['flash', 'math', 'mem_efficient', 'cudnn'] Xformers is not installed! Flash Attn is not installed! Sage Attn is not installed! Namespace(share=False, server='127.0.0.1', port=None, inbrowser=True) Free VRAM 6.990234375 GB High-VRAM Mode: False Downloading shards: 100%|██████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 1002.58it/s] Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 8.18it/s] Fetching 3 files: 100%|████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 2961.38it/s] Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 26.39it/s] transformer.high_quality_fp32_output_for_inference = True
- Running on local URL: http://127.0.0.1:7860
To create a public link, set share=True in launch().
Unloaded DynamicSwap_LlamaModel as complete.
Unloaded CLIPTextModel as complete.
Unloaded SiglipVisionModel as complete.
Unloaded AutoencoderKLHunyuanVideo as complete.
Unloaded DynamicSwap_HunyuanVideoTransformer3DModelPacked as complete.
Loaded CLIPTextModel to cuda:0 as complete.
Unloaded CLIPTextModel as complete.
Loaded AutoencoderKLHunyuanVideo to cuda:0 as complete.
Unloaded AutoencoderKLHunyuanVideo as complete.
Loaded SiglipVisionModel to cuda:0 as complete.
latent_padding_size = 27, is_last_section = False
Unloaded SiglipVisionModel as complete.
Moving DynamicSwap_HunyuanVideoTransformer3DModelPacked to cuda:0 with preserved memory: 6 GB
0%| | 0/25 [00:18<?, ?it/s]
Traceback (most recent call last):
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\webui\demo_gradio.py", line 241, in worker
generated_latents = sample_hunyuan(
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\system\python\lib\site-packages\torch\\utils_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\webui\diffusers_helper\pipelines\k_diffusion_hunyuan.py", line 116, in sample_hunyuan
results = sample_unipc(k_model, latents, sigmas, extra_args=sampler_kwargs, disable=False, callback=callback)
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\webui\diffusers_helper\k_diffusion\\uni_pc_fm.py", line 141, in sample_unipc
return FlowMatchUniPC(model, extra_args=extra_args, variant=variant).sample(noise, sigmas=sigmas, callback=callback, disable_pbar=disable)
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\webui\diffusers_helper\k_diffusion\\uni_pc_fm.py", line 118, in sample
model_prev_list = [self.model_fn(x, vec_t)]
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\webui\diffusers_helper\k_diffusion\\uni_pc_fm.py", line 23, in model_fn
return self.model(x, t, **self.extra_args)
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\webui\diffusers_helper\k_diffusion\wrapper.py", line 37, in k_model
pred_positive = transformer(hidden_states=hidden_states, timestep=timestep, return_dict=False, **extra_args['positive'])[0].float()
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\system\python\lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\system\python\lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\webui\diffusers_helper\models\hunyuan_video_packed.py", line 976, in forward
hidden_states, encoder_hidden_states = self.gradient_checkpointing_method(
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\webui\diffusers_helper\models\hunyuan_video_packed.py", line 836, in gradient_checkpointing_method
result = block(*args)
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\system\python\lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\system\python\lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\webui\diffusers_helper\models\hunyuan_video_packed.py", line 656, in forward
attn_output, context_attn_output = self.attn(
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\system\python\lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\system\python\lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\system\python\lib\site-packages\diffusers\models\attention_processor.py", line 605, in forward
return self.processor(
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\webui\diffusers_helper\models\hunyuan_video_packed.py", line 176, in call
hidden_states = attn_varlen_func(query, key, value, cu_seqlens_q, cu_seqlens_kv, max_seqlen_q, max_seqlen_kv)
File "E:\framepack_cu126_torch26\framepack_cu126_torch26\webui\diffusers_helper\models\hunyuan_video_packed.py", line 122, in attn_varlen_func
x = torch.nn.functional.scaled_dot_product_attention(q.transpose(1, 2), k.transpose(1, 2), v.transpose(1, 2)).transpose(1, 2)
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 28.87 GiB. GPU 0 has a total capacity of 8.00 GiB of which 3.68 GiB is free. Of the allocated memory 2.78 GiB is allocated by PyTorch, and 513.54 MiB 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)
Unloaded DynamicSwap_LlamaModel as complete.
Unloaded CLIPTextModel as complete.
Unloaded SiglipVisionModel as complete.
Unloaded AutoencoderKLHunyuanVideo as complete.
Unloaded DynamicSwap_HunyuanVideoTransformer3DModelPacked as complete.
Source: lllyasviel/FramePack