Nodes/RES4LYF/Legacy2_ClownInpaint
ComfyUI Node Runs on cloud

Legacy2_ClownInpaint

RES4LYF inpainting with separate masked and background guidance

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
Legacy2_ClownInpaint
  • model
  • positive_inpaint
  • positive_bkg
  • negative
  • latent_image
  • mask
  • guide_weights
  • guide_weights_bkg
  • model
  • positive
  • negative
  • latent
  • guides
guide_weight0.10
guide_weight_bkg1.00
guide_weight_schedulerbeta57
guide_weight_scheduler_bkgconstant
guide_end_step15
guide_bkg_end_step10000

This is RES4LYF's all-in-one inpainting setup node. It doesn't sample anything itself - it takes your model, your prompts, your latent, and a mask, and packages them into the GUIDES bundle that a RES4LYF sampler needs to inpaint. The reason it exists is control: it lets you guide the masked region (the part you're regenerating) and the background (the part you want preserved) with separate prompts and separate strengths. That's a real step up from "mask a spot, hope the base prompt fills it sensibly."

RES4LYF's guide system is well liked precisely because it steers composition without a ControlNet - one user put it in "the vicinity of img2img with highish denoise, or unsampling / RF inversion / ad hoc controlnet." ClownInpaint is that machinery pointed at inpainting specifically. Heads up: it's a Legacy node (display name Legacy2_ClownInpaint), so it's kept for older workflows but still fully functional.

How it works

You give it two prompts - positive_inpaint for what should appear inside the mask, positive_bkg for the surrounding area - plus the model, latent, negative, and mask. It builds a guide that pulls the masked region toward your inpaint prompt while holding the background toward its own prompt, each on its own weight and schedule. It passes the model, positive, negative, and latent straight through (so you don't need extra reroutes) and emits the guides bundle for the sampler's guides input.

The inputs that matter

  • positive_inpaint + mask - the prompt for the region you're regenerating, and where. This is the core of the node.
  • positive_bkg - the prompt for everything outside the mask, so the untouched area stays coherent with what you want.
  • guide_weight (default 0.1) - how strongly the masked region follows its guide. It's deliberately gentle by default; raise it to force the inpaint harder toward the prompt.
  • guide_weight_bkg (default 1) - how strongly the background is held. Kept high (1.0) to preserve the original by default.
  • guide_end_step (default 15) / guide_bkg_end_step (default 10000) - the step at which each guide stops acting. The masked guide releases early (15) to let the model finish naturally; the background is held effectively the whole run.

guide_weight_scheduler (default beta57) and guide_weight_scheduler_bkg (default constant) shape how those weights change over steps, and the optional guide_weights / guide_weights_bkg (SIGMAS) let you supply custom curves. Outputs: model, positive, negative, latent, and guides (GUIDES) - wire the last into the sampler.

Installing RES4LYF

ComfyUI Manager: search RES4LYF, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/ClownsharkBatwing/RES4LYF
pip install -r RES4LYF/requirements.txt

Portable users: embedded pip under python_embedded/Scripts/. Restart, hard-refresh with F5. No model downloads.

Common issues

The inpaint barely changed anything. guide_weight defaults to a low 0.1. If the masked area isn't following your prompt enough, raise it. Also check guide_end_step - releasing too early leaves the region under-guided.

The background drifted. That's guide_weight_bkg / guide_bkg_end_step. Keep the weight near 1 and the end step high to hold the original; if it's still moving, your mask may be smaller than you think.

Wire the guides, not just the passthroughs. The guides output is the one that makes inpainting happen - it goes to the sampler's guides input. The model/positive/negative/latent outputs are conveniences; the guides are the point.

It's tied to RES4LYF sampling. Use the pack's sampler downstream - this builds guides that stock samplers don't consume.

CategoryRES4LYF/legacy/sampler_extensions

Inputs (14)

NameTypeDefaultDescription
guide_weightFLOAT0.10-100–100Set the strength of the guide.
guide_weight_bkgFLOAT1.00-100–100Set the strength of the guide_bkg.
guide_weight_schedulerCOMBObeta5712 options: constant, simple, sgm_uniform, karras, exponential, ddim_uniform, +6
guide_weight_scheduler_bkgCOMBOconstant12 options: constant, simple, sgm_uniform, karras, exponential, ddim_uniform, +6
guide_end_stepINT151–10000
guide_bkg_end_stepINT100001–10000
modeloptMODEL
positive_inpaintoptCONDITIONING
positive_bkgoptCONDITIONING
negativeoptCONDITIONING
latent_imageoptLATENT
maskoptMASK
guide_weightsoptSIGMAS
guide_weights_bkgoptSIGMAS

Outputs (5)

NameTypeDescription
modelMODEL
positiveCONDITIONING
negativeCONDITIONING
latentLATENT
guidesGUIDES