Error after updating new nodes for LTX-2
Error after updating new nodes for LTX-2. Attched my workflow.
!!! Exception during processing !!! Tensors must have same number of dimensions: got 4 and 3
Traceback (most recent call last):
File "D:\ComfyUI\execution.py", line 524, 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 333, 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 307, in async_map_node_over_list
await process_inputs(input_dict, i)
File "D:\ComfyUI\execution.py", line 295, in process_inputs
result = f(**inputs)
^^^^^^^^^^^
File "D:\ComfyUI\comfy_api\internal_init.py", line 149, in wrapped_func
return method(locked_class, **inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy_api\latest_io.py", line 1748, in EXECUTE_NORMALIZED
to_return = cls.execute(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\custom_nodes\comfyui-kjnodes\nodes\ltxv_nodes.py", line 478, in execute
context_video = diffusion_model.preprocess_text_embeds(context_video.to(device=device, dtype=dtype))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy\ldm\lightricks\av_model.py", line 473, in preprocess_text_embeds
out_vid = self.video_embeddings_connector(context)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\anaconda3\envs\comfyui_env\Lib\site-packages\torch\nn\modules\module.py", line 1775, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\anaconda3\envs\comfyui_env\Lib\site-packages\torch\nn\modules\module.py", line 1786, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\comfy\ldm\lightricks\embeddings_connector.py", line 280, in forward
hidden_states = torch.cat((hidden_states, learnable_registers[hidden_states.shape[1]:].unsqueeze(0).repeat(hidden_states.shape[0], 1, 1)), dim=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Tensors must have same number of dimensions: got 4 and 3
I have the same issue, can't seem to resolve it.
What happens if you use a Dual Clip loader with both Gemma and the embedding (again) ?
Think i had this error if not adding it both places, if i remember right
(and a bit odd, if it still has to be there, since Comfy made changes to have the embedding at the model loader.. . but maybe more changes might come.)
i updated comfy now and kijai nodes, and reverted to the dual cliploader and it works.
For clarity, beyond what's explained on the front page readme:
The embedding connector model also includes text_embedding_projection.aggregate_embed.weight which is still needed by the text encoder model, hence the continued need to use the dual clip loader. This does not mean it loads the weights twice or uses more memory, because the text encoder model no longer has the connector layers, they are just not loaded into it. Instead they are loaded into the diffusion model (where they more naturally belong, one of the reasons for the change).
Since originally everything is loaded from a single checkpoint, there's no changes needed when using that, but it does somewhat complicate using the single files, though no functionality should change.
I wondered whether this issue related to this recent PR 🤔 https://github.com/Comfy-Org/ComfyUI/pull/12605
This will eventually be removed again which will break many workflows that don't use the official LTXAV (LTX 2.0) files.
If you use the official LTXV files you are good. If you use non official files please migrate.
Yes its related to some recent changes: https://github.com/Comfy-Org/ComfyUI/commit/f266b8d352607799afb4adf339cdfa854025185e
Although it looks like its might temporary "fixed" https://github.com/Comfy-Org/ComfyUI/pull/12605 for a while (to be a less 'drastic' immediate change i suppose)
But sooner or later, basically just need to change the model loaders as Kijai described on the front page https://huggingface.co/Kijai/LTXV2_comfy
