Nodes/ComfyUI-BrainDead/BD Face Strip Compose
ComfyUI Node

BD Face Strip Compose

Stitch 4 head-view photos into a single horizontal head-wrap strip via landmark-anchored cylindrical unwrap. Per detected view (front/left/right): TPS warp on all 478 MediaPipe landmarks → strip space. Cosine-bell confidence around the view's strip-center keeps each side dominant in its own slice. Rear views (undetected) are split at rear_split_x and slotted onto the strip edges with low confidence; the seam between rear-slot and the adjacent side view is added to inpaint_mask so Qwen redraws it. Outputs: - strip_image: stitched composite - coverage_mask: where the strip has any data - inpaint_mask: where Qwen SHOULD paint (low-coverage areas AND the rear-seam bands) - status: per-view diagnostic

By BizaNator·Created 7 months ago·Updated 16 days ago· 14
BD Face Strip Compose
  • images
  • landmarks_batch
  • rear_mask
  • strip_image
  • coverage_mask
  • inpaint_mask
  • status
front_index-1
left_index-1
right_index-1
rear_index-1
strip_width4096
strip_height1024
rear_split_x0.50
rear_extent0.18
rear_confidence0.50
rear_blend_band0.08
rear_flip_lrfalse
rear_seam_width0.04
bell_sigma0.22
canonical_modecylindrical
Category🧠BrainDead/FaceWrap

Inputs (17)

NameTypeDefaultDescription
imagesIMAGESource photo batch — same order/count as the LANDMARKS_BATCH (typically 4 images: front, left, right, rear).
landmarks_batchBD_LANDMARKS_BATCHFrom BD_FaceLandmarks. By default, view_hint per view picks which strip slot each image goes to. Override with the per-slot index inputs below when MediaPipe's yaw classifier misfires.
front_indexINT-1-1–63Image index for the FRONT slot. -1 = auto (use the first view classified as 'front'). Set to e.g. 0 to force image 0 into the front slot even if MediaPipe classified it differently.
left_indexINT-1-1–63Image index for the LEFT slot (subject's left side, lands at strip-right). -1 = auto.
right_indexINT-1-1–63Image index for the RIGHT slot (subject's right side, lands at strip-left). -1 = auto.
rear_indexINT-1-1–63Image index for the REAR slot. -1 = auto (first undetected view, or first view classified as 'rear').
strip_widthINT4096512–16384Output strip width (longitude direction).
strip_heightINT1024256–4096Output strip height (latitude direction).
rear_split_xFLOAT0.500–1Column in the rear image where to split (0=left edge, 1=right edge). Right of the split → leftmost strip slot; left of the split → rightmost strip slot.
rear_extentoptFLOAT0.180–0.35Fraction of strip width occupied by each rear half. 0.18 → each rear half takes ~18% of the strip (combined rear = ~36%, reaching the canonical ear/temple region where face and rear naturally meet anatomically).
rear_confidenceoptFLOAT0.500–1Fixed confidence value applied to the rear slots. 0.5 default keeps rear visible while letting the side-view blend band still register. 0 → rear is pure fill that Qwen paints over.
rear_blend_bandoptFLOAT0.080–0.2Width of the smooth blend band at the rear-slot boundary (fraction of strip width). Both the side-view bell and the rear-mask ramp linearly across this band so they cross at 50/50. Wider → longer crossfade region (better when rear/face colors differ a lot, but the underlying mix is still imperfect — that's what Qwen finalize fixes). 0 → hard cutoff.
rear_flip_lroptBOOLEANfalseSwap which half of the rear image goes to which strip edge. Default assumes a standard rear photo (photographer behind subject, same facing). Toggle if your rear photo is mirrored or shot from the front (e.g. with the subject turned around).
rear_maskoptMASKHead-silhouette MASK for the rear image — typically from BD_SAM3MultiPrompt('head') or any head/person segmentation. When provided, each rear half gets perspective-warped so its head silhouette fills the strip slot from edge to edge (matches the cylindrical warp geometry of the side views). Without it, the rear is plain cv2.resize-stretched (looks pasted on).
rear_seam_widthoptFLOAT0.040–0.2Width of the inpaint-flagged seam band on each side of the rear slots, as a fraction of strip width. 0 disables.
bell_sigmaoptFLOAT0.220.05–0.5Half-width of the per-view cosine confidence bell (fraction of strip width). 0.22 keeps each side view dominant in its own slice without extrapolating across the centerline; smaller = sharper handoff (also reduces 'ghost face' at the ears, where side-TPS can extrapolate occluded back-of-head landmarks). Larger = wider but more cross-contamination between views.
canonical_modeoptCOMBOcylindricalHow to project the canonical face landmarks into strip space. cylindrical = atan2(x,z) longitude, y latitude. (equirectangular / JSON layout: future.)

Outputs (4)

NameTypeDescription
strip_imageIMAGE
coverage_maskMASK
inpaint_maskMASK
statusSTRING