LTXV Q8 Patcher doesn't work with the public q8_kernels (missing `patch_comfyui_native_avtransformer`, old signature, old RoPE format)

Aperta
#584 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
43/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
ai, backend

Direzione di ricerca

Start by reading q8_nodes.py and comparing its imports and patcher call with the public q8_kernels 0.0.5 API described in the issue. Then inspect q8_kernels/integration/comfyui_native.py around lines 145–150 and ComfyUI’s LTXV RoPE format in comfy/ldm/lightricks/model.py. Done means the node works with the stated public package and current RoPE format; the issue does not name tests to run.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The "LTXV Q8 Patcher" node (q8_nodes.py) can't be used with the q8_kernels version that the node's error message points to (https://github.com/Lightricks/LTX-Video-Q8-Kernels, master f3066ed, version 0.0.5). With ComfyUI-LTXVideo 220e1d4 and ComfyUI 7ef8178 there are three separate problems:

  1. Import. q8_nodes.py imports patch_comfyui_native_avtransformer from q8_kernels.integration.patch_transformer (added in the 2026-03-06 sync). That function doesn't exist in the public q8_kernels:

    ImportError: cannot import name 'patch_comfyui_native_avtransformer' from 'q8_kernels.integration.patch_transformer'
    

    The except ImportError sets Q8_AVAILABLE = False, so the node says "Q8 kernels are not available" even when q8_kernels is installed.

  2. Signature. For q8_kernels < 0.1.5 the node calls patch_comfyui_native_transformer(transformer, use_fp8_attention, True, quantize_self_attn, quantize_cross_attn, quantize_ffn). The public version is patch_comfyui_native_transformer(transformer, use_fp8_attention=False, transform_weights=True), so this raises TypeError (too many positional arguments). LTX-Video-Q8-Kernels#12 reported an earlier mismatch of the same kind.

  3. RoPE format. Since ComfyUI #15056 (2026-07-24), LTXV attention receives pe = (rotation_matrix, split_pe), where rotation_matrix is [B, T, heads, head_dim/2, 2, 2] (freqs_cis_matrix in comfy/ldm/lightricks/model.py). q8_kernels' patched attention (q8_kernels/integration/comfyui_native.py:145-150) still assumes pe = (cos, sin) and calls rms_norm_rope(q, pe[0], pe[1], ...). That passes the 6-D rotation matrix as cos_freqs and the split_pe bool as sin_freqs. (#532 handled this core change for the embeddings connector only.)

The node looks like it was written against a newer q8_kernels (>= 0.1.5) that hasn't been published. Could you publish that version (or its source), or document which q8_kernels the node requires? If 0.0.5 is meant to keep working, problems 1 and 2 need the import to be optional and the old call signature on the < 0.1.5 path, and problem 3 needs a fix in q8_kernels.

For reference, here is what worked for problem 3 in a local port (interleaved RoPE, LTXV 0.9.x): convert the rotation matrices back to cos/sin once per step and keep ComfyUI's own RoPE for split_pe=True. cos = rot[..., 0, 0] and sin = rot[..., 1, 0], each .reshape(B, T, -1).repeat_interleave(2, -1), give the [B, T, dim] tables that rms_norm_rope expects.

How this was checked: CPU only (no NVIDIA GPU). I imported the public q8_kernels Python package with its CUDA extension stubbed, bound the node's call against the public signature, and built pe with current ComfyUI's freqs_cis_matrix (--cpu). Output:

1) ImportError: cannot import name 'patch_comfyui_native_avtransformer' from 'q8_kernels.integration.patch_transformer'
2) TypeError: too many positional arguments; signature is patch_comfyui_native_transformer(transformer, use_fp8_attention=False, transform_weights=True)
3) ComfyUI pe = (rotation_matrix (1, 6, 32, 32, 2, 2) torch.bfloat16, split_pe=False)
   -> rms_norm_rope(q, pe[0], pe[1], ...) gets cos_freqs=(1, 6, 32, 32, 2, 2), sin_freqs=False; expects [B, T, 2048]
Lingua principale
Python
Stelle
4.2k
Fork
508
Merge medio
7h 14m
PR unite (30g)
3

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Lightricks/ComfyUI-LTXVideo

Tutte le issue di Lightricks/ComfyUI-LTXVideo

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.