Nodes/ComfyUI-Apt_Preset/pre_latent_light
ComfyUI Node

pre_latent_light

Blend two images into one latent, weighted

By cardenluoĀ·Created 2 years agoĀ·Updated 18 days agoĀ· 309
pre_latent_light
  • context
  • img_targe
  • img_light
  • context
  • image
  • latent
ā—„weigh0.30ā–ŗ

Don't let the name fool you - this isn't a relighting model like IC-Light, and there's no dedicated lighting UNet or normal-map anywhere in its inputs. What it actually does is simpler and more general: it takes two images, blends them by a single weight, and hands you back both the blended image and its latent encoding, ready to drop straight into a sampler. Think of it as a quick "nudge toward a second reference" utility rather than a physically-grounded lighting tool - useful when you want to bias a target image toward a secondary image's color, tone, or content without running a full generation pass to get there.

It lives in the pack's 😺backup bucket, which is the author's catch-all for small utility nodes rather than anything to do with saving/restoring state - don't read "backup" as literal here.

The inputs and outputs that matter

  • context (required) - the run-context bundle this pack threads through most of its nodes, carrying model/clip/vae so downstream nodes don't need them rewired individually. It passes through and comes back out unchanged.
  • weigh (required, default 0.3, range 0.1–0.7) - the blend factor between the two images. Note it's clamped well short of 0 or 1: you can't ask for either image at full strength, only somewhere in between, which tells you this node is meant for subtle nudging rather than a hard swap.
  • img_targe / img_light (both optional, IMAGE) - the two images being blended. The typo in img_targe (missing the "t") is the author's, not a docs error - it's the literal input name in the node.
  • Outputs: context passthrough, image (the blended result), and latent (that same result already VAE-encoded via the model carried in context). This node is also flagged as an output node, meaning ComfyUI will preview its image result directly in the graph without needing a separate Preview/Save node downstream.

How to install it

Search ComfyUI-Apt_Preset in ComfyUI Manager and install, or clone it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git

The README points Windows users at install.bat for dependencies; on Linux or Mac, open that file to see the actual pip commands and run them yourself, or let ComfyUI Manager pull in anything missing when you first load a workflow that uses this pack. This node has no model files to download - the VAE it encodes through comes from whatever's already loaded upstream via context.

Common issues & troubleshooting

The blend does almost nothing, or does too much. With weigh boxed into 0.1–0.7, this node was clearly built for mild adjustments. If you need a hard image swap or a full 0/1 blend, this isn't the tool - reach for a plain ImageBlend or composite node instead, which won't clamp the range on you.

latent comes out the wrong shape or errors downstream. The encode step depends on the VAE riding along inside context. If your context bundle wasn't built from a loader node upstream in this same pack (or is missing a VAE entirely), the encode has nothing to encode with - trace the context chain back to whichever sum_load-style node created it.

Only one of the two image inputs is connected. Both img_targe and img_light are optional, so the node won't error if you skip one - but check what it does with a missing second image before relying on the blend behavior; with only one input wired, you're likely just getting that image passed through unchanged rather than any real blending.

CategoryApt_Preset/chx_tool/😺backup

Inputs (4)

NameTypeDefaultDescription
contextRUN_CONTEXT—
weighFLOAT0.300.1–0.7—
img_targeoptIMAGE—
img_lightoptIMAGE—

Outputs (3)

NameTypeDescription
contextRUN_CONTEXT—
imageIMAGE—
latentLATENT—