Nodes/ComfyUI-bleh/BlehModelProcessLatentIn
ComfyUI Node

BlehModelProcessLatentIn

For when you're bypassing ComfyUI's normal latent input path

By blepping·Created 3 years ago·Updated 4 days ago· 143
BlehModelProcessLatentIn
  • model
  • latent
  • LATENT

Here's a thing most people never think about because ComfyUI handles it silently: every model architecture has its own convention for scaling raw latent values before feeding them to the actual denoising network. SDXL expects one range, Flux another, Wan another again - it's baked into each model's code as a process_latent_in function, and the standard sampler nodes call it automatically every single time. You've never had to think about it because you've never needed to.

BlehModelProcessLatentIn exposes that hidden call as its own node. The pack's own description is the honest framing: it's "generally only needed if you're doing something that bypasses the normal latent input mechanisms." If you're using KSampler or SamplerCustomAdvanced through their normal wiring, this node has nothing to do - the scaling already happens for you, invisibly, correctly.

When you'd actually need it

This is plumbing for people building genuinely custom sampling graphs - say you've assembled your own denoising loop by hand, or you're feeding a raw latent (loaded from disk, generated by some other tool, constructed programmatically) into a pipeline that skips the usual entry points. In that situation, the model's internal math still expects latents in its expected range, and nothing will apply that scaling for you automatically anymore. That's the gap this node fills: call the model's own process_latent_in function explicitly, on demand.

If you've never had a reason to build a workflow like that, you've never needed this node, and that's fine - it exists for the minority of setups that intentionally step outside the normal rails.

Inputs and outputs

  • model - the MODEL whose latent-input convention you want applied. This has to be the same model (or same architecture) the latent is destined for - the scaling is architecture-specific.
  • latent - the raw LATENT to process.
  • Output: a single LATENT, scaled the way that model expects for input.

There's a matching BlehModelProcessLatentOut node for the reverse direction - scaling a latent out of the model's internal range before you decode or export it. If you need one, you probably need the other.

Installing it

  • ComfyUI Manager - search "ComfyUI-bleh", install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/blepping/ComfyUI-bleh, restart ComfyUI.

No extra dependencies or downloads for this node specifically.

Common issues

You added this to a normal KSampler workflow and things got worse. That's expected - if the standard path is already applying this scaling once, and you apply it again manually, you're double-processing the latent. This node is additive plumbing for custom graphs, not a fix-it node to sprinkle into an ordinary workflow.

Output is subtly off after using this in a custom pipeline. Double-check you're pairing it correctly with BlehModelProcessLatentOut on the way back out, and that the model input genuinely matches the architecture the latent belongs to - this is architecture-specific math, not a generic normalization.

You're not sure whether you need this at all. If your workflow is built from standard sampler nodes wired the normal way, you don't. This is specifically for graphs that deliberately route around ComfyUI's usual latent handling.

Categorylatent/advanced

Inputs (2)

NameTypeDefaultDescription
modelMODEL
latentLATENT

Outputs (1)

NameTypeDescription
LATENTLATENT