Nodes/IAMCCS-nodes/GGUF Accelerator (patch_on_device)
ComfyUI Node

GGUF Accelerator (patch_on_device)

The GGUF LoRA speedup you didn't know you needed

By IAMCCS·Created 11 months ago·Updated 8 days ago· 113
GGUF Accelerator (patch_on_device)
  • model
  • model
  • report
modeauto_oom_safe
patch_on_devicetrue
move_patches_nowtrue
min_free_vram_mb1500
oom_fallbacktrue
move_policyall_or_nothing
leave_free_vram_mb1024

Here's a frustrating reality of GGUF + LoRA workflows: quantized models are how most of us run big video models on 12GB cards, but throw a LoRA on top and the pipeline starts dequantizing, patching, and requantizing tensors - moving patches back and forth between CPU and GPU every sampling step. It works, and it's slow, and the slowness is mostly the transfer, not the math.

IAMCCS_GGUF_accelerator is a targeted fix for exactly that. It sits between your GGUF model loader and the rest of the graph and makes ComfyUI-GGUF keep its patches on-device instead of shuffling them per step. If you run quantized video models with LoRAs, this is one of the few nodes in this pack I'd call genuinely worth having.

How it works

The core knob is patch_on_device: when on, LoRA patch tensors are applied and kept on the GPU rather than being re-loaded from CPU each step. The node's mode decides how aggressively:

  • auto_oom_safe (default) - tries patch_on_device with an eager move, but if free VRAM drops below min_free_vram_mb (default 1500), it backs off; if a CUDA OOM happens while moving, it falls back to offload (when oom_fallback is on).
  • manual - you drive patch_on_device and move_patches_now yourself.

move_patches_now pre-moves patch tensors to the model's load device to avoid runtime transfers - faster, but it costs VRAM. Newer versions added move_policy (all_or_nothing vs partial_small_first/partial_large_first) and leave_free_vram_mb so the pre-move respects a VRAM budget instead of risking OOM.

Outputs: the same model (patched, ready for LoRA application and sampling) and a report string telling you what it decided - which is useful in auto_oom_safe mode, because it'll tell you when it backed off.

Placement matters

README guidance is explicit: put it after the GGUF model loader and before LoRA application/sampling. It modifies the model's patch behavior; it doesn't change sampling parameters.

Install

Part of IAMCCS-nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git

Or ComfyUI Manager → "IAMCCS" → install → restart. You'll also need ComfyUI-GGUF installed for the loader it patches.

Common issues

The classic failure is OOM when move_patches_now is on and you're near your VRAM ceiling - the README's suggested fixes are real: raise min_free_vram_mb to 2000–3000, or set move_patches_now false. If you're still fighting fragmentation, it recommends PyTorch allocator tuning before launch, e.g. PYTORCH_ALLOC_CONF=backend:cudaMallocAsync (set it in your environment before starting ComfyUI, not in a node). And remember the KB's rule of thumb from the GGUF world: if you're VRAM-capped with Q8 + LoRAs, dropping to Q4 often nets you more speed than any patch-movement trick, because it's the dequant-requant cycle that hurts.

CategoryIAMCCS/Optimize

Inputs (8)

NameTypeDefaultDescription
modelMODEL
modeCOMBOauto_oom_safeauto_oom_safe: tries patch_on_device+eager move, falls back to offload on OOM | manual: use toggles below
patch_on_deviceBOOLEANtrue
move_patches_nowBOOLEANtrueIf enabled, attempts to pre-move patch tensors to the model load_device to reduce runtime transfers. Can increase VRAM usage.
min_free_vram_mbINT15000–65536(auto_oom_safe) If free VRAM is below this, we disable patch_on_device to reduce OOM risk. 0 disables the check.
oom_fallbackBOOLEANtrueIf a CUDA OOM happens while moving patches, automatically switches to offload and continues.
move_policyCOMBOall_or_nothingWhen pre-moving patches: all_or_nothing moves everything only if it fits the VRAM budget; partial_* moves a subset within the budget.
leave_free_vram_mbINT10240–65536When pre-moving patches to CUDA, try to keep at least this much VRAM free. 0 disables budget limiting.

Outputs (2)

NameTypeDescription
modelMODEL
reportSTRING