Nodes/comfyui-conduit-optimizer/Conduit Precision Patcher
ComfyUI Node

Conduit Precision Patcher

Half-precision attention without touching your checkpoint

By JosephOIbrahim·Created 8 months ago·Updated 8 months ago· 1
Conduit Precision Patcher
  • model
  • model
  • status
attention_precision
linear_precision
enabledtrue

Conduit Precision Patcher is the rare Conduit node that actually modifies your model at runtime. It takes a MODEL, clones it, and applies a precision setting to the attention computation - the single most expensive part of a diffusion pass - without you having to re-quantize or re-download anything. If you want to shave VRAM and speed up attention on a card that can handle half-precision, this is the node in the pack that does the thing.

How it works

The mechanism is a ComfyUI patching trick: patch_precision clones the model, then writes the dtype into the model's transformer_options under attn_precision. That's the hook ComfyUI's attention implementations read, so attention runs at your chosen precision on the next sampling pass. Because it operates on a clone, your original model object is untouched - the patch applies only to the patched MODEL you pass downstream, and you can create several differently-patched copies and switch between them. The enabled toggle (default true) is a clean off-switch: set it false and you get your model back with a "Precision patching disabled" status.

Two required inputs pick the precision, each with auto, fp32, fp16, bf16:

  • attention_precision - the one that does something real. This is what gets patched into the model.
  • linear_precision - be honest with yourself here: the source records this in the status string but doesn't set a corresponding model option. It's a declaration of intent, not a live patch. If you want linear layers changed, this node isn't wired to do it yet.

The outputs are model (patched MODEL, wire it into your sampler) and status (a STRING like Precision patched: attention=fp16).

What precision should you pick?

The safe play is fp16 or bf16 for attention - half the VRAM of fp32 attention with negligible quality cost on modern cards. The KB's summary is blunt: FP16/BF16 is "full precision" in quality terms for most purposes, and FP8 is "99% identical to FP16 requiring half the VRAM." This node tops out at bf16, so it's the conservative half of that story. A couple of ground rules from the trenches: keep norms at FP32 (this node doesn't touch them, which is correct), and if you're on a pre-Turing GPU or one with flaky half-precision math, FP16 attention can throw NaNs that decode to black images - the troubleshooting lore has a whole section on that. When in doubt, auto (which applies no patch at all) or fp32.

Install

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/joe002/comfyui-conduit-optimizer

Or ComfyUI Manager → search "comfyui-conduit-optimizer" → restart. No model downloads, no deps beyond PyTorch 2.0+.

Common issues

The mismatch that bites people: the README markets this pack with big FP8 TensorCore numbers, but the Patcher's dropdowns stop at bf16 - FP8 isn't on the menu here, so "speed mode" promises about FP8 live in the planning nodes, not this one. Second, linear precision being cosmetic means you shouldn't tune your expectations (or your VRAM budget) around it. And remember the patched model is a clone - if you wire the original model into your sampler by mistake, the patch never happens. The status string tells you what was actually applied, so read it.

CategoryConduit/Optimization

Inputs (4)

NameTypeDefaultDescription
modelMODEL
attention_precisionCOMBO4 options: auto, fp32, fp16, bf16
linear_precisionCOMBO4 options: auto, fp32, fp16, bf16
enabledoptBOOLEANtrue

Outputs (2)

NameTypeDescription
modelMODEL
statusSTRING