comfyui

Seedvr2 3b- files fail "to load VideoAutoencoderKLWrapper", causing value error

#6
by GlamoramaAttack - opened

I'm using the default workflow for SeedVR2 upscale - I've tried both int8_convrot models, 3b and 7b. With 7b everything works fine, no problems at all.

The SeedVR2_3B int8_convrot model ( https://huggingface.co/Comfy-Org/SeedVR2/blob/main/diffusion_models/seedvr2_3b_int8_convrot.safetensors ) fails during sampling with the following error:
ValueError: not enough values to unpack (expected 4, got 3) in comfy_kitchen/backends/triton/rope.py
The SeedVR2_3B int8_convrot model does not log "Requested to load VideoAutoencoderKLWrapper" and fails during KSampler execution (after preprocessing and conditioning succeed).

I haven't changed anything in the workflow, the image to upscale for 3b is the same as for 7b.

Hypothesis:

The SeedVR2_3B model is missing the VideoAutoencoderKLWrapper initialization, which is required for correct tensor dimensions in the RoPE calculation (apply_rope1).
This could be due to:
Incorrect model configuration (e.g., config.json does not specify VAE loading).
Bug in ComfyUI’s SeedVR2 node (fails to detect/load VAE for 3B).

The model seedvr2_3b_fp8_e4m3fn.safetensors fails also.

This is the log for 7b up to the point where 3b failed:

[INFO] got prompt
[INFO] Requested to load VideoAutoencoderKLWrapper
[INFO] 0 models unloaded.
[INFO] loaded completely; 478.07 MB loaded, full load: True
[INFO] Found quantization metadata version 1
[INFO] Detected mixed precision quantization
[INFO] Using mixed precision operations
[INFO] Native ops: int8_tensorwise, convrot_w4a4 , emulated ops: mxfp8, float8_e4m3fn, float8_e5m2, nvfp4
[INFO] model weight dtype torch.bfloat16, manual cast: torch.bfloat16
[INFO] model_type FLOW
[INFO] Requested to load SeedVR2
[INFO] 0 models unloaded.
[INFO] Model SeedVR2 prepared for dynamic VRAM loading. 7944MB Staged. 0 patches attached. Force pre-loaded 576 weights: 3853 KB.
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [03:31<00:00, 211.45s/it, Model Initialization complete! ]
[INFO] Requested to load VideoAutoencoderKLWrapper

For the 3b model the part about "Requested to load VideoAutoencoderKLWrapper" is missing, this is the log for 3b:

[INFO] got prompt
[INFO] Found quantization metadata version 1
[INFO] Detected mixed precision quantization
[INFO] Using mixed precision operations
[INFO] Native ops: int8_tensorwise, convrot_w4a4 , emulated ops: mxfp8, float8_e4m3fn, float8_e5m2, nvfp4
[INFO] model weight dtype torch.bfloat16, manual cast: torch.bfloat16
[INFO] model_type FLOW
[INFO] Requested to load SeedVR2
[INFO] Model SeedVR2 prepared for dynamic VRAM loading. 3295MB Staged. 0 patches attached. Force pre-loaded 339 weights: 2522 KB.
0%| | 0/1 [00:00<?, ?it/s, Model Initializing ... ]

[ERROR] !!! Exception during processing !!! not enough values to unpack (expected 4, got 3)
[ERROR] Traceback (most recent call last):
File "D:\ComfyUI\execution.py", line 543, 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, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\execution.py", line 342, 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, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\execution.py", line 316, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "D:\ComfyUI\execution.py", line 304, in process_inputs
result = f(**inputs)
File "D:\ComfyUI\nodes.py", line 1607, in sample
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
File "D:\ComfyUI\nodes.py", line 1571, 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 "D:\ComfyUI\comfy\sample.py", line 74, 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 "D:\ComfyUI\comfy\samplers.py", line 1444, 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 "D:\ComfyUI\comfy\samplers.py", line 1334, in sample
return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy\samplers.py", line 1316, in sample
output = executor.execute(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed, latent_shapes=latent_shapes)
File "D:\ComfyUI\comfy\patcher_extension.py", line 113, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy\samplers.py", line 1254, in outer_sample
output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed, latent_shapes=latent_shapes)
File "D:\ComfyUI\comfy\samplers.py", line 1229, in inner_sample
samples = executor.execute(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
File "D:\ComfyUI\comfy\patcher_extension.py", line 113, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy\samplers.py", line 999, in sample
samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
File "D:\ComfyUI\venv\Lib\site-packages\torch\utils_contextlib.py", line 124, in decorate_context
return func(*args, **kwargs)
File "D:\ComfyUI\comfy\k_diffusion\sampling.py", line 205, in sample_euler
denoised = model(x, sigma_hat * s_in, **extra_args)
File "D:\ComfyUI\comfy\samplers.py", line 639, in call
out = self.inner_model(x, sigma, model_options=model_options, seed=seed)
File "D:\ComfyUI\comfy\samplers.py", line 1202, in call
return self.outer_predict_noise(*args, **kwargs)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy\samplers.py", line 1209, in outer_predict_noise
).execute(x, timestep, model_options, seed)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy\patcher_extension.py", line 113, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy\samplers.py", line 1212, 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 "D:\ComfyUI\comfy\samplers.py", line 619, in sampling_function
out = calc_cond_batch(model, conds, x, timestep, model_options)
File "D:\ComfyUI\comfy\samplers.py", line 210, in calc_cond_batch
return _calc_cond_batch_outer(model, conds, x_in, timestep, model_options)
File "D:\ComfyUI\comfy\samplers.py", line 218, in _calc_cond_batch_outer
return executor.execute(model, conds, x_in, timestep, model_options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy\patcher_extension.py", line 113, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy\samplers.py", line 334, in calc_cond_batch
output = model.apply_model(input_x, timestep
, **c).chunk(batch_chunks)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy\model_base.py", line 192, 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 "D:\ComfyUI\comfy\patcher_extension.py", line 113, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy\model_base.py", line 236, in _apply_model
model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds)
File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1776, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1787, in _call_impl
return forward_call(*args, **kwargs)
File "D:\ComfyUI\comfy\ldm\seedvr\model.py", line 1336, in forward
vid, txt, vid_shape, txt_shape = block(
~~~~~^
vid=vid,
^^^^^^^^
...<4 lines>...
cache=cache,
^^^^^^^^^^^^
)
^
File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1776, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1787, in _call_impl
return forward_call(*args, **kwargs)
File "D:\ComfyUI\comfy\ldm\seedvr\model.py", line 861, in forward
vid_attn, txt_attn = self.attn(vid_attn, txt_attn, vid_shape, txt_shape, cache)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1776, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1787, in _call_impl
return forward_call(*args, **kwargs)
File "D:\ComfyUI\comfy\ldm\seedvr\model.py", line 672, in forward
vid_q, vid_k, txt_q, txt_k = self.rope(
~~~~~~~~~^
vid_q, vid_k, window_shape, txt_q_repeat, txt_k_repeat, txt_shape_repeat, cache_win
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1776, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1787, in _call_impl
return forward_call(*args, **kwargs)
File "D:\ComfyUI\comfy\ldm\seedvr\model.py", line 411, in forward
vid_q = _apply_rope1_partial(vid_q, vid_freqs)
File "D:\ComfyUI\comfy\ldm\seedvr\model.py", line 377, in apply_rope1_partial
out[..., start:end, :rot_d] = apply_rope1(out[..., start:end, :rot_d], freqs_chunk).to(out.dtype)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy\ldm\flux\math.py", line 58, in apply_rope1
return comfy.quant_ops.ck.apply_rope1(x, freqs_cis)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "D:\ComfyUI\venv\Lib\site-packages\comfy_kitchen_init
.py", line 516, in apply_rope1
return torch.ops.comfy_kitchen.apply_rope1(x, freqs_cis)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "D:\ComfyUI\venv\Lib\site-packages\torch_ops.py", line 1209, in call
return self._op(*args, **kwargs)
~~~~~~~~^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\venv\Lib\site-packages\torch_library\custom_ops.py", line 347, in backend_impl
result = self._backend_fns[device_type](*args, **kwargs)
File "D:\ComfyUI\venv\Lib\site-packages\torch_compile.py", line 54, in inner
return disable_fn(*args, **kwargs)
File "D:\ComfyUI\venv\Lib\site-packages\torch_dynamo\eval_frame.py", line 1181, in _fn
return fn(*args, **kwargs)
File "D:\ComfyUI\venv\Lib\site-packages\torch_library\custom_ops.py", line 382, in wrapped_fn
return fn(*args, **kwargs)
File "D:\ComfyUI\venv\Lib\site-packages\comfy_kitchen\backends\eager\rope.py", line 243, in _op_apply_rope1
return impl(**kwargs)
File "D:\ComfyUI\venv\Lib\site-packages\comfy_kitchen\backends\triton\rope.py", line 223, in apply_rope1
x_out, _ = _apply_rope(x, freqs_cis)
~~~~~~~~~~~^^^^^^^^^^^^^^
File "D:\ComfyUI\venv\Lib\site-packages\comfy_kitchen\backends\triton\rope.py", line 147, in _apply_rope
batch, dim1, dim2, head_dim = x1.shape
^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 4, got 3)

GlamoramaAttack changed discussion title from Seedvr2 3b int8 convrot- file fails "to load VideoAutoencoderKLWrapper", causing value error to Seedvr2 3b- files fail "to load VideoAutoencoderKLWrapper", causing value error

Sign up or log in to comment