Nodes/image_control/abyz22_smallhead
ComfyUI Node

abyz22_smallhead

Shrink the head, then let inpainting fix the neck

By abyz22·Created 3 years ago·Updated 2 years ago· 17
abyz22_smallhead
  • image
  • segs
  • images
  • masks
ratio0.80
empty_space
model_detectortrue
kernel_size10
sigma10.0
mask_dilation10

This is the "Resize Head" feature of the image_control pack, and it exists because character renders have a chronic problem: the head comes out too big for the body, and once you shrink it, the neck and shoulders no longer match. abyz22_smallhead handles both halves. It resizes the head region and hands you an inpaint mask so a follow-up pass can re-draw the seam - neck included. It's a fix-it-after-generation node, not a generation node, and it belongs to the same detect-crop-refine family as Impact Pack's detailers.

How it works, straight from the source: you feed it an image and segs - which is typed as an IMAGE but is really a mask, white where the head is. The node finds the white bounding box, crops that region, resizes it by ratio (default 0.8, i.e. shrink to 80%), and pastes it back, bottom-aligned to the original head box. The vacated space gets filled with noise or black depending on empty_space. Then it builds the output mask: the resized region, dilated by mask_dilation and Gaussian-blurred with kernel_size/sigma so the inpaint gets a soft edge to blend against. If model_detector is on (it is by default), it also masks the whole neck/shoulder area below the head - because a smaller head sitting on unchanged shoulders looks worse than the original problem.

The inputs that matter:

  • segs - the head mask, as an image. The typical chain is Impact Pack: detector → SEGS → ImpactSEGSToMaskBatchMaskToImage. The pack's own sample workflow feeds it exactly this way. If you wire raw SEGS straight in you'll get nothing useful, because the node reads it as a pixel image.
  • ratio - 0.01 to 1.5. Under 1 shrinks, over 1 actually enlarges. Keep it modest; much past 0.85 and the inpaint has to invent an entire new neckline.
  • empty_space - noise or black for the vacated area. Noise tends to blend better when a denoise pass follows.
  • model_detector - the toggle that decides whether the neck gets re-generated too. Turn it off if you only want the head region touched.

Outputs: images (the patched image) and masks (the inpaint mask). The mask is the real output. Wire it into an inpaint - the pack ships its own LaMa inpaint nodes for exactly this - and blend the result back. If you just take the image, you've got a pasted-in patch with visible seams, which is not the look you were going for.

A note on the wider picture: masked inpainting is still the right tool for jobs like this - bit-identical pixels outside the mask, a denoise dial instead of a sentence. That's the whole remaining case for it, and this node is squarely in that lane.

Install: standard for the pack - Manager → image_control, or git clone https://github.com/abyz22/image_control into custom_nodes/, restart. No extra model downloads for this node itself, though you'll want Impact Pack installed to produce the segs mask it's built to consume.

Categoryabyz22

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
segsIMAGE
ratioFLOAT0.800.01–1.5
empty_spaceCOMBO2 options: noise, black
model_detectorBOOLEANtrue
kernel_sizeINT100–100
sigmaFLOAT10.00.1–100
mask_dilationINT100–128

Outputs (2)

NameTypeDescription
imagesIMAGE
masksMASK