π§ Add Headroom (nhk)
Giving Your Subject Room to Breathe β Add Headroom (nhk)
- image
- IMAGE
Add Headroom (nhk) fixes one of the most annoying failure modes in portrait generation: a character whose head is jammed against the top edge of the frame. It shrinks your image within its own canvas and pins it to the bottom-center, so the subject slides down and you get empty space above - exactly the "breathing room" a character needs for composition, or for a later pass that adds hair, a hat, or an extended sky.
This is a compositor's tool, not a generator. If you're doing character-consistency work - generate a bust that's too tightly cropped, then want to outpaint upward or re-prompt with room for a hairstyle - you'll hit the "my subject's head is cut off" wall constantly. This node is the quick un-crop.
How it works
The math is refreshingly simple. You give it an image and a reduction_percent (0 to 50, default 10). It scales the whole image down by that percentage - so at 10%, the image becomes 90% of its size - then places the scaled result centered horizontally and pinned to the bottom of a canvas that keeps the original dimensions. The empty strip up top is filled with your chosen background.
Since the canvas size never changes, the output resolution stays identical to the input. You're not adding pixels; you're rearranging the ones you have and trading subject size for headroom. That's the honest trade: the subject gets smaller, so don't push reduction_percent too far unless you plan to upscale or inpaint afterward.
The background choice matters for what happens next. black and white give you a solid fill that blends fine if your next step repaints over it. transparent outputs an RGBA image with a genuinely empty alpha channel where the headroom is - the right pick if you're compositing onto another background or feeding a node that respects alpha.
Inputs and output
image- the image or batch to process. Batches are handled per-image and recombined.reduction_percent- 0 to 50 (step 0.5), default 10. How much to shrink the subject.background-black,white, ortransparent.
Output is a single IMAGE at the same dimensions as the input.
Installing it
Standard pack install, no extras:
cd ComfyUI/custom_nodes && git clone https://github.com/Enashka/ComfyUI-nhknodes
restart, or "NHK Nodes" from ComfyUI Manager.
Where people get tripped up
The resize is LANCZOS and the shrink is uniform, which is fine, but be aware this node downsamples - you're losing real subject detail, not inventing headroom pixels. The typical next step is upscaling or an img2img/inpaint pass over the new top strip, and the KB's inpainting essay is worth remembering here: masked inpainting still owns "leave the rest of the image alone," which is what you want after this node adds a strip you don't want touched. Also note there's no "top vs. bottom" option - it's always bottom-anchored, by design, because the whole point is creating space above the head. If you need space on the sides instead, this isn't the node; the pack's Visual Resizer is the one for arbitrary canvas offsets.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image or batch to add headroom | |
| reduction_percent | FLOAT | 10.00β50 | Percentage to reduce image size (creates headroom) |
| background | COMBO | Background fill color for headroom area |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |