Nodes/ComfyUI_IPAdapter_plus/IPAdapter Encoder
ComfyUI Node Runs on cloud

IPAdapter Encoder

Pre-encode a reference once, reuse it everywhere

By cubiq·Created 3 years ago·Updated about a year ago· 6,099
IPAdapter Encoder
  • ipadapter
  • image
  • mask
  • clip_vision
  • pos_embed
  • neg_embed
weight1.00

Most IP-Adapter apply nodes take an image and encode it every time they run. IPAdapter Encoder splits that in two: it does the encoding once, up front, and hands you a reusable embedding. That's the whole idea - separate "turn this picture into a reference embedding" from "apply the reference," so you can encode several images, mix them however you like, and feed the result into generation without re-running the encoder each time.

This is a building block for the pack's advanced embeds workflow. On its own it doesn't touch your model at all; it's a preprocessing step. The payoff comes when you pair it with IPAdapter Combine Embeds (to blend multiple encoded references) and IPAdapter Embeds (to actually apply them).

Inputs and outputs

Inputs are lean. You give it an ipadapter (so it knows which adapter's encoding space to use), an image (the reference to encode), and a weight (default 1.0, range −1 to 3) that scales this reference's contribution as it's encoded. Optionally, a mask to restrict which part of the image gets encoded, and clip_vision - needed here if your ipadapter came from the plain Model Loader rather than the Unified Loader, because encoding is literally the CLIP-vision step and it needs that model present.

It outputs two embeddings: pos_embed and neg_embed. Both are the pack's EMBEDS type. The positive is your reference; the negative is the paired anti-reference the adapter uses internally. You carry these forward - most often into IPAdapter Embeds, or through IPAdapter Combine Embeds first if you're merging several.

Why bother splitting it out

Three real reasons:

  • Encode once, generate many. If you're running a batch of generations all conditioned on the same reference (or the same set of references), encoding it a single time and reusing the embedding is cleaner and saves the repeated CLIP-vision pass.
  • Blending with control. The natural next step is combining several encoded references with per-reference weights. Encode three faces, weight them, average them into one identity - that's a stacking workflow people use to get a more robust, less-overfit-to-one-photo result, and it starts here.
  • Reuse across a graph. Once a reference is an embedding, you can fan it out to multiple apply points without re-encoding at each.

If you only have one reference and one generation, you don't need this - just use an apply node that takes an image directly. The encoder earns its place the moment you're juggling multiple references or reusing one heavily.

Installing the pack

ComfyUI Manager: open Custom Nodes Manager, search "IPAdapter plus", install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/cubiq/ComfyUI_IPAdapter_plus, then restart ComfyUI. As with the rest of the pack you'll need an IP-Adapter model in ComfyUI/models/ipadapter and a CLIP vision encoder in ComfyUI/models/clip_vision (ViT-H for SD1.5, bigG for SDXL) - and since this node is the encoding step, make sure that CLIP vision model is actually loaded and reaching it. Update ComfyUI if the node won't appear. The typical chain is: Encoder → (optionally Combine Embeds) → IPAdapter Embeds → KSampler.

Categoryipadapter/embeds

Inputs (5)

NameTypeDefaultDescription
ipadapterIPADAPTER
imageIMAGE
weightFLOAT1.00-1–3
maskoptMASK
clip_visionoptCLIP_VISION

Outputs (2)

NameTypeDescription
pos_embedEMBEDS
neg_embedEMBEDS