ComfyUI Node

Adv_Scoring

A number for 'is this pretty?' — with a built-in reject flip

By randjtw·Created 2 years ago·Updated 2 years ago· 0
Adv_Scoring
  • image
  • NUMBER
  • FLOAT
  • STRING
  • IMAGE
model_namechadscorer.pth
limit0.00

Aesthetic scorers are the closest thing ComfyUI has to a critic with an opinion. Feed one an image and it hands back a number that roughly means "how good does this look?" - exactly the signal you want when you're grinding out forty variations and need to rank them, or when you're building an auto-curation loop that keeps only the winners. Adv_Scoring is this pack's entire contribution: one node, an image in, a score out three different ways, and an odd party trick in the IMAGE output that I'll get to in a second.

How it works

The mechanism is the classic "improved aesthetic predictor" setup that made the rounds in early 2024, when everyone was trying to build a Midjourney-style score the batch, keep the best pipeline. It works in two stages: OpenAI's CLIP ViT-L/14 encodes the image into a 768-dim embedding, that embedding gets L2-normalized, and a tiny multilayer head (768 → 1024 → 128 → 64 → 16 → 1) maps it to a single score, rounded to two decimals. That head is the LAION/AVA lineage of rating heads - the same family as the sac and ava+logos weights people were passing around then. The scorer itself is a few megabytes. The expensive part is CLIP, and this node reloads CLIP ViT-L/14 from disk on every run, so each execution costs you a couple of seconds and a noticeable VRAM spike.

Inputs and outputs

  • model_name - a dropdown of every .pth in ComfyUI/models/aesthetic/, defaulting to chadscorer.pth (from grexzen/SD-Chad). The canonical alternative is ava+logos-l14-linearMSE.pth from christophschuhmann/improved-aesthetic-predictor. The node registers the aesthetic model folder itself, but that folder doesn't exist by default - and nothing in this pack downloads a model for you. You supply it.
  • image - an IMAGE tensor, straight off a VAE Decode. One quirk: only the first frame of a batch gets scored (image[0]).
  • limit - the party trick. If the score comes in below this threshold, the IMAGE output is returned inverted (1 - image). The default is 0.0, and real scores from these heads usually land in the 4–8 range, so at the default the flip never fires. Set it to something like 6 and the node silently negates anything that misses your bar. It's a cheap built-in reject flag - and honestly you'll usually wire the NUMBER output into a reroll condition instead, which is the less surprising way to do the same job.

Outputs: NUMBER, FLOAT, and STRING all carry the same score in different types - STRING into a text display, NUMBER into a math chain, take your pick - plus IMAGE, which is a passthrough unless you tripped the limit.

Installing it

ComfyUI Manager → search "advance-aesthetic-score", or:

cd ComfyUI/custom_nodes
git clone https://github.com/randjtw/advance-aesthetic-score

Then restart ComfyUI. The repo ships no requirements.txt, so you have to add its dependencies yourself into your ComfyUI Python environment:

pip install "git+https://github.com/openai/CLIP.git" pytorch-lightning

Then drop a scorer .pth into ComfyUI/models/aesthetic/. The README being a single line won't help you find the model, which is why people get stuck here.

Where people get burned

  • CUDA only. The code hardcodes "cuda" - model.to("cuda"), torch.cuda.FloatTensor, CLIP loaded onto cuda. On a CPU-only install this just crashes. That was the standing complaint about the entire scorer genre back in 2024, and it's unchanged here.
  • State-dict shape errors if you drop in a scorer head that isn't the 768-dim MLP architecture it builds. Stick to chadscorer or the sac/ava+logos heads and you're safe.
  • Don't cross-compare scores across checkpoints. chadscorer and the sac models aren't calibrated to each other, so "6.8" on one is not "6.8" on the other. Use it as a relative ranker within a single model, not as a universal truth meter.

Treat the number as a relative signal - great for sorting a batch, worthless as gospel. For ranking a stack of candidates, PickScore became the community's pick of the litter; this one is the lean single-node option that also has the world's most literal "reject" toggle.

Categorymynode/scoring

Inputs (3)

NameTypeDefaultDescription
model_nameCOMBOchadscorer.pth0 options:
imageIMAGE
limitFLOAT0.00

Outputs (4)

NameTypeDescription
NUMBERNUMBER
FLOATFLOAT
STRINGSTRING
IMAGEIMAGE