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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| max_megapixels | FLOAT | 1.000.01–16 | Maximum size for each reference image before VAE encoding. |
| divide_by | INT | 321–128 | Resized 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_slots | BOOLEAN | true | When 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. |
| conditioningopt | CONDITIONING | Conditioning that will receive reference_latents. Optional: when not connected, the node skips VAE encoding and only resizes images for multi_images. | |
| vaeopt | VAE | VAE used to encode reference images into latents. Required only when both images and conditioning are connected. | |
| image_1opt | IMAGE | Reference image 1. Connect any IMAGE source. | |
| mask_1opt | MASK | Optional 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_2opt | IMAGE | Reference image 2. Connect any IMAGE source. | |
| mask_2opt | MASK | Optional MASK for image_2. See mask_1 tooltip. | |
| image_3opt | IMAGE | Reference image 3. Connect any IMAGE source. | |
| mask_3opt | MASK | Optional MASK for image_3. See mask_1 tooltip. | |
| mask_orientationopt | COMBO | auto | How 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)
| Name | Type | Description |
|---|---|---|
| image_1 | IMAGE | Resized version of image_1 (ExecutionBlocker or None when the slot is empty). |
| image_2 | IMAGE | Resized version of image_2 (ExecutionBlocker or None when the slot is empty). |
| image_3 | IMAGE | Resized version of image_3 (ExecutionBlocker or None when the slot is empty). |
| conditioning | CONDITIONING | Input conditioning with one reference_latent appended per connected image. |