Nodes/ComfyUI-PortraitDatasetTools/Portrait Quality Score (face size / clarity / grain gate)
ComfyUI Node

Portrait Quality Score (face size / clarity / grain gate)

A ComfyUI node in image/analysis with 17 inputs and 8 outputs.

By BillyBGit·Created 2 days ago·Updated 2 days ago· 0
Portrait Quality Score (face size / clarity / grain gate)
  • image
  • image_pass
  • image_reject
  • accepted
  • hard_reject
  • needs_refine
  • sr_short_edge
  • report
  • suffix
◄hard_floor_face_px200►
◄min_face_px500►
◄min_clarity60►
◄max_grain2.5►
◄sr_face_target_px800►
◄sr_max_short_edge2048►
◄stages1►
◄forceoff►
◄accepted_infalse►
◄hard_reject_infalse►
◄filename►
◄csv_path►
◄min_source_grain0.15►
◄min_texture_after_sr0.60►
◄review_texture_below0.85►
◄suffix_in►
Categoryimage/analysis

Inputs (17)

NameTypeDefaultDescription
imageIMAGE—
hard_floor_face_pxINT2000–4096Face short edge below this is rejected outright, no refine (0 = off). Set on the FIRST stage only.
min_face_pxINT5000–4096Face short edge needed to pass.
min_clarityFLOAT600–10000Variance of Laplacian on the face at normalised scale. ~20 = soft, ~60 = acceptable, 150+ = crisp.
max_grainFLOAT2.50–50Noise sigma on flat skin at normalised scale. <0.7 clean, >2.5 visibly grainy.
sr_face_target_pxINT800256–2048Face size the super-res pass should aim for.
sr_max_short_edgeINT2048512–4096Cap on the SR short edge. 2048 is the proven SeedVR2 7b setting on 16GB.
stageSTRINGs1Label for the log / CSV row. Must end in the stage number (s1, s2, s3) for 'force' to work.
forceCOMBOoffManual override, ignores all thresholds. accept = keep as-is at stage 1; refine_1x = one SR pass then keep; refine_2x = two SR passes then keep. Wire one primitive into every stage so they agree.
accepted_inoptBOOLEANfalse—
hard_reject_inoptBOOLEANfalse—
filenameoptSTRING—
csv_pathoptSTRINGAppend one row per scoring here (empty = off).
min_source_grainoptFLOAT0.150–5Stage 1 only. Skin noise below this = no sensor noise at all: illustration, airbrushed export, AI image. Hard reject, no SR (it would only produce wax). 0 = off.
min_texture_after_sroptFLOAT0.600–5Stages 2+. Skin texture below this after super-res = waxy (the source had no real pores to recover). Rejected with reason. 0 = off.
review_texture_belowoptFLOAT0.850–5Stages 2+. Texture between min_texture_after_sr and this = accepted but the suffix output becomes '_rev' so you can eyeball those files. 0 = off.
suffix_inoptSTRINGPrevious stage's suffix output; carried through on passthrough so a '_rev' raised at s2 reaches the filename.

Outputs (8)

NameTypeDescription
image_passIMAGE—
image_rejectIMAGE—
acceptedBOOLEAN—
hard_rejectBOOLEAN—
needs_refineBOOLEAN—
sr_short_edgeINT—
reportSTRING—
suffixSTRING—