Comfy-Org / Comfy-Org/ComfyUI

Shape mismatch in MiniMax H3 audio conditioning when combining video continuation ("OG Video Has Audio") with a standalone audio-timbre reference

Open
#16,289 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

When generating a MiniMax H3 video continuation using a source video with its own audio (continuation guide), combined with a separate standalone audio reference clip used for voice-timbre conditioning, generation fails with a tensor shape mismatch. Removing the standalone audio reference (keeping only the continuation) succeeds; removing the continuation (keeping only the standalone reference) also succeeds. The failure only occurs when both are present together.

Steps to reproduce:

Set up a MiniMax H3 Reference-to-Video generation with a continuation source: feed in an existing generated video (with its own audio track) as the continuation base, using a short overlap window (~24 frames / 1 second in my case).
Enable audio carry-over from that continuation source ("include this clip's audio" / equivalent toggle).
Additionally connect a separate, standalone audio clip as a voice-timbre reference ( tag), independent of the continuation video.
Queue the prompt.

Expected behavior: Generation proceeds normally, using the continuation audio for temporal carry-over and the standalone reference for voice timbre.

Actual behavior: Crashes during sampling with:

RuntimeError: shape mismatch: value tensor of shape [938, 32] cannot be broadcast to indexing result of shape [1010, 32]

Full traceback bottoms out at:

File "comfy/ldm/minimax/model.py", line 711, in _forward
all_audio_rows[~audio_update] = cond_audio_rows
RuntimeError: shape mismatch: value tensor of shape [938, 32] cannot be broadcast to indexing result of shape [1010, 32]

Analysis: audio_update appears to mark which audio-row positions are supplied by the continuation source; ~audio_update should then be filled from cond_audio_rows derived from the standalone audio reference. The row count encoded from the standalone reference (938) doesn't match the count of positions the mask expects to be filled (1010) — these two lengths appear to be computed independently and don't reconcile when both audio sources are present together.

This looks related to the class of bugs discussed in #15439 (where combining guides/keyframes with references caused PackedLayout to emit rows with mismatched/absent backing latents), but reproduces on current master (commit c75d8c966c29cb0392259af791f43373315b72db, 2026-09-12) after that PR merged, so appears to be a distinct, still-open case specific to the audio-only combination rather than the image/video-reference case that PR addressed.

Environment:

ComfyUI commit: c75d8c966c29cb0392259af791f43373315b72db (2026-09-12), branch master
Windows portable install (NVIDIA)
Relevant custom nodes present but not implicated in the crash itself (traceback bottoms out in core comfy/ldm/minimax/model.py)

**Full traceback:**

[INFO] Comfy model compiler graph breaks: 0, rogues: 10
[ERROR] !!! Exception during processing !!! shape mismatch: value tensor of shape [938, 32] cannot be broadcast to indexing result of shape [1010, 32]
[ERROR] Traceback (most recent call last):
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\execution.py", line 545, 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 "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-dapaoAPI\node_execution_gate.py", line 125, in get_output_data_waiting
result = await current(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\execution.py", line 344, 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 "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-lora-manager\py\metadata_collector\metadata_hook.py", line 177, in async_map_node_over_list_with_metadata
results = await original_map_node_over_list(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<2 lines>...
)
^
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\execution.py", line 318, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\execution.py", line 306, in process_inputs
result = f(**inputs)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy_api\internal\__init__.py", line 149, in wrapped_func
return method(locked_class, **inputs)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy_api\latest\_io.py", line 2046, in EXECUTE_NORMALIZED
to_return = cls.execute(*args, **kwargs)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy_extras\nodes_custom_sampler.py", line 1055, in execute
samples = guider.sample(noise.generate_noise(latent), latent_image, sampler, sigmas, denoise_mask=noise_mask, callback=callback, disable_pbar=disable_pbar, seed=noise.seed)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 1335, in sample
output = executor.execute(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed, latent_shapes=latent_shapes)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\patcher_extension.py", line 113, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 1262, in outer_sample
output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed, latent_shapes=latent_shapes)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 1237, in inner_sample
samples = executor.execute(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\patcher_extension.py", line 113, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-yaser-nodes\nodes\tiling_utils.py", line 34, in KSAMPLER_sample
return orig_fn(*args, **kwargs)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 1005, in sample
samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\_contextlib.py", line 124, in decorate_context
return func(*args, **kwargs)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\k_diffusion\sampling.py", line 1619, in sample_er_sde
denoised = model(x, sigmas[i] * s_in, **extra_args)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 640, in __call__
out = self.inner_model(x, sigma, model_options=model_options, seed=seed)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 1208, in __call__
return self.outer_predict_noise(*args, **kwargs)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 1215, in outer_predict_noise
).execute(x, timestep, model_options, seed)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\patcher_extension.py", line 113, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 1218, 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 "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 620, in sampling_function
out = calc_cond_batch(model, conds, x, timestep, model_options)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 211, in calc_cond_batch
return _calc_cond_batch_outer(model, conds, x_in, timestep, model_options)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 219, in _calc_cond_batch_outer
return executor.execute(model, conds, x_in, timestep, model_options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\patcher_extension.py", line 113, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 335, in _calc_cond_batch
output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\model_base.py", line 209, 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 "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\patcher_extension.py", line 113, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\model_base.py", line 253, in _apply_model
model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1778, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1789, in _call_impl
return forward_call(*args, **kwargs)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\ldm\minimax\model.py", line 577, in forward
graph_out = comfy.patcher_extension.WrapperExecutor.new_class_executor(
...<2 lines>...
comfy.patcher_extension.get_all_wrappers(comfy.patcher_extension.WrappersMP.DIFFUSION_MODEL, transformer_options)
).execute(x, timestep, context, transformer_options, minimax_payload=minimax_payload,
denoise_mask=denoise_mask, audio_denoise_mask=audio_denoise_mask, **kwargs)
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\patcher_extension.py", line 113, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "G:\Users\Laszlo\Documents\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\ldm\minimax\model.py", line 711, in _forward
all_audio_rows[~audio_update] = cond_audio_rows
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
RuntimeError: shape mismatch: value tensor of shape [938, 32] cannot be broadcast to indexing result of shape [1010, 32]

Contributor guide

Open the contributing guide

Research direction

Start in comfy/ldm/minimax/model.py at _forward around line 711, then reproduce the MiniMax H3 continuation-plus-standalone-audio workflow described in the issue. Trace how audio_update and cond_audio_rows are sized for both sources; done means the combined case no longer raises the reported shape mismatch and generation proceeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
ai, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.