Loader
The whole pack hangs off this one loader — grab CLIP here
- MODEL
- PROCESSOR
Every node in the ComfyUI-ClipScore-Nodes pack is useless until you've run this one first. The Loader (HaojihuiClipScoreLoader) is the pack's only model-loading step: it pulls in OpenAI's CLIP model and its preprocessing pipeline, and every other node in the pack - the image processors, the text processor, the scorer - takes one or both of its outputs as input. No CLIP model, no scores, nothing.
This is a small, scrappy pack. It was published in January 2024, has a single commit, and its README is basically one workflow screenshot plus donation buttons. There's no requirements.txt, no install docs, no maintenance since. That means the one thing you must get right, you get right here: actually having OpenAI's clip Python package installed, because the source does import clip at the top and nothing else will install it for you.
What it actually does
The Loader is a thin wrapper around OpenAI's clip.load(). You give it a model name, it downloads the weights (from OpenAI's servers, on first run - the default ViT-B/32 is a few hundred MB), and hands back a ready-to-use model plus a preprocessing function.
Under the hood it's honestly a few lines:
model, preprocess = clip.load(model, device=device)
return (model, preprocess)
That's the whole node. Which is fine - it's a hub, and the pack's value lives in the nodes that consume its outputs.
The inputs that matter
- model - a text box, default
ViT-B/32. You can point it at other OpenAI CLIP names likeViT-B/16,ViT-L/14, orRN50, but note this is the OpenAI package, not the broader ecosystem of fine-tuned CLIPs. Whatever you type, it fetches from OpenAI on first use. - device -
cudaorcpu. Self-explanatory. - dtype -
float16,bfloat16, orfloat32. Here's the first real gotcha: this dropdown does nothing. The code computes the dtype and then never passes it toclip.load(), which doesn't accept one anyway. On CPU it's hard-forced to float32 regardless. So pick whatever and move on - the model loads in whatever precisionclip.loaddecides.
Outputs
Two sockets, and they matter because the whole pack is wired through them:
- MODEL (type
PS_MODEL) - goes into every processor and into the ImageScore node. - PROCESSOR (type
PS_PROCESSOR) - the CLIP preprocessing (resize, center-crop, normalize). Goes into the three image processors.
Installing it
Install the pack the usual way - via ComfyUI Manager (search "ComfyUI-ClipScore-Nodes") or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/azure-dragon-ai/ComfyUI-ClipScore-Nodes
# then restart ComfyUI
Then the part that trips people up: the pack has no requirements.txt, so you must install the clip package yourself, into the same Python environment ComfyUI runs in:
pip install git+https://github.com/openai/CLIP.git
If you only install the pack and skip that step, ComfyUI will fail with something like ModuleNotFoundError: No module named 'clip' the moment the nodes try to run. Also note the weights come from OpenAI directly, so if you're behind a firewall or a Chinese mirror setup (the author's own source has a # set HF_ENDPOINT=https://hf-mirror.com comment - which doesn't even apply, since clip.load hits openai.com, not Hugging Face), you may need to find another route to the weights.
If you're new to this whole scoring thing, the realistic picture is: CLIP-based image scoring was a 2024-era novelty, and it's a niche corner of the ecosystem now. This pack is a fun toy for ranking or comparing images in CLIP space - not a maintained quality metric. For that, treat it as what it is: a tiny wrapper around a well-known model.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model | STRING | ViT-B/32 | — |
| device | COMBO | 2 options: cuda, cpu | |
| dtype | COMBO | 3 options: float16, bfloat16, float32 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| MODEL | PS_MODEL | — |
| PROCESSOR | PS_PROCESSOR | — |