Nodes/LLS-node/LLS Simple Repair Prepare
ComfyUI Node

LLS Simple Repair Prepare

The inpainting setup node that does the boring 80% for you

By Gin3601·Created 3 months ago·Updated 3 months ago· 0
LLS Simple Repair Prepare
  • image
  • mask
  • vae
  • model
  • positive
  • negative
  • latent
  • work_image
  • work_mask
  • repair_info
  • recommended_denoise
  • positive
  • negative
repair_scopeauto
repair_kernelauto
task_hintauto
mask_grow24
mask_blur8.0
mask_threshold0.50
invert_maskfalse
crop_context64
crop_context_factor1.5
min_size256
max_size1024
resize_modefit
expand_left0
expand_right0
expand_top0
expand_bottom0
canvas_filledge
auto_recommendenabled
model_info

Core ComfyUI's answer to "mask this region and regenerate it" is a scattered pile of nodes: VAE encode, then latent set, then a mask-blur helper, then a separate inpaint node if your model supports it, then keeping the crop and paste logic straight yourself. LLS Simple Repair Prepare collapses the setup half of that into one node. You give it an image, a mask, and a VAE, and it hands you a ready-to-sample latent plus a pile of metadata - including a recommended denoise strength, which is the part that usually takes people three failed runs to dial in by hand.

What it actually does

Under the hood it's a four-step pipeline that the node hides from you:

  1. Mask prep. Your raw mask gets thresholded, grown (mask_grow, default 24px), and blurred (mask_blur, default 8) so the repair zone has soft edges instead of a hard cut line.
  2. Scope decision. repair_scope picks where the work happens: region repairs in place; crop carves out a work area around the mask and renders it bigger for detail-hungry fixes; canvas expands the canvas so you can outpaint beyond the original edges.
  3. VAE encode. The working image gets encoded to a latent with the mask attached as a noise mask - the "keep the unmasked pixels fixed" bit that makes masked inpainting touch nothing outside the region.
  4. Metadata. It writes a repair_info object (its own LLS_REPAIR_INFO type) describing everything it decided, so the matching Finish node can composite the result back correctly.

The optional model and positive/negative inputs are there so the node can be family-aware about how it prepares the latent and what it recommends - but the purest setup works without them.

Inputs you'll actually touch

Defaults are all auto or sensible, and for a first run you can genuinely leave almost everything. The ones worth knowing:

  • mask_grow (24) and mask_blur (8) - grow the selection a bit into surrounding pixels and soften the boundary. This is your seam-control dial before sampling even starts.
  • repair_scope - crop is the one to reach for when the mask is small (an eye, a hand) and you want detail budget: it renders just that region bigger. canvas is outpainting.
  • min_size / max_size - the box the work area gets fitted into (resize_mode = fit default). max_size 1024 is the default because that's SDXL territory; lower it for SD 1.5, raise it for Flux-class models.
  • expand_* and canvas_fill - only relevant in canvas scope. That's the "grow the image and fill the new border with blurred edge pixels" path.

Outputs

latent feeds your sampler directly; repair_info must go to the matching Finish node; work_image / work_mask are the prepared crop-and-mask you can preview to see what the sampler is actually being asked to repair; recommended_denoise is a float you can wire straight into the sampler's denoise widget - with auto_recommend enabled the node computes it from the mask area and scope.

Wiring it in

The README's minimal chain, and it's worth building exactly once:

Load Image → (mask from Simple Mask Draw / Simple Mask Create)
   → LLS Simple Repair Prepare → LLS Simple KSampler → VAE Decode
   → LLS Simple Repair Finish → Preview Image

Installing

ComfyUI Manager → search "LLS-node", or:

cd ComfyUI/custom_nodes
git clone https://github.com/Gin3601/LLS-node

Restart, then look under the LLS/Image Repair category. No requirements.txt - everything rides on core ComfyUI's torch/numpy/PIL.

Gotchas

  • vae is required. The node raises [LLS] Missing VAE if you skip it. Use the VAE from your checkpoint loader or an explicit VAE node - and with Flux, that means the separate ae.safetensors, since Flux checkpoints don't carry an embedded VAE.
  • repair_kernel and task_hint default to auto and quietly pick a backend for you (latent_mask, vae_inpaint, or native_fill). That's a good thing - but if your results look wrong, checking which kernel it chose (it's in the JSON outputs) is a useful first diagnosis.
  • The one thing this chain guarantees is bit-identical unmasked pixels. If your un-masked areas are coming back changed, that's not this node - that's the sampler's denoise creeping too high. Which is exactly why the recommended_denoise output exists. Trust it.
CategoryLLS/Image Repair

Inputs (25)

NameTypeDefaultDescription
imageIMAGE
maskMASK
vaeVAE
repair_scopeCOMBOauto4 options: auto, region, crop, canvas
repair_kernelCOMBOauto4 options: auto, latent_mask, vae_inpaint, native_fill
task_hintCOMBOauto11 options: auto, repair, remove, replace, fill, appearance, +5
mask_growINT240–2048
mask_blurFLOAT8.00–256
mask_thresholdFLOAT0.500–1
invert_maskBOOLEANfalse
crop_contextINT640–512
crop_context_factorFLOAT1.51–8
min_sizeINT25664–8192
max_sizeINT102464–8192
resize_modeCOMBOfit3 options: fit, pad, stretch
expand_leftINT00–4096
expand_rightINT00–4096
expand_topINT00–4096
expand_bottomINT00–4096
canvas_fillCOMBOedge5 options: edge, blur, black, white, neutral
auto_recommendCOMBOenabled2 options: enabled, disabled
modeloptMODEL
model_infooptSTRING
positiveoptCONDITIONING
negativeoptCONDITIONING

Outputs (7)

NameTypeDescription
latentLATENT
work_imageIMAGE
work_maskMASK
repair_infoLLS_REPAIR_INFO
recommended_denoiseFLOAT
positiveCONDITIONING
negativeCONDITIONING