Nodes/Head-Orientation-Node - by PabloGFX/Head Orientation Node - by PabloGFX
ComfyUI Node

Head Orientation Node - by PabloGFX

A ComfyUI node in image/PabloGFX with 15 inputs and 2 outputs.

By lazniak·Created 2 years ago·Updated 3 months ago· 11
Head Orientation Node - by PabloGFX
  • image
  • reference_images
  • sorted_images
  • data
sort_sourcereferences
sort_modesimilarity_to_refs
similarity_metricmin_to_any_ref
output_count0
data_contentoutputs
data_formatcompact
decimals2
angle_unitdegrees
min_detection_confidence0.30
detection_max_side1280
include_indexfalse
include_distancefalse
include_headerfalse
Categoryimage/PabloGFX

Inputs (15)

NameTypeDefaultDescription
imageIMAGE
reference_imagesIMAGE
sort_sourceoptCOMBOreferencesWhich batch is placed in `sorted_images`. references (default): treat `image` as the query / target pose and `reference_images` as the candidate pool. sorted_images = candidates reordered by similarity to the query. Use this when you have one main image and want the most similar candidates from a pool. inputs (legacy v1.x semantic): sort the `image` batch by similarity to `reference_images`. sorted_images = reordered inputs.
sort_modeoptCOMBOsimilarity_to_refsHow the pool is ordered. similarity_to_refs (default): sort by similarity to the target batch, closest first. reverse_similarity: same metric, farthest first. match_references: greedy 1-to-1 match; output count = target count. as_is: pass the pool through in its original order.
similarity_metricoptCOMBOmin_to_any_refDistance metric used for similarity sorting. min_to_any_ref: distance to the nearest target. mean_to_refs: average distance to all targets. first_ref_only: distance to the first target only.
output_countoptINT00–4096Force the number of output images. 0 = auto: pool count for similarity/reverse/as_is modes, target count for match_references. Excess items are truncated; missing items repeat the last.
data_contentoptCOMBOoutputsWhat goes into the `data` string. outputs (default): one line per sorted output image, in sorted order. references: one line per `reference_images` item, in input order. inputs: one line per `image` item, in input order. paired: one line per sorted output with the closest match from the opposite batch.
data_formatoptCOMBOcompactcompact (default, legacy v1.1.0): [pitch,yaw,roll] per line. labeled: 'pitch=X yaw=Y roll=Z' per line. csv: comma-separated values (optional header). json: JSON array of objects. verbose: multi-line human-readable per item.
decimalsoptINT20–6Decimal places for angles and distance.
angle_unitoptCOMBOdegreesOutput unit for angles and distance.
min_detection_confidenceoptFLOAT0.300.05–1MediaPipe face detection confidence threshold. Lower = more permissive (catches dim / cropped / cluttered faces, may produce false positives). Default 0.3 is more forgiving than the original 0.5 and works better for dark portraits, faces in caps, etc.
detection_max_sideoptINT1280256–8192Longest side (px) the image is downscaled to BEFORE running MediaPipe face detection. Default 1280. MediaPipe's BlazeFace works on ~128 px internal tiles and often misses faces in very large images (e.g. 4K phone photos). On failure the node also tries other preset sizes (1600 / 960 / 640 / 480) automatically. The final sorted_images output is always at the ORIGINAL resolution.
include_indexoptBOOLEANfalsePrepend the 1-based row index to each line.
include_distanceoptBOOLEANfalseAppend the angular distance from this row's orientation to the closest item in the OPPOSITE batch.
include_headeroptBOOLEANfalsecsv format only: prepend a header row with column names.

Outputs (2)

NameTypeDescription
sorted_imagesIMAGE
dataSTRING