ComfyUI Node
Model (TurboQuant Attention)
A ComfyUI node in model/patch with 16 inputs and 1 output.
Model (TurboQuant Attention)
- model
- MODEL
◄bits8►
◄qjl_dim64►
◄use_qjl▾►
◄quantize_values▾►
◄min_token_product65536►
◄max_token_product262144►
◄attention_scope▾►
◄layer_start-1►
◄layer_end-1►
◄rotation_seed0►
◄max_head_dim256►
◄force_fp32▾►
◄memory_margin_mb1024►
◄log_every50►
◄log_fallbacks▾►
Categorymodel/patch
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | Model to clone and patch with a TurboQuant-inspired attention approximation. | |
| bits | INT | 81–8 | Bits per rotated coordinate for the scalar quantizer. Higher is safer for image quality; lower is more aggressive. |
| qjl_dim | INT | 641–4096 | Projection width for the QJL-style residual correction on logits. |
| use_qjl | COMBO | Enable the 1-bit residual correction term for key logits. Currently forced off in the runtime path. | |
| quantize_values | COMBO | Quantize values as well as keys. Disable is safer for image quality and is the default. | |
| min_token_product | INT | 655360–1073741824 | Only patch attention calls where query_tokens * key_tokens meets this threshold. |
| max_token_product | INT | 2621440–1073741824 | Skip attention calls above this query_tokens * key_tokens threshold. Conservative default avoids the largest, most memory-sensitive layers. |
| attention_scope | COMBO | Which attention calls to patch. | |
| layer_start | INT | -1-1–4096 | First transformer block index to patch. -1 disables the lower bound. |
| layer_end | INT | -1-1–4096 | Last transformer block index to patch. -1 disables the upper bound. |
| rotation_seed | INT | 00–18446744073709550000 | Seed used for the random orthogonal rotation and Gaussian residual projection. |
| max_head_dim | INT | 2561–4096 | Skip heads larger than this to avoid excessive projection overhead. |
| force_fp32 | COMBO | Cast q/k/v to fp32 inside the override for extra numerical stability. | |
| memory_margin_mb | INT | 10240–65536 | Keep this much free CUDA memory in reserve before allowing the TurboQuant workspace allocation. |
| log_every | INT | 500–1000000 | Emit a TurboQuant runtime summary every N attention calls. Set 1 for per-call summaries, 0 to disable periodic summaries. |
| log_fallbacks | COMBO | Log individual skip/fallback reasons when TurboQuant does not activate. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |