Nodes/raylight/ModelComputeDtype (Ray)
ComfyUI Node

ModelComputeDtype (Ray)

Force the compute dtype on a distributed model

By komikndr·Created about a year ago·Updated 2 days ago· 409
ModelComputeDtype (Ray)
  • ray_actors
  • ray_actors
dtype

ModelComputeDtype (Ray) does one thing: it forces the precision the model computes in, inside the raylight multi-GPU pipeline. ray_actors in, ray_actors out, and a single dtype dropdown - default, fp32, fp16, or bf16. It's a port of ComfyUI's own ModelComputeDtype, adapted so the setting propagates to every Ray worker instead of just the host model.

Why would you care about compute dtype? Because it's a different axis from storage dtype. Your model file can be stored as fp8 or bf16, but the arithmetic during denoising happens at whatever compute precision the sampler says - and that's what this node overrides. Forcing fp16 or bf16 makes the actual matrix math faster and lighter on VRAM (the two 12GB-card crowd in raylight cares about this a lot), at the cost of a bit of numerical precision. fp32 is for when you need maximum stability and are willing to pay for it - think debugging, or a model that misbehaves in lower precision.

What to actually pick

  • default - leave it. Whatever the model and ComfyUI agreed on is almost always right.
  • bf16 - the modern sweet spot on Ampere and newer GPUs. Robust dynamic range, most of the speed, few precision surprises. This is the one people usually land on.
  • fp16 - fine on NVIDIA, but keep an eye out for overflow issues on models with large activation values; bf16 is generally safer on consumer cards.
  • fp32 - slow, memory-hungry, and only worth it for diagnostics or the rare model that genuinely needs it.

If you don't have a specific complaint - a model producing NaN outputs, or you're squeezing VRAM for FSDP - leave it on default and spend your time elsewhere. This is a fix-it and a tuning knob, not a "set it once and forget it" thing.

The one real gotcha

Because the compute dtype is applied per-worker, the effect in a distributed run is only as good as the weakest GPU in your set. If one card doesn't support a given precision well, that's your bottleneck. So when you're experimenting with fp16 vs bf16 across two cards, treat it like any other distributed setting: change it, watch all the workers, not just the one ComfyUI's status bar shows.

Install is the same as the rest of the pack - ComfyUI Manager → "raylight", or clone + pip install -r requirements.txt. No model downloads; it operates on whatever checkpoint your graph already loaded.

CategoryRaylight/extra

Inputs (2)

NameTypeDefaultDescription
ray_actorsRAY_ACTORS
dtypeCOMBO4 options: default, fp32, fp16, bf16

Outputs (1)

NameTypeDescription
ray_actorsRAY_ACTORS