Baseline Alignment (Y)
Sit a layer's bottom edge on a baseline — no more manual layout math
- height_a
- height_b
- y_percent
If you've ever tried to make several layers' bottoms line up on a shared horizontal line - text on a card, a logo over a banner, a row of elements in a composite - you know the pain: percentage positioning centers each layer's own box, so different heights refuse to align. Baseline Alignment (Y) is the fix. It computes the Y percentage where a layer's center should sit so the layer's bottom edge lands exactly on a baseline position within a reference height. You pick the baseline (default 80% down the canvas), it does the rest.
The natural pairing is with the pack's Baseline Alignment (X) node - X for the right edge, Y for the bottom edge - and together they're the pack's answer to "real layout alignment" without a design tool. Both output a percentage you feed straight into any positioning node, like Image Mask Blend's y_percent.
How it works
Three inputs, one output:
- height_a - the height of the layer being positioned.
- height_b - the reference height (the canvas or container).
- baseline_percent - where the baseline sits in height_b, as a percentage. Default 80.
The calculation: the layer's center-to-bottom distance as a percentage of height_b is height_a / 2 / height_b × 100. Subtract that from baseline_percent, and you get y_percent - the position where the layer's center must sit so its bottom touches the baseline. Because the layer's own height is part of the equation, a tall layer and a short layer both end up resting on the same line. Hook height_a up to Get Image Size or Get Mask Size and the alignment tracks your content automatically on every run.
Install
Part of ComfyUI-WBLESS:
cd ComfyUI/custom_nodes
git clone https://github.com/LaoMaoBoss/ComfyUI-WBLESS
restart ComfyUI, or search "ComfyUI-WBLESS" in ComfyUI Manager. No dependencies or model downloads.
Troubleshooting
The output is deliberately unclamped - a layer taller than the reference produces a negative y_percent because its center has to go above the top edge for the bottom to still touch the baseline. If your layer sits above where you expected, that's the math working as designed, not a bug. And remember this aligns the bottom edge; the X node in the pair does the right edge, and neither has a top/left mode, so mirror the arithmetic if you need the opposite side. For building composites where layers actually line up like objects in a layout, it's a small node that removes a whole category of fiddly guesswork.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| height_a | * | — | |
| height_b | * | — | |
| baseline_percent | FLOAT | 80.00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| y_percent | FLOAT | — |