Nodes/kubakub nodes/kubakub pieces transform
ComfyUI Node

kubakub pieces transform

The node that actually moves the stones

By kubakubkub·Created about a month ago·Updated 2 days ago· 10
kubakub pieces transform
  • pieces
  • falloff
  • pieces
◄push0.50►
◄across0.00►
◄up0.00►
◄out0.00►
◄tilt0►
◄turn0►
◄roll0►
◄random_rotate0►
◄scale1.00►
◄jitter0.00►
◄seed1►

A facade model is not a smooth surface. It's six hundred loose parts - stones, voussoirs, window frames, sills, cornices - and this node moves them. Individually, as rigid pieces, in metres and degrees. It's the operator half of the pack's small MOPS, and it's where the actual look gets decided.

What it takes and what it gives

pieces comes from kubakub scene pieces (or from another pieces transform, since chains are allowed and they add up). The optional falloff input takes a KUBA_FALLOFF from kubakub pieces falloff or kubakub pieces beat falloff. Output is pieces, ready for kubakub pieces render.

With no falloff connected, every piece moves fully, the entire time. That's not a bug, it's the default: the two transforms it protects against are "a wall that breathes uniformly" and "a wall that breathes in a wave", and the second one is why the falloff nodes exist.

The dials

Translations, all in metres:

  • push - along each piece's own normal. This is the star of the node. On a flat panel the normal is the wall normal, so push 0.5 stands a stone halfway out of the wall. On a closed, box-like stone the normal is degenerate, so the node uses the facade direction instead - out of the building, towards the audience.
  • across, up, out - metres along the facade's own axes: left→right, up, and out of the wall. Use these when you want the whole piece set sheared or lifted rather than pushed.

Rotations, in degrees, each about the piece's own centre: tilt (about the horizontal), turn (about the vertical), roll (in the facade plane). Plus random_rotate, which gives up to that many degrees per axis, different per piece - the cheapest way to make an old facade look unsettled.

Then scale, the size of a piece where the falloff is full (1 = unchanged), and jitter, metres in a random direction, different per piece. seed drives the random parts; the same number gives the same result, on every machine.

Chaining is the technique

One transform per idea, stacked. A push 0.4 with a wave falloff gets the stones out of the wall in a ripple. A second transform with turn 10 and a noise falloff gives them all slightly different angles as they arrive. A third with scale 0.9 on a stagger makes a whole course of stonework shrink order by order. Each transform carries the same piece set forward, applying its own 4×4 matrix per piece on top of what's already there.

That's also the answer to "why does my wall look like it's made of cardboard" - you did one transform. Two or three at different rates is what makes it read as a structure.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/kubakubkub/ComfyUI_KubaNodes
python -m pip install -r ComfyUI_KubaNodes/requirements.txt

Or Manager → search kubakub nodes. The only package the pip line adds is opencv-python-headless; everything else comes with ComfyUI. Needs ComfyUI 0.37.0 or newer, and Blender 4.x for anything downstream of this in 3d / pieces to actually produce frames.

Worth repeating from the README: the pack is built and tested on Windows 11 with Blender 4.5 and an RTX 5070 Ti 12 GB. Other systems are untested. If you're on Linux, expect to do a little path-finding around the Blender discovery.

Where it goes wrong

The maths is in numpy, and Blender only moves vertices. That's the pack's own description, and it's good news: a 451-piece facade, 24 frames at 960×648 and 16 samples lands around 10 seconds of render. So transforms are cheap and you should iterate on them at low resolution_scale in kubakub pieces render without guilt.

Rotating a stone that's sitting on a wall reveals what's behind it. Nothing stops you, and nothing fills the gap either - turn a deep cornice block far enough and you're looking at the interior of the model. That's not a bug, it's physics, and it's the reason push 0.1 with a fast wave reads better than turn 40 with the same everything.

Collisions aren't handled. Pieces go through each other. At small amplitudes and short durations nobody notices. Push a course of stones a full metre with a tight width and you'll get intersecting geometry that Cycles renders as a mess of z-fighting.

The wall is usually in the piece set. If the whole building drifts when you only wanted the detail, go back to kubakub scene pieces and check keep_largest - it exists to hold the shell in place while the ornament moves.

Categorykubakub/3d/pieces

Inputs (13)

NameTypeDefaultDescription
piecesKUBA_PIECESFrom kubakub scene pieces or another pieces transform.
pushFLOAT0.50-100–100Metres along the piece's normal.
acrossFLOAT0.00-100–100Metres left -> right.
upFLOAT0.00-100–100Metres up.
outFLOAT0.00-100–100Metres out of the facade.
tiltFLOAT0-3600–3600Degrees about the horizontal.
turnFLOAT0-3600–3600Degrees about the vertical.
rollFLOAT0-3600–3600Degrees in the facade plane.
random_rotateFLOAT00–3600Up to this many degrees per axis, different for every piece.
scaleFLOAT1.000–20Size of each piece where the falloff is full (1 = unchanged).
jitterFLOAT0.000–100Metres in a random direction, different for every piece.
seedINT10–100000Another number = another random pattern (the same number = the same result).
falloffoptKUBA_FALLOFFHow strongly and when (kubakub pieces falloff). None = fully.

Outputs (1)

NameTypeDescription
piecesKUBA_PIECES—