Nodes/NKD Klein Tools/😺NKD Klein Reference Fit
ComfyUI Node

😺NKD Klein Reference Fit

EXPERIMENTAL — scales a reference image to fit a mask's region and places it there on a canvas-sized image. Use it so the WHOLE reference lands inside the zone you mask, instead of only the slice that happens to overlap it. Wire: reference image → this node (with your mask) → the reference slot of Presampling. Use the SAME mask in the Reference Region node.

By Nekodificador·Created 4 months ago·Updated 27 days ago· 71
😺NKD Klein Reference Fit
  • image
  • mask
  • image
fitcontain
padding0
backgroundgray
Category😺NKD Nodes/Klein

Inputs (5)

NameTypeDefaultDescription
imageIMAGEThe reference image to place inside the masked region.
maskMASKThe zone to place the reference in. Its bounding box sets the position and size; its resolution sets the canvas size. Use the same mask as the Reference Region node.
fitCOMBOcontaincontain: scale the whole reference to fit inside the zone (keeps its proportions, may leave a neutral border). stretch: fill the zone exactly (may distort).
paddingINT00–512Grow the bounding box by this many pixels before placing.
backgroundCOMBOgrayWhat fills the area around the placed reference. Gray is neutral. Mostly irrelevant outside the zone (the Region node suppresses it there), but it shows in any border inside the zone when using 'contain'.

Outputs (1)

NameTypeDescription
imageIMAGECanvas-sized image with the reference placed in the zone. Feed into Presampling's reference slot.