Nodes/comfyui-timesaver/TS Studio Inpaint Crop
ComfyUI Node

TS Studio Inpaint Crop

Crops the masked area with a context band and scales it to the processing budget, so a repaint spends the model's resolution where the mask is instead of on the whole frame. Feed the crop and its mask to any inpainting sampler, then hand the result plus this node's plan to TS Studio Inpaint Restore.

By AlexYez·Created 2 years ago·Updated 3 days ago· 11
TS Studio Inpaint Crop
  • image
  • mask
  • crop
  • crop_mask
  • crop_mask_soft
  • plan
  • source
megapixels1.0
context_pct8.0
denoise1.00
snap_px64
feather_pct3.0
CategoryTS/Studio

Inputs (7)

NameTypeDefaultDescription
imageIMAGEFull source frame.
maskMASKPainted mask: white = repaint.
megapixelsFLOAT1.00.1–8Resolution the crop is actually processed at. Small selections are enlarged toward it (up to 3x) for detail; oversized ones are reduced to it so a big mask in an 8K frame cannot hang the machine.
context_pctFLOAT8.00–50How much context to take around the mask, as a percent of the mask's own size. More context helps the model match the surroundings; it also enlarges the crop, so less of the budget lands on the mask itself. Values below the 32px colour-analysis ring change nothing.
denoiseFLOAT1.000–1How much of the masked area the sampler will replace. Full replacement leaves the model no pixels to anchor on, so the crop then takes more context and is enlarged less — otherwise it paints a scene of its own inside the mask.
snap_pxINT648–256Side multiple the processed crop is rounded up to. The VAE divides by 8 or 16 and the transformer patches the latent on top of that, so a size off the grid costs an internal pad and a resize on the way back. 64 is the safe general answer; Qwen follows its own encoder on a 56 grid, where 112 also keeps the latent side even.
feather_pctFLOAT3.00–25Width of the soft edge used when the repaint is pasted back, as a percent of the mask's own size.

Outputs (5)

NameTypeDescription
cropIMAGE
crop_maskMASK
crop_mask_softMASKThe same mask with its soft edge kept. Feed this one when Differential Diffusion patches the model: it turns the ramp into a per-pixel denoise schedule instead of throwing it away.
planTS_INPAINT_PLANCrop geometry and its soft edge — feed to TS Studio Inpaint Restore.
sourceIMAGEThe frame, passed through.