> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# ReferenceMultiLatent - ComfyUI Built-in Node Documentation

> This node encodes one or more reference images and appends their latents to the conditioning that an edit model consumes.

This node encodes one or more reference images and appends their latents to the conditioning that an edit model consumes. It is the multi-image counterpart of Set Reference Latent: you connect a VAE plus a set of reference images, and the node attaches every encoded latent to the positive conditioning and, when one is connected, to the negative conditioning as well. Use it when a model expects several reference images at once instead of a single latent.

## Inputs

### Common Inputs

| Parameter | Description | Data Type | Required | Range |
| - | - | - | - | - |
| `positive` | The positive conditioning to modify with the reference latents. | CONDITIONING | Yes | - |
| `negative` | Optional negative conditioning that receives the same reference latents. Leave it unconnected to reuse the modified positive conditioning on the `negative` output. | CONDITIONING | No | - |
| `vae` | The VAE used to encode the connected reference images. Required whenever at least one image is connected, otherwise the node raises an error. | VAE | No | - |
| `resolution` | How each reference image is prepared before encoding. `"keep resolution"` encodes it at its incoming size; `"resize"` scales it to a target megapixel count while preserving the aspect ratio, which reveals `megapixels`. (default: "keep resolution") | DYNAMIC\_COMBO | Yes | `"keep resolution"`<br />`"resize"` |
| `images` | Growable slot: connect one or more reference images (`image_1`, `image_2`, ...) to use as references. Images are encoded in slot order and appended to the conditioning in that order. | IMAGE | No | 1 to 100 |

### Resize Inputs

These options appear when `resolution` is set to `"resize"`.

| Parameter | Description | Data Type | Required | Range |
| - | - | - | - | - |
| `megapixels` | Target size of each reference image, preserving aspect ratio. 1.0 is about 1024 x 1024 pixels. (default: 1.0) | FLOAT | Yes | 0.01 to 16.0 |

## Outputs

| Output Name | Description | Data Type |
| - | - | - |
| `positive` | The positive conditioning with the encoded reference latents appended. | CONDITIONING |
| `negative` | The negative conditioning with the same reference latents appended. Returns the positive output when no negative conditioning is connected. | CONDITIONING |
| `empty_latent` | The first reference latent multiplied by 0.0, ready to seed a sampler. Empty when no reference image is connected. | LATENT |

## Notes

* The latents are appended rather than replaced, so chaining several Set Reference Multi Latent nodes accumulates references.
* Each connected image is encoded on its own, so the reference images do not have to share a size.
* Without any connected image, `positive` and `negative` are returned unchanged and `empty_latent` is empty.

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/ReferenceMultiLatent/en.md)

***

**Source fingerprint (SHA-256):** `7416feb8ac81cbf7e2d424e0212e88ab60235958c64550b0ee8c303093673756`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.