Nodes/IAMCCS-nodes/LTX-2 Reference Image Switch ??
ComfyUI Node

LTX-2 Reference Image Switch ??

Pick your reference frame without rewiring the graph

By IAMCCS·Created 11 months ago·Updated 7 days ago· 113
LTX-2 Reference Image Switch ??
  • default_image
  • reference_image
  • image
  • report
modenone
blend_strength1.00

The classic LTX-2 identity problem: you want a character or style reference feeding into a generation, but you also want a "no reference" mode for quick tests, and you don't want to build a switch node for every image input in your graph. This node is that switch, purpose-built for the reference-image slot in the IAMCCS LTX-2 extension workflows.

Here's the setup it's designed for. In a segment-based long video workflow, each segment has continuity inputs (the overlap/start frames that keep motion flowing) and separate auxiliary image slots for identity and style reinforcement. The author's intent, straight from the code comment: feed this node's output into a segment node's optional/secondary image input to reinforce identity without touching the overlap/start-image continuity input. Identity and motion are different signals - this keeps them from fighting.

How it works

Three modes, one enum:

  • none (default) - pass default_image through untouched. Old workflows keep working because this is the default.
  • use_reference - output reference_image instead.
  • blend - mix them by blend_strength (0 = pure default, 1 = pure reference).

The bit most people don't expect: it does the plumbing for you. If the reference is batch size 1 and the default is a batch of 9, it repeats the reference to match. If resolutions differ, it bilinearly resizes the reference to the default's size (a (resized) note lands in the report when it does). So you can throw a single character still into a multi-frame conditioning batch and it just works.

Inputs and outputs

  • default_image - the fallback, typically an EmptyImage or whatever the graph would use without a reference.
  • mode - none / use_reference / blend.
  • blend_strength - only read when mode=blend.
  • reference_image - optional, usually batch size 1.

Outputs are image (the selected/blended batch) and a report STRING noting which mode ran and whether a resize happened.

Install

Via ComfyUI Manager (search "IAMCCS") or:

cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git

Restart after cloning. Pure image math, no model files, no extra deps.

Gotchas

The trap is thinking this node injects the reference into the latent - it doesn't. It only picks which image flows onward. To actually bake a reference into the start frames of a segment, you want the sibling node IAMCCS_LTX2_ReferenceStartFramesInjector, which is the tool for when the reference image on its own isn't moving identity enough. If you're reaching for this one and the character still drifts, that's not a bug in the switch - the reference just isn't reaching the conditioning the way you think it is.

Keep mode at none until you know a reference helps, then flip it on. That's the whole design philosophy, and it's the right one for a workflow you're still tuning.

CategoryIAMCCS/LTX-2

Inputs (4)

NameTypeDefaultDescription
default_imageIMAGEFallback image (e.g. EmptyImage)
modeCOMBOnonenone: pass default_image | use_reference: output reference_image | blend: mix both
blend_strengthFLOAT1.000–1Only used if mode=blend (0=default, 1=reference)
reference_imageoptIMAGEOptional reference image (usually batch size 1)

Outputs (2)

NameTypeDescription
imageIMAGE
reportSTRING