Nodes/ComfyUI-QualityGate/Composite Rank Folder (streaming, memory-safe)
ComfyUI Node

Composite Rank Folder (streaming, memory-safe)

Rank hundreds of generated candidates without nuking your RAM

By nobu1990·Created 2 months ago·Updated 2 months ago· 0
Composite Rank Folder (streaming, memory-safe)
  • face_reference
  • proportion_reference
  • top_images
  • best_image
  • report
folder
w_identity1.0
w_proportion1.0
w_sharpness0.5
tolerance0.020
top_k5

CompositeRank is great until your "just a few candidates" becomes three hundred. Feed three hundred images through a batch node and ComfyUI is happy to hold all of them in VRAM and RAM at once - and the sampler that produced them probably already blew past your limits. That's exactly the problem this node exists to dodge.

Composite Rank Folder scores the same three axes - identity (ArcFace), head-size proportion (MediaPipe Pose), sharpness - but instead of taking an in-memory IMAGE batch, it reads images from a folder one at a time: load, score, discard. Memory usage stays pinned to roughly top_k images no matter how many files pile up. It's the second half of the pack's two-stage design, and it's the node you reach for when the candidate count gets serious.

The two-stage trick

The pack's README frames it around VRAM: if you generate a big batch in one queue run, the sampler holds all the latents at once and OOMs. So you split the job.

  1. Stage 1 - generate: keep RepeatLatentBatch small, decode and write each run's output to a folder with SaveToFolder. Queue it as many times as you like; candidates accumulate on disk, numbering continues automatically.
  2. Stage 2 - rank: this node streams that same folder, one image at a time, and returns only the top k.

The pack ships both sides as example workflows (qwen_FAST_generate_candidates.json and stage2_rank_folder.json). Nothing stops you from using this node standalone - if you already have a folder of renders, just point it at them.

Inputs and outputs

It shares the scoring inputs with CompositeRank: face_reference, proportion_reference, the weights w_identity / w_proportion / w_sharpness, and tolerance. Two things are different:

  • folder - a dropdown of subfolders under ComfyUI's output/ directory, so you pick rather than type a path. That's the constraint: if your images aren't in an output/ subfolder, they won't show up here (drop them in via SaveToFolder or move them there).
  • top_k - how many to keep. Default 5, up to 256.

Outputs are top_images (the kept batch, best first), best_image (the single winner, ready for SaveImage), and report, a text breakdown with per-image axis scores.

What to watch for

Same dependency story as the rest of the pack, with the same silent failure mode: if insightface + buffalo_l aren't installed, the identity axis reports skip and contributes nothing - so the ranking degrades to proportion + sharpness without telling you loudly. If mediapipe is missing, proportion is what drops out. Read the report output once per setup to confirm all three axes actually ran.

One honest caveat: this is a young, small pack with no community footprint yet, so the streaming path hasn't been battle-tested by thousands of users. For a few dozen images, plain CompositeRank is simpler. For hundreds, this is the one - it's the only node in the pack that deliberately trades throughput for a flat memory curve, and that trade is exactly right for the "generate in waves, rank at the end" workflow.

CategoryQualityGate

Inputs (8)

NameTypeDefaultDescription
face_referenceIMAGE
proportion_referenceIMAGE
folderCOMBO1 options: (サブフォルダなし)
w_identityFLOAT1.00–3
w_proportionFLOAT1.00–3
w_sharpnessFLOAT0.50–3
toleranceFLOAT0.0200.005–0.1
top_kINT51–256

Outputs (3)

NameTypeDescription
top_imagesIMAGE
best_imageIMAGE
reportSTRING