ERNIE Image Aesthetic Score (CRT)
Score every image 0-100 in one pass — the ERNIE aesthetic filter that curates for you
- Image(s)
- aesthetic_score
- aesthetic_score_text
- Best score
- Above Threshold
If you've ever run a batch of generations and wished something would just throw away the ugly ones, this is that something. ErnieImageAestheticScore scores every image in a batch from 0 to 100 using Baidu's ERNIE-Image-Aes model - an aesthetic reward model, not a generation model - and hands back the scores plus the winners. It's a curator node, the kind that turns "generate 200 images, eyeball the good ones" into "generate 200 images, keep everything above 80."
How it works
On first run it downloads baidu/ERNIE-Image-Aes from HuggingFace - the node's description says plainly that the model downloads on first use, so expect a wait and a few GB of disk. It then runs each input image through the model and reads a softmax over the model's score tokens to produce a 0–100 estimate, in batch order. You can choose the attention backend (auto prefers FlashAttention 2 when it's installed, otherwise falls back to eager), and you control what happens to the model in memory afterward.
The keep_model_loaded and offload_to_cpu toggles are worth understanding because they're the difference between "fast repeats" and "low VRAM": keeping the model resident makes the next run nearly instant but pins a chunk of VRAM, while offloading to CPU keeps it cached in system RAM instead of fully releasing it - slower than resident, faster than cold. For a one-off curation pass, leave both off and let it release everything.
The inputs that matter
Image(s)- the batch to score.Threshold(default 50) - images scoring strictly above this make it into theAbove Thresholdoutput.Path Save If above threshold- an optional output folder; anything over the threshold gets saved there, relative paths land underComfyUI/output. Leave empty to disable saving.Extension-jpgorpngfor whatever gets saved.
Outputs
Four of them, and they're all useful:
aesthetic_score- an INT list, one per input image, in batch order.aesthetic_score_text- the same scores as strings, which is what you want if you're feeding them into a text preview or string pipeline.Best score- the single highest-scoring image, as a plain IMAGE.Above Threshold- every image that beat the threshold, batched as an IMAGE.
A common pattern: hook aesthetic_score into a boolean filter to gate a save node, and send Above Threshold on to your "keeper" folder. You can also chain it in a loop - generate a batch, score it, keep only the top slice, and use the best image as the seed for a refinement pass.
Install
Standard CRT-Nodes install:
cd ComfyUI/custom_nodes
git clone https://github.com/PGCRT/CRT-Nodes
pip install -r requirements.txt
Or ComfyUI Manager → search CRT-Nodes, then restart. This node is one of the few in the pack that genuinely needs the heavy requirements - it uses HuggingFace transformers, so if you skipped parts of requirements.txt to avoid bloat, make sure transformers and accelerate are installed or the node won't import. And remember: the first scoring run is a model download, not a hang.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| Image(s) | IMAGE | — | |
| Threshold | INT | 501–99 | Images with a rounded score strictly greater than this value are returned and optionally saved. |
| Path Save If above threshold | STRING | Optional output folder for images above Threshold. Relative paths are resolved below ComfyUI/output; leave empty to disable saving. | |
| Extension | COMBO | jpg | 2 options: jpg, png |
| attention_backend | COMBO | auto | Attention implementation used when loading ERNIE. Auto prefers FlashAttention 2 when installed and compatible, otherwise eager attention. |
| keep_model_loaded | BOOLEAN | false | Keep the model resident on the active device after scoring for faster subsequent runs at the cost of VRAM. |
| offload_to_cpu | BOOLEAN | false | When keep_model_loaded is off, retain the cached model on CPU instead of releasing it completely. This reduces reload time but uses system RAM. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| aesthetic_score | INT | — |
| aesthetic_score_text | STRING | — |
| Best score | IMAGE | — |
| Above Threshold | IMAGE | — |