ComfyUI Node
Head Orientation Node - by PabloGFX
A ComfyUI node in image/PabloGFX with 15 inputs and 2 outputs.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| reference_images | IMAGE | — | |
| sort_sourceopt | COMBO | references | Which 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_modeopt | COMBO | similarity_to_refs | How 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_metricopt | COMBO | min_to_any_ref | Distance 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_countopt | INT | 00–4096 | Force 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_contentopt | COMBO | outputs | What 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_formatopt | COMBO | compact | compact (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. |
| decimalsopt | INT | 20–6 | Decimal places for angles and distance. |
| angle_unitopt | COMBO | degrees | Output unit for angles and distance. |
| min_detection_confidenceopt | FLOAT | 0.300.05–1 | MediaPipe 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_sideopt | INT | 1280256–8192 | Longest 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_indexopt | BOOLEAN | false | Prepend the 1-based row index to each line. |
| include_distanceopt | BOOLEAN | false | Append the angular distance from this row's orientation to the closest item in the OPPOSITE batch. |
| include_headeropt | BOOLEAN | false | csv format only: prepend a header row with column names. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| sorted_images | IMAGE | — |
| data | STRING | — |