Nodes/ComfyUI PhotoMaker (ZHO)/📷Ref Image Preprocessing
ComfyUI Node

📷Ref Image Preprocessing

How to feed PhotoMaker its reference photos

By ZHO-ZHO-ZHO·Created 3 years ago·Updated 2 years ago· 814
📷Ref Image Preprocessing
  • ref_image
  • IMAGE
ref_images_pathpath/to/images
modedirect_Input

PhotoMaker needs your reference images in a specific shape, and this is the node that gets them there. Ref_Image_Preprocessing takes photos of your subject - one or many - and hands them to the generation node as the identity to copy. It's the only image input in the pack, and the whole "this person" part of the workflow flows through it.

It has two modes, set by the mode dropdown:

  • direct_Input (default) - you wire an IMAGE in from anywhere in your graph: Load Image, a previous node's output, whatever. This is the mode to use when you want to chain or reuse images.
  • path_Input - you type a folder path into ref_images_path and it loads every image in that folder (png, jpg, jpeg, bmp, webp; hidden files skipped). Great for testing a whole set of reference shots at once, and it's the mode the README's V2.5 workflows lean on.

The optional ref_image input is the IMAGE you connect in direct mode; the required ref_images_path field is only actually used in path mode. Quirky schema aside, the behavior is straightforward.

Output is IMAGE, which goes to the pil_image input of NEW_PhotoMaker_Generation. Yes, the name says "pil" - it's just what the diffusers pipeline expects internally, and ComfyUI's IMAGE tensor is what you hand it.

The one thing worth internalizing: PhotoMaker is multi-reference. The whole point of the method is stacking several photos of the same person into one averaged identity embedding, and the community consensus from the day it launched is that more reference images dramatically improves likeness - a front view, a side profile, and a different expression beat one perfect shot. So the path mode isn't a convenience, it's the intended way to get good results. Drop 3–5 clean, varied shots of the same person in a folder, point this node at it, and let PhotoMaker do its averaging thing.

Installing the pack is once-per-machine, via ComfyUI Manager (search "PhotoMaker") or:

cd ComfyUI/custom_nodes
git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker-ZHO
cd ComfyUI-PhotoMaker-ZHO
pip install -r requirements.txt

Restart ComfyUI and you're set. No model downloads happen in this node - it's pure image handling. One final note in the spirit of full honesty: this is a small, unmaintained diffusers-wrapper pack (last touched April 2024). If you're starting a fresh identity workflow today, the native PhotoMaker nodes in ComfyUI core are the lighter, maintained route; this pack is for the established workflows that already use it.

Category📷PhotoMaker

Inputs (3)

NameTypeDefaultDescription
ref_images_pathSTRINGpath/to/images
modeCOMBOdirect_Input2 options: direct_Input, path_Input
ref_imageoptIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE