Nodes/ComfyUI-LG_SamplingUtils/🎈LG Noise Injection (Latent)
ComfyUI Node

🎈LG Noise Injection (Latent)

The noise-injection twin that skips the VAE

By LAOGOU-666·Created 8 months ago·Updated 8 months ago· 193
🎈LG Noise Injection (Latent)
  • model
  • reference_latent
  • MODEL
strength0.15
start_percent0.00
end_percent0.60

LG Noise Injection (Latent) is the sibling of the pack's main injection node, and the difference is one input. The image version takes a reference_image plus a vae and encodes the reference to latent space for you. This one assumes you've already got a latent - it skips the encode step entirely and injects straight from your reference_latent. Same mechanism, same strength/range controls, one less thing to wire.

When to reach for it

If your reference is already in latent space, encoding it again would be pointless work. That happens more than you'd think:

  • You generated the reference yourself. Run a latent through VAEEncode (or keep the latent from a previous sampler pass) and you have your reference in the exact right representation with zero conversion.
  • You want a partially-denoised latent. The whole trick of this technique is nudging toward features, and a partially denoised latent is often a better feature carrier than a fully decoded image, because it's already in the same "dialect" as your output.
  • You're on a tight VRAM budget. The image variant loads the VAE for encoding; this one doesn't touch it.

It also handles masks for you. If your reference_latent dict carries a noise_mask (which it will if it came out of an inpainting-style pipeline), the node picks it up automatically and uses it as the injection mask - no separate mask input on the node at all.

How it works

Identical core to the image version: it clones your model, hooks the CFG function, and at each step inside the window adds (reference_latent - cfg_result) * effective_strength to the CFG output, with strength decaying linearly from start_percent to end_percent and the direction capped so it can't over-drift. Because the latent is already in latent space, the only preprocessing is resizing it (and any noise_mask) to match your output's current shape - trilinear for 5D video latents, bilinear for 4D images.

The inputs

All required, and there are no optional ones:

  • model - the model to patch.
  • reference_latent - the LATENT carrying the features. Its noise_mask, if present, becomes the mask automatically.
  • strength - default 0.15; author's guidance is 0.1–0.2 subtle, 0.2–0.4 noticeable.
  • start_percent / end_percent - default 0→0.6, the injection window.

Output: one patched MODEL, straight into your sampler.

Installation

It's one of five nodes in ComfyUI-LG_SamplingUtils - installing the pack gives you all of them:

cd ComfyUI/custom_nodes
git clone https://github.com/LAOGOU-666/ComfyUI-LG_SamplingUtils.git

or search for ComfyUI-LG_SamplingUtils in ComfyUI Manager and restart. No Python dependencies, no model files. GPL-3.0, small author, v1.0.2 as of late 2025 - it's a hobby pack, but this node is genuinely useful and dependency-free.

Gotchas

  • The latent has to be from the same VAE/latent space as your target. Feeding an SDXL-encoded latent into a Z-Image workflow isn't a subtle mismatch, it's noise. Both the reference and your generation need to come from the same model family's encoder.
  • Same CFG caveat as the image twin. Injection happens post-CFG-mix, so on a guidance-distilled model running CFG 1 (Turbo's default) it has little to attach to. It's happiest on CFG-active models like Z-Image Base at CFG 3–5.
  • Watch the console for [FeatureInjLatent] debug lines on early steps - normal, and useful for confirming the window and mask are active.
  • Strength above ~0.5 starts dragging the output toward the reference's structure wholesale. Start at 0.1 and creep up.
Categoryadvanced/model

Inputs (5)

NameTypeDefaultDescription
modelMODEL模型
reference_latentLATENT参考 latent(含有你想要注入的特征)
strengthFLOAT0.150–1注入强度。0.1-0.2 轻微,0.2-0.4 明显
start_percentFLOAT0.000–1开始注入的采样进度
end_percentFLOAT0.600–1结束注入的采样进度

Outputs (1)

NameTypeDescription
MODELMODEL