Nodes/BrainDead Nodes/BD Parts Builder 2 Assemble
ComfyUI Node

BD Parts Builder 2 Assemble

The stack that has to look like the head you started with

By BizaNator·Created 9 months ago·Updated 21 days ago· 15
BD Parts Builder 2 Assemble
  • complete_parts
  • plate
  • matte
  • plate_source
  • plate_head
  • engine_parts
  • reassembled
  • difference
  • report
◄plate_frame—►

What it's for

This is the node that answers the only question that matters about a layer decomposition: does the stack actually look like the head it came from?

It takes the complete layers from BD Parts Builder 2 and the eye-less plate from BD Parts Builder 2 Plates, and rebuilds the head the way an engine would: every part's back half (the bit that sits behind the head), then the plate over its matte, then every front half, in the paint order that was read off the source. What comes out is the deliverable - engine_parts, a PARTS_BUNDLE in the plate frame that BD Parts Export writes as a layered PSD, with head_plate in the middle and each part's depth_median encoding its place in the stack.

So it plays two roles at once. It's the QA gate (the difference output and the reassembled preview tell you whether the decomposition held), and it's the last stop before the PSD that a rigger or an engine actually consumes.

How it works

Each complete layer is mapped from the frame the builder used into the plate's frame with the same pad-to-square-and-scale rule the plates used, so a re-framed plate still lands correctly. Items are grouped by tag, sorted by paint_index - the back-to-front order BD Parts Builder 2 derived from the source's own overlaps, with depth only breaking ties - and composited in that order over the plate.

The node then computes the difference against plate_source on the head region, which is why its difference output looks like the red-zone heat from BD Compare Images: same idea, already wired up. If you want the numeric score as well, wire reassembled into BD Compare Images against plate_source and keep the JSON with the asset.

Outputs: engine_parts (PARTS_BUNDLE), reassembled (IMAGE), difference (IMAGE), report (STRING). The report is where ok, the paint order and the plate frame end up - print it, don't guess.

The inputs

All five required inputs come from the plates node, and they're not optional because anything less can't be placed:

  • complete_parts - from the builder's complete_parts output.
  • plate - the plates node's eyeless image.
  • matte - the plates node's matte.
  • plate_frame - the plates node's plate_frame, as a forced STRING input (you can type it, but wiring it is the sane thing).
  • plate_source - the plates node's plate_source.
  • plate_head (optional) - the plates node's plate_head; without it the head is assumed to be the non-white pixels of plate_source.

Installing it

ComfyUI Manager → search "BrainDead" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead && pip install -r requirements.txt

No models, no VRAM, no dependencies of its own - it's pure compositing and arithmetic. The heavy lifting happened in the two nodes upstream; this one is instant.

Where people get burned

"plate_frame is empty." The node raises this deliberately. If you typed the string instead of wiring it and the box doesn't match the plate, the layers can't be placed on the plate, and a silently wrong PSD is worse than an error.

"plate is N px but plate_frame says X." You resized the plate on the way in, or mixed a 2048 plate with a 1024 frame. Let the plates node decide and pass both through untouched.

It builds nothing when the plates failed. If plate_frame has ok=false, you get white images, an empty bundle and a report naming the stage that failed. Nothing is built from a rejected plate on purpose: the alternative is a PSD whose registration is off by a systematic amount, which is far more expensive to notice later than a blank frame.

It needs make_complete=true. The stack is built from the complete layers - that's where the back/front halves come from. If you switched complete layers off for speed, this node has no parts to stack and nothing to export; use the visible parts bundle with the base image straight into the exporter instead.

The difference image is the verdict, so look at it. A few red pixels along a hairline is a normal antialiasing-level disagreement. A whole red-shifted silhouette means a plate moved, and the fix is upstream in the plates run, not here.

Category🧠BrainDead/Segmentation

Inputs (6)

NameTypeDefaultDescription
complete_partsPARTS_BUNDLE—
plateIMAGEBD Parts Builder 2 Plates eyeless.
matteMASKBD Parts Builder 2 Plates matte.
plate_frameSTRINGBD Parts Builder 2 Plates plate_frame.
plate_sourceIMAGEBD Parts Builder 2 Plates plate_source.
plate_headoptMASKBD Parts Builder 2 Plates plate_head.

Outputs (4)

NameTypeDescription
engine_partsPARTS_BUNDLE—
reassembledIMAGE—
differenceIMAGE—
reportSTRING—