Nodes/ComfyUI-PhotoMaker-Plus/PhotoMaker Encode Plus
ComfyUI Node

PhotoMaker Encode Plus

The node that turns your face photos into identity

By shiimizu·Created 3 years ago·Updated 2 years ago· 296
PhotoMaker Encode Plus
  • clip
  • photomaker
  • image
  • insightface_opt
  • CONDITIONING
trigger_wordimg
textphotograph of a man img

This is the node that does the actual PhotoMaker thing. Everything else in the pack is scaffolding - this is where your reference photos stop being pixels and become part of the prompt. If you've used IP-Adapter or InstantID, you already know the shape of the job: an adapter node that replaces a normal CLIPTextEncode on the positive side and produces CONDITIONING for the sampler. PhotoMakerEncodePlus is that node for PhotoMaker.

It earns the "Plus" in the pack name. PhotoMaker itself is a Tencent research model; this is the community port that made it behave like a ComfyUI citizen.

The mechanism, briefly

PhotoMaker's trick, from the paper ("PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding"), is the stacked ID embedding. Instead of your prompt's trigger word being a normal token, the encode node swaps it out for a block of special image tokens and fills those tokens with encodings of your reference photos. The ID encoder then fuses image information into the text embedding stream, so the diffusion model sees "this specific person" as part of the conditioning.

Concretely, the node:

  1. Tokenizes your prompt and finds the trigger word.
  2. Replaces each occurrence with a stack of image tokens - one per reference image, repeated per token slot.
  3. Runs your reference photos through the CLIP Vision encoder (resized to 224×224 with the same CLIPImageProcessor the original research code used - the README calls this out as the "better face resemblance" feature).
  4. Fuses that into the conditioning, which you hand to the KSampler.

On V2 there's an extra step: it also runs InsightFace ArcFace face detection over each reference image and feeds the face embeddings in. That's recognition-based identity on top of the CLIP signal, which is why V2 is a step up in likeness and a step up in install pain.

Inputs you'll actually set

  • clip - the CLIP output from your checkpoint loader.
  • photomaker - PHOTOMAKER from PhotoMakerLoaderPlus.
  • image - one or more reference photos. Stack several with ImageBatch; PhotoMaker's whole bet is that more images = better identity.
  • trigger_word - default img. This is the token in your prompt that marks where the identity goes.
  • text - your full positive prompt, e.g. photograph of a man img wearing a suit. The trigger word must appear in here.
  • insightface_opt - optional on paper, required for V2. Wire in the INSIGHTFACE output from PhotoMakerInsightFaceLoader.

The output is CONDITIONING, which goes straight into the sampler's positive input, replacing CLIPTextEncode for the positive side. Negative conditioning still comes from a normal CLIPTextEncode.

Install (the pack, once)

ComfyUI Manager → search "PhotoMaker Plus", or:

cd ComfyUI/custom_nodes
git clone https://github.com/shiimizu/ComfyUI-PhotoMaker-Plus.git

Restart. Drop photomaker-v1.bin or photomaker-v2.bin into ComfyUI/models/photomaker/. For V2, the pack's requirements.txt (onnxruntime, insightface, numpy<2) must install cleanly - see the InsightFace loader page for the pain points.

Where people get burned

  • No trigger word in the prompt. The node warns "No trigger token found" and silently returns plain text conditioning - no identity. The trigger word and the trigger_word field must match exactly.
  • V2 without InsightFace. You'll get "InsightFace is required for PhotoMaker V2". Wire the loader node up.
  • V2 without a detectable face. "No face detected in input image pool" - InsightFace couldn't find a face in your reference. Small, low-res, or heavily angled photos trigger this; give it a clear frontal shot.
  • Identity too strong/too weak. That's not the encode node - that's lora_strength on PhotoMakerLoraLoaderPlus. Keep this node's text clean and do your tuning there.

PhotoMaker is an SD 1.5/SDXL tool, so don't expect this to run on Flux-era checkpoints. On SDXL, though, it's still one of the fastest zero-training ways to get a specific face into a scene - multiple reference images and a good trigger word will get you 80% of the way to a trained LoRA in a fraction of the work.

CategoryPhotoMaker

Inputs (6)

NameTypeDefaultDescription
clipCLIP
photomakerPHOTOMAKER
imageIMAGE
trigger_wordSTRINGimg
textSTRINGphotograph of a man img
insightface_optoptINSIGHTFACE

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING