Nodes/RES4LYF/Set Precision Universal
ComfyUI Node Runs on cloud

Set Precision Universal

Force fp16/fp32/fp64 through your sampling graph

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
Set Precision Universal
  • cond_pos
  • cond_neg
  • sigmas
  • latent_image
  • cond_pos
  • cond_neg
  • sigmas
  • latent_image
precisionfp32
set_defaultfalse

Set Precision Universal does one focused thing: it forces the numeric precision of the data flowing through your sampling graph - conditioning, sigmas, the latent - to a type you choose. bf16, fp16, fp32, fp64, or passthrough to leave it alone. It's a utility node, but it's a meaningful one in RES4LYF, because the pack cares about precision more than most.

Here's the context. A lot of RES4LYF's high-order solvers do genuinely delicate math, and small rounding errors can compound over a schedule - which is why the pack's samplers even offer fp64 (double-precision) outputs. Higher precision means more numerically stable sampling and fewer subtle artifacts; the cost is speed and memory. This node lets you set the precision deliberately at a point in the graph instead of hoping the defaults are right. Most people never need to touch it - but if you're chasing the last bit of stability out of a fussy solver, or debugging why a high-order sampler is misbehaving, this is the knob.

How it works

It's a pass-through: whatever you plug into its inputs comes out the matching output, recast to the chosen precision. You insert it in the line between, say, your conditioning and your sampler.

The inputs and outputs that matter

Inputs and outputs are paired - each optional input has a matching output, so you route only what you need:

  • precision (default fp32) - the target type. fp32 is the safe general default; fp64 for maximum stability at a speed/memory cost; fp16/bf16 to go lighter; passthrough to leave precision untouched.
  • cond_pos / cond_neg (CONDITIONING) in and out - recast your positive/negative conditioning.
  • sigmas (SIGMAS) in and out - recast the schedule, which is where high precision matters most for touchy solvers.
  • latent_image (LATENT) in and out - recast the latent.
  • set_default (default false) - when on, sets the chosen precision as the process-wide default rather than only for what passes through this node.

How to install it

ComfyUI Manager: search RES4LYF, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/ClownsharkBatwing/RES4LYF
cd RES4LYF
pip install -r requirements.txt

then restart and hard-refresh (F5). Nothing to download.

Common issues & troubleshooting

fp64 slowed everything to a crawl (or OOM'd). Double precision is expensive - that's the trade. Use it only on the piece that needs it (usually sigmas), not the whole graph, and drop back to fp32 once you've confirmed the stability gain is real.

fp16 introduced artifacts or NaNs. Going down in precision on RES4LYF's higher-order solvers can make the very instability the pack works to avoid. If a low precision breaks a solver, step back up to fp32.

It seemed to do nothing. Check you actually routed data through it - an input left unconnected has nothing to recast. And passthrough is a real setting that deliberately changes nothing; make sure precision is set to what you intend.

CategoryRES4LYF/precision

Inputs (6)

NameTypeDefaultDescription
precisionCOMBOfp325 options: bf16, fp16, fp32, fp64, passthrough
set_defaultBOOLEANfalse
cond_posoptCONDITIONING
cond_negoptCONDITIONING
sigmasoptSIGMAS
latent_imageoptLATENT

Outputs (4)

NameTypeDescription
cond_posCONDITIONING
cond_negCONDITIONING
sigmasSIGMAS
latent_imageLATENT