feat: load LTX-2.3 connector weights from GGUF on Apple Silicon#431
Open
Samir Hassen (samirhassen) wants to merge 2 commits intoLightricks:masterfrom
Open
feat: load LTX-2.3 connector weights from GGUF on Apple Silicon#431Samir Hassen (samirhassen) wants to merge 2 commits intoLightricks:masterfrom
Samir Hassen (samirhassen) wants to merge 2 commits intoLightricks:masterfrom
Conversation
- Load video/audio embeddings connector weights directly from GGUF - Auto-find proj_linear.safetensors for text_embedding_projection - Fix RoPE spacing (exp_2) for connectors with inner_dim != 3840 - Set is_av correctly for AV model to output 6144-dim conditioning - Add audio_connector_attention_head_dim config for proper 2048-dim audio connector
- Replace all print()/DEBUG statements with proper logger calls - Move stdlib imports (glob, importlib.util, logging, os) to module level - Move folder_paths import to module level in text_embeddings_connectors - Add logger = logging.getLogger(__name__) to text_embeddings_connectors - Fix comment typo in gemma_encoder.py (bytesed → bytes) - embeddings_connector.py had no debug statements (no changes needed) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables LTXVGemmaCLIPModelLoader to load LTX-2.3 (22B AV) connector weights directly from a GGUF checkpoint on Apple Silicon, with no separate safetensors extraction step required. Tested on M4 Max (36 GB) with the Q4_K_S GGUF (~16 GB).
Motivation
The existing loader only supports safetensors checkpoints. On Apple Silicon, the primary distribution format for large models is GGUF (via llama.cpp-style quantisation). The connector and projection weights are embedded in the same GGUF file as the diffusion model, so users shouldn't need to unpack or convert anything manually.
Changes
text_embeddings_connectors.py
embeddings_connector.py
gemma_encoder.py
Why is_av must remain enabled
preprocess_text_embeds in the LTXAV transformer checks whether the embedding dimension is cross_attention_dim + audio_cross_attention_dim (4096 + 2048 = 6144) to decide whether it has already been processed. If is_av=False, only the video connector runs and the output is 4096-dim — the transformer then double-processes it and produces garbage. The is_av flag is correctly detected from the presence of audio_adaln_single.linear.weight in the state dict.
Testing
Ran full text-to-video inference in ComfyUI on Mac Studio M4 Max (36 GB) with ltx-video-2b-v0.9.5-distilled.gguf (Q4_K_S).
Video output via VHS_VideoCombine node confirmed correct (motion, coherence, no artefacts from mis-sized embeddings).
Known limitations
transformer_config for LTX-2.3 is hardcoded rather than read from GGUF metadata (the metadata does not contain it). If Lightricks releases a new architecture variant, this will need updating.
The dequantisation fallback for non-float types depends on ComfyUI-GGUF being present alongside this plugin.