Nodes/comfyui-timesaver/TS Multi Reference
ComfyUI Node

TS Multi Reference

Resizes up to three reference images down to a divide_by-pixel grid (area downscale), encodes each through the VAE, and appends them as reference_latents on the conditioning. Equivalent to chaining three ReferenceLatent nodes after three VAE Encode nodes. Feed images from any standard Load Image node. Empty inputs are skipped silently.

By AlexYez·Created 2 years ago·Updated 3 days ago· 11
TS Multi Reference
  • conditioning
  • vae
  • image_1
  • mask_1
  • image_2
  • mask_2
  • image_3
  • mask_3
  • image_1
  • image_2
  • image_3
  • conditioning
max_megapixels1.00
divide_by32
block_empty_slotstrue
mask_orientationauto
CategoryTS/Conditioning

Inputs (12)

NameTypeDefaultDescription
max_megapixelsFLOAT1.000.01–16Maximum size for each reference image before VAE encoding.
divide_byINT321–128Resized dimensions are an exact multiple of this value before VAE encoding. Most VAEs need 8 or 16; the default 32 is a safe choice for Flux 2, Qwen image edit, etc. If the source aspect does not snap exactly to the grid, a thin band is center-cropped off the longer side so the output aspect always matches and the image is never stretched.
block_empty_slotsBOOLEANtrueWhen enabled (default), empty image_N slots return ExecutionBlocker so downstream nodes are silently skipped (e.g. Save Image / PreviewImage). Disable to pass None on empty slots instead, so downstream nodes with optional IMAGE inputs (like TS Resolution Selector) keep running and apply their own fallback.
conditioningoptCONDITIONINGConditioning that will receive reference_latents. Optional: when not connected, the node skips VAE encoding and only resizes images for multi_images.
vaeoptVAEVAE used to encode reference images into latents. Required only when both images and conditioning are connected.
image_1optIMAGEReference image 1. Connect any IMAGE source.
mask_1optMASKOptional MASK for image_1. Used ONLY as a bounding-box hint with 16 px padding — pixels inside the bbox are preserved as-is (the mask shape is NOT cut out). The mask is binarised at 0.5 and its orientation is auto-detected from the four corners, so both ComfyUI Load Image alpha (1.0=transparent) and segmentation outputs (1.0=subject, e.g. SAM, BiRefNet, RemBG, Mask Editor) are handled correctly without any toggles.
image_2optIMAGEReference image 2. Connect any IMAGE source.
mask_2optMASKOptional MASK for image_2. See mask_1 tooltip.
image_3optIMAGEReference image 3. Connect any IMAGE source.
mask_3optMASKOptional MASK for image_3. See mask_1 tooltip.
mask_orientationoptCOMBOautoHow to read the MASK inputs. auto = 4-corner voting (works for typical photos, can guess wrong on full-bleed subjects that cover the corners). Pick an explicit convention if the crop lands on the wrong region.

Outputs (4)

NameTypeDescription
image_1IMAGEResized version of image_1 (ExecutionBlocker or None when the slot is empty).
image_2IMAGEResized version of image_2 (ExecutionBlocker or None when the slot is empty).
image_3IMAGEResized version of image_3 (ExecutionBlocker or None when the slot is empty).
conditioningCONDITIONINGInput conditioning with one reference_latent appended per connected image.