Aesthetics
The batch ranker that can't find its own weights
- image
- best
The idea here is genuinely useful: feed a batch of image variations plus the prompt you asked for, and this node hands back the single image that best matches your text. If you've ever queued a dozen seeds hoping one would be a keeper, you know exactly why that's worth having. The catch is that this particular implementation ships pointed at a file that lives on its author's hard drive.
What it is. Aesthetics (v1, from the comfyui-snek-nodes pack) is an image-picker, not a generator. You give it image - a batch of IMAGE tensors, the kind that pours out of a "Batch" or from a KSampler with multiple latents - plus a text prompt. It scores every frame against the text and returns only the best one, as a single IMAGE out of the best output. Wire that straight into a VAE decode or a preview and you've automated the "pick the winner" step of a variation batch.
How it works. It's CLIP ViT-L/14, loaded with OpenAI's CLIP repo, then patched with the HPS-tuned weights from the align_sd project (hpc.pt). Every image in the batch gets preprocessed and encoded, the text gets tokenized and encoded, and it computes the cosine similarity between image features and text features. Argmax wins. If the text says "neon cyberpunk alley at night," you get the variation whose CLIP embedding is closest to that. Simple, explainable, and surprisingly effective at ranking things CLIP understands.
The inputs and outputs that matter. Just two required inputs and one output:
image(IMAGE) - your batch of variations.text(STRING, multiline) - the prompt you judge against. This is a soft judge, so it doesn't need to be the exact generation prompt; a short, descriptive phrase usually scores better.best(IMAGE) - the single winning frame.
That's the whole surface. No strength slider, no threshold, nothing to tune.
Why it probably crashes on your machine. Look at the source and you'll find this:
self.params = torch.load(r"P:\python\notebooks\Eagle_Scripts\align_sd\hpc.pt")['state_dict']
That's a hardcoded Windows path on the author's machine. Unless hpc.pt happens to exist at P:\python\notebooks\Eagle_Scripts\align_sd\hpc.pt, torch.load throws a FileNotFoundError the moment the node runs. To make it work you'd download hpc.pt from the tgxs002/align_sd repo and edit nodes/aesthetic.py to point at it. If that sounds like more surgery than the feature is worth, you're right - which is why the pack's own v2 exists.
Installing it. The pack is sneccc/comfyui-snek-nodes. In ComfyUI Manager, search "comfyui-snek-nodes" and install; or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/sneccc/comfyui-snek-nodes
Restart ComfyUI. Note the pack's requirements.txt pulls git+https://github.com/openai/CLIP.git and hpsv2 into your main Python environment - the classic no-isolation dependency setup that makes custom nodes a house of cards. First run also downloads the ViT-L/14 weights, so give it a minute.
Bottom line. This is a personal script that leaked into a single-commit pack with an empty README and zero community adoption. The idea is sound; the shipping is not. Unless you enjoy editing absolute paths inside node source, skip v1 and reach for Aesthetics V2 instead.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| text | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| best | IMAGE | — |