Nodes/Skoogeer-Noise/Model (RotorQuant Attention)
ComfyUI Node

Model (RotorQuant Attention)

The experimental attention patch you should probably not ship

By ttulttul·Created 9 months ago·Updated 3 months ago· 14
Model (RotorQuant Attention)
  • model
  • MODEL
keep_components3
min_token_product65536
attention_scope
layer_start-1
layer_end-1
rotation_seed0
max_head_dim256
force_fp32

Straight talk: this node is the most experimental thing in the pack, and the README is admirably honest about it. It clones your MODEL, installs an attention override inspired by the RotorQuant paper (which adapted cheap blockwise 3D rotations for quantized attention), and runs it through ComfyUI's transformer_options["optimized_attention_override"] hook. It is not a speed hack, it is not a drop-in quality upgrade, and the author explicitly notes it's "an adaptation of RotorQuant's rotor-style blockwise orthogonal transform idea, not a direct port of its LLM KV-cache quantizer." If you're here because a workflow with "RotorQuant" in it told you to install this, install it - but set expectations accordingly.

The mechanism: instead of replacing your sampler or patching ComfyUI core, you place this node between your model loader and a normal KSampler. It clones the model and patches attention so that, per head, it rotates q/k/v through deterministic 3D rotor blocks. You get to pick which attention calls get patched and where.

The inputs that matter

  • keep_components (default 3) - how many rotated coordinates to keep per 3D rotor group. Values below 3 are forced back to 3: the lossy 1/2-component variants were tried and produced poor image quality, so they're disabled. The knob is there, but it won't go where you want.
  • min_token_product (65536) - query_tokens * key_tokens threshold before the override activates. Small attention calls skip the patch; you're only patching the chunky ones.
  • attention_scope - self, cross, or both. self is the recommended target for diffusion latent attention; most people leave it there.
  • layer_start / layer_end - transformer block indices to patch. -1 disables the bound on that side. If you want to confine the experiment to, say, the middle blocks, this is how.
  • rotation_seed - seed for the deterministic per-block rotors, so runs are reproducible.
  • max_head_dim (256) - heads larger than this get skipped, because the projection overhead would likely dominate any benefit.
  • force_fp32 - optionally run the patched q/k/v path in fp32 for extra numerical stability. Only if you're chasing a precision bug.

Output: a patched MODEL that feeds a normal KSampler like any other.

Installing and using it

Part of Skoogeer-Noise. ComfyUI Manager → search "Skoogeer-Noise", or:

cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/Skoogeer-Noise

Restart ComfyUI. No model downloads; deps are torch, numpy, einops, pyyaml.

The honest bottom line

Where does this actually fit? In the same research corner as the pack's Model (TurboQuant Attention) sibling - the author shipped both out of experimentation with attention approximation for diffusion, alongside the KSampler-with-scheduled-LoRA work. For real-world image work, the expected result is approximately baseline quality at approximately baseline speed - an experiment, not an optimization. Run it once with the defaults to see what happens on your model, compare against an unpatched pass, and don't expect to reclaim VRAM like true KV-cache quantization would. The interesting part is that it composes cleanly through the standard attention override hook, so it's a safe way to poke at what cheap orthogonal attention does to diffusion latents without breaking anything else. Treat it as a toy worth one evening, not a production tool.

Categorymodel/patch

Inputs (9)

NameTypeDefaultDescription
modelMODELModel to clone and patch with RotorQuant-style attention.
keep_componentsINT31–3How many rotated coordinates to keep from each 3D rotor group. Values below 3 are currently forced back to 3 because the lossy modes degrade image quality too much.
min_token_productINT655360–1073741824Only patch attention calls where query_tokens * key_tokens meets this threshold.
attention_scopeCOMBOWhich attention calls to patch. 'self' is usually the most useful for diffusion latents.
layer_startINT-1-1–4096First transformer block index to patch. -1 disables the lower bound.
layer_endINT-1-1–4096Last transformer block index to patch. -1 disables the upper bound.
rotation_seedINT00–18446744073709550000Seed used to generate the per-triplet rotor rotations.
max_head_dimINT2563–4096Skip heads larger than this to avoid excessive projection overhead.
force_fp32COMBOCast q/k/v to fp32 inside the override for extra numerical stability.

Outputs (1)

NameTypeDescription
MODELMODEL