Nodes/comfyui-timesaver/TS Smart Inpaint
ComfyUI Node

TS Smart Inpaint

Regenerate or refine only the masked region: it crops with context, samples at full detail and composites the result back.

By AlexYez·Created 2 years ago·Updated 3 days ago· 11
TS Smart Inpaint
  • model
  • vae
  • positive
  • negative
  • image
  • mask
  • reference
  • image
replacetrue
denoise1.00
megapixels1.5
context_pct8.0
feather_pct3.0
resize_methodlanczos
seed0
steps4
cfg1.0
sampler_nameeuler
schedulersimple
CategoryTS/Image/Retouch

Inputs (18)

NameTypeDefaultDescription
modelMODELDiffusion model used to regenerate the masked region.
vaeVAEVAE used to encode the crop to latent and decode the result.
positiveCONDITIONINGPositive conditioning describing what to generate inside the mask.
negativeCONDITIONINGNegative conditioning describing what to avoid.
imageIMAGEFull source image to inpaint.
maskMASKMask marking the region to inpaint (white = regenerate).
replaceBOOLEANtrueReplace = Smart Inpaint: regenerates the masked region from scratch (reference_latents = the crop; an optional `reference` image is chained as a 2nd reference — 'fill with THIS'). Denoise is IGNORED and locked to 1.0. Refine = partial denoise of the existing content at the Denoise value (no reference).
denoiseFLOAT1.000–1Refine mode only: how much of the existing content is redrawn (1.0 = fully). Ignored in Replace mode (locked to 1.0).
megapixelsFLOAT1.50.1–8Processing budget for the masked crop. Small crops upscale toward it; oversized crops downscale to it to bound VAE/sampler cost. Raise for more detail.
context_pctFLOAT8.00–50Context band around the mask the model sees during refine, as a PERCENT of the mask's own size (not fixed pixels) — so it scales with the selection. Also hosts the colour-correction ring. ~8% is a sensible default; raise for more surrounding context.
feather_pctFLOAT3.00–25Feather (edge blend) width as a PERCENT of the mask's own size rather than fixed pixels — a small mask gets a proportionally small feather (no over-soft ghosting on thin strokes), a big mask a wider blend. Clamped to a small px floor. ~3% is a sensible default; 0 = hard edge.
resize_methodCOMBOlanczosInterpolation used to up/downscale the image crop. lanczos and bicubic keep the most detail.
seedINT00–18446744073709550000Noise seed for the sampler. Change for a different variation of the inpainted region.
stepsINT41–100Number of sampling steps. More steps trade speed for quality.
cfgFLOAT1.00–30Classifier-free guidance scale. Higher values follow the prompt more strongly.
sampler_nameCOMBOeulerSampling algorithm used to denoise the region.
schedulerCOMBOsimpleNoise schedule that controls how sigma decreases across steps.
referenceoptIMAGEOptional reference image (Replace only). VAE-encoded and chained as a 2nd reference_latents after the crop, so the masked region is filled toward THIS picture's content. Leave unconnected for plain Smart Inpaint.

Outputs (1)

NameTypeDescription
imageIMAGE