Nodes/ComfyUI-PhotoMaker-Plus/Prepare Images For CLIP Vision From Path
ComfyUI Node

Prepare Images For CLIP Vision From Path

Point your reference photos at a folder instead of dragging them into ComfyUI

By shiimizu·Created 3 years ago·Updated 2 years ago· 296
Prepare Images For CLIP Vision From Path
    • IMAGE
    path
    interpolationlanczos
    crop_positioncenter

    The most annoying part of a PhotoMaker workflow is getting your reference photos into ComfyUI. The default LoadImage node makes you pick from the input folder's dropdown - fine for one image, miserable for a folder of forty photos of the same person. PrepImagesForClipVisionFromPath exists to break that habit: it loads reference images straight from any path on disk (or a URL), preps them for PhotoMaker's CLIP Vision encoder, and hands them to PhotoMakerEncodePlus.

    It's a genuinely useful utility, and it's also a piece of the pack's history. The original version of this pack had a ref_images_path input bolted onto the encode node; the author ripped it out in early 2024 and shipped this separate node instead, which is the cleaner design - path handling and encoding are now independent concerns you can swap around.

    What it does

    Three inputs, one output:

    • path - a file path, a folder path, or an http(s):// URL. Give it a directory and it loads every image in it (.png, .jpg, .jpeg, .bmp, .webp, .gif), skipping dotfiles. That's the killer feature: swap the contents of a folder and the node picks up the new set automatically.
    • interpolation - how images are resized to the 224×224 input the CLIP Vision encoder wants: nearest, bilinear, box, bicubic, lanczos, hamming. Default lanczos, and it's the right default - leave it.
    • crop_position - where the crop happens when aspect ratios don't match: top, bottom, left, right, center, or pad. Default center.

    The IMAGE output feeds PhotoMakerEncodePlus's image input, alongside the other reference images from your LoadImage nodes if you're mixing sources.

    Two details make it feel native rather than a hack. First, it validates the path when you wire it up - a typo or empty folder surfaces as "No image provided or found" before you queue, not mid-run. Second, it hashes the actual files on each run, so if you add or swap images in your reference folder, ComfyUI knows the node's output changed and re-executes downstream instead of serving you cached results. That last bit is the difference between "works in a demo" and "actually usable with a folder you edit."

    Install

    It's part of the pack, so one install:

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

    or ComfyUI Manager → search "PhotoMaker Plus". Restart, and the node appears under the image category - it's the one node in this pack that doesn't live under PhotoMaker. No models, no extra dependencies beyond what the pack already needs.

    When you'd reach for it - and when you wouldn't

    Reach for it when your references live on disk outside ComfyUI's input folder, when you're iterating over a directory of candidates, or when you're automating generations from a script that drops new reference images into a folder. That's the workflow it's built for.

    For a single reference photo you already have loaded, honestly, just use LoadImage - the path node adds nothing for that case. And remember its job is only preparation: it resizes and normalizes for the 224×224 CLIP Vision encoder but does zero face detection. In V2 workflows the face detection happens later, inside the encode node, using the InsightFace loader. If you batch-drop a folder of images and V2 complains about no face found, that's the images, not this node - check what's actually in the folder.

    If you find yourself building a face-reference library for consistent-character work, this node plus a well-named folder is a tidy little system. SDXL-era trick, but still the nicest way to batch-feed PhotoMaker.

    Categoryimage

    Inputs (3)

    NameTypeDefaultDescription
    pathSTRING
    interpolationCOMBOlanczos6 options: nearest, bilinear, box, bicubic, lanczos, hamming
    crop_positionCOMBOcenter6 options: top, bottom, left, right, center, pad

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE