Nodes/ComfyUI-Stash/VR Face Rectify
ComfyUI Node

VR Face Rectify

Undistort VR faces for swapping. For each VR180-SBS frame, detects faces in each eye, selects the target face(s) (ReActor-style order/index/gender), and rectifies each selected face to a flat patch a face swapper can handle. Outputs the patch batch (feed to ReActor) and a VR_RECTIFY_MAP for un-rectify. Selection happens HERE, at the frame level, where ranking ("largest", "rightmost") is meaningful -- ReActor only ever sees one-face patches, so its own order/index options can't isolate a character once we've sliced. Defaults ('0' / 'large-small') emit just the dominant face per eye: the usual one-character-per-job case. A wired OPTIONS input overrides the widgets.

By zyquon·Created about a year ago·Updated 2 months ago· 1
VR Face Rectify
  • image
  • options
  • patches
  • rectify_map
  • count
input_layout
projection
patch_fov80
patch_size768
fisheye_fov135
input_faces_orderlarge-small
input_faces_index0
detect_gender_inputno
CategoryStash/VR

Inputs (10)

NameTypeDefaultDescription
imageIMAGEVR180-SBS frame(s); a batch is allowed
input_layoutoptCOMBOmono = whole frame is one eye (per-eye pipelines); sbs = left|right halves; tb = top|bottom halves
projectionoptCOMBOSource VR projection of each eye
patch_fovoptINT8020–150Field of view (deg) of the flat patch; ~75-80 suits ReActor
patch_sizeoptINT768128–2048Square patch edge in pixels
fisheye_fovoptFLOAT13590–220Full fisheye FOV (deg); only used for fisheye projection
input_faces_orderoptCOMBOlarge-smallHow to rank faces in each eye before picking by index (matches ReActor). Ignored if an OPTIONS input is wired.
input_faces_indexoptSTRING0Which ranked face(s) to swap: "0" (default = dominant face), "0,1", or "all". Selection is frame-level -> one patch per selected face. Ignored if an OPTIONS input is wired.
detect_gender_inputoptCOMBOnoOnly rectify faces of this gender (insightface). "no" = any. Ignored if an OPTIONS input is wired.
optionsoptOPTIONSOptional ReActor-compatible OPTIONS dict; when wired it overrides the three selection widgets above.

Outputs (3)

NameTypeDescription
patchesIMAGE
rectify_mapVR_RECTIFY_MAP
countINT