LTX-2 Reference Image Switch ??
Pick your reference frame without rewiring the graph
- default_image
- reference_image
- image
- report
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) - passdefault_imagethrough untouched. Old workflows keep working because this is the default.use_reference- outputreference_imageinstead.blend- mix them byblend_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 whenmode=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.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| default_image | IMAGE | Fallback image (e.g. EmptyImage) | |
| mode | COMBO | none | none: pass default_image | use_reference: output reference_image | blend: mix both |
| blend_strength | FLOAT | 1.000–1 | Only used if mode=blend (0=default, 1=reference) |
| reference_imageopt | IMAGE | Optional reference image (usually batch size 1) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| report | STRING | — |