BD Face Mosaic Compose
Stitch head views side-by-side without an unwrap
- images
- landmarks_batch
- rear_mask
- strip_image
- coverage_mask
- inpaint_mask
- status
Not every face-wrap job needs a mathematically correct unwrap. BD Face Mosaic Compose is the Photoshop-style alternative: it takes your 4 head-view photos, cuts them, aligns them, and pastes them side-by-side with feathered overlap into a strip. Each face stays geometrically intact - a similarity transform (rotate + scale + translate) gets the eyes horizontal and the face sized to the strip, but there's no cylindrical unwrap and no TPS deformation. The pack's own framing says it best: when the result is good enough that Qwen finalize is only doing cleanup, this is the node you want; when you need a true cylindrical unwrap, use BD Face Strip Compose instead.
How it works
For each detected view (front/left/right), a similarity transform is computed from the landmarks so the eyes are horizontal, the face height matches face_height_ratio × strip_height, and the eye-center lands at its target X column (front_center_x, left_center_x, right_center_x). Each view gets a feathered face-oval alpha and they're composited by alpha-weighted average - overlaps blend smoothly across the feather band, no visible cut lines. align_to_front (on) anchors each side view to a shared landmark (the tragion) so everything lines up at the right scale.
The rear photo is handled separately: split at rear_split_x and slotted at the strip edges. If you wire rear_mask (a head silhouette from BD_SAM3MultiPrompt or similar), each rear half is perspective-warped so its silhouette fills the slot; without it, plain cv2.resize.
The inputs you'll actually touch: the images batch (front, left, right, rear), the landmarks_batch, the four per-slot index overrides (front_index etc., -1 = auto) for when the classifier misassigns, and the strip/placement geometry (strip_width, strip_height, eye_target_y, face_height_ratio, feather_radius, and the rear knobs).
Outputs: strip_image, coverage_mask, inpaint_mask (same contract as the strip composer - feed it into the Qwen-fill subgraph), and status.
Installing
ComfyUI Manager → search "BrainDead" → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead
pip install -r requirements.txt
Restart. Requires OpenCV (cv2) and the MediaPipe landmarker bundle (auto-downloaded by BD Face Landmarks).
Where people get burned
The whole trick is alignment, so feed it photos where the subject's head is roughly the same size and pose across views - if the front is huge and the side is tiny, align_to_front can only do so much. And remember what this node is not: it won't fix perspective or wrap geometry around the head. If your side views don't overlap the front by a good third (left_center_x 0.68 / right_center_x 0.32 are the defaults that get that overlap), raise the feather and overlap before you blame Qwen.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Source photo batch — typically 4 images: front, left, right, rear. | |
| landmarks_batch | BD_LANDMARKS_BATCH | From BD_FaceLandmarks. Provides per-view landmark positions for the similarity transform. | |
| front_index | INT | -1-1–63 | Image index for the FRONT slot. -1 = auto. |
| left_index | INT | -1-1–63 | Image index for the LEFT slot (subject's left, lands at strip-right by convention). -1 = auto. |
| right_index | INT | -1-1–63 | Image index for the RIGHT slot (subject's right, lands at strip-left). -1 = auto. |
| rear_index | INT | -1-1–63 | Image index for the REAR slot. -1 = auto. |
| strip_width | INT | 4096512–16384 | — |
| strip_height | INT | 1024256–4096 | — |
| front_center_x | FLOAT | 0.500–1 | Strip-X column for the FRONT view's eye-center (0.5 = strip center). |
| left_center_x | FLOAT | 0.680–1 | Strip-X column for the LEFT view (subject's left face). 0.68 lets the left view's hull overlap the front by ~⅓ — that's the overlap region Qwen smooths and where shared landmarks meet. |
| right_center_x | FLOAT | 0.320–1 | Strip-X column for the RIGHT view. 0.32 mirrors left_center_x — same overlap with front. |
| eye_target_y | FLOAT | 0.400–1 | Strip-Y row where every view's eye-center lands. 0.4 = 40% from top. Lower → more headroom above; higher → more neck/chin below. |
| face_height_ratio | FLOAT | 0.600.1–1 | Target face height (chin↔forehead distance) as a fraction of strip height. 0.60 makes the face large enough that adjacent views overlap meaningfully at their face hulls (which is where shared landmark alignment happens). |
| align_to_frontopt | BOOLEAN | true | When ON: each side view's transform is anchored to a shared landmark (subject's-left tragion for the LEFT view, subject's-right tragion for the RIGHT view) so it lands at the SAME strip-space position as the front view placed it. This is literal 'align by face points' stitching — the left side of the front photo and the inner edge of the left-profile photo meet at the same subject feature. When OFF: each view independently targets its configured center_x (looser fit but easier to position manually). |
| feather_radiusopt | INT | 300–200 | Gaussian-blur radius for the per-view face-hull alpha. 30 = moderate feathered selection — soft enough that adjacent views crossfade smoothly in the overlap region, but each view's face is still visible as itself. Increase for more blending; decrease (e.g. 10) for visible seams. |
| rear_extentopt | FLOAT | 0.150–0.3 | Fraction of strip width per rear half (each side). |
| rear_split_xopt | FLOAT | 0.500–1 | Column in the rear photo to split for the two halves. |
| rear_flip_lropt | BOOLEAN | false | Swap which rear half goes to which strip edge. |
| rear_maskopt | MASK | Head silhouette for rear photo (e.g. from BD_SAM3MultiPrompt('head')). When provided, each rear half is perspective-warped so its silhouette fills the slot from outer edge to back-midline. Without it, rear is plain cv2.resize-stretched. | |
| rear_confidenceopt | FLOAT | 0.500–1 | Weight applied to the rear contribution in the alpha-weighted composite. |
| rear_blend_bandopt | FLOAT | 0.060–0.2 | Smooth-blend band width at the rear-slot boundary. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| strip_image | IMAGE | — |
| coverage_mask | MASK | — |
| inpaint_mask | MASK | — |
| status | STRING | — |