Nodes/RES4LYF/Legacy2_ClownsharKSamplerGuides
ComfyUI Node Runs on cloud

Legacy2_ClownsharKSamplerGuides

Dual guides for subject + background

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
Legacy2_ClownsharKSamplerGuides
  • guide
  • guide_bkg
  • guide_mask
  • guide_mask_bkg
  • guide_weights
  • guide_weights_bkg
  • guides
guide_modeepsilon_projection
guide_weight0.75
guide_weight_bkg0.75
guide_weight_scale1.00
guide_weight_bkg_scale1.00
guide_weight_schedulerbeta57
guide_weight_scheduler_bkgconstant
guide_end_step15
guide_bkg_end_step15

Same idea as the single ClownsharKSamplerGuide, but this is the two-guide version: a foreground/subject guide and a separate background guide, each with its own mask, weight, and schedule. It's what you reach for when you want to steer two regions of an image independently - a subject composition in front, a different reference behind - and have the sampler honor both. The readme's dual-guide-with-masking workflows are exactly this pattern.

The name in the menu is Legacy2_ClownsharKSamplerGuides, so it's a kept-around older generation. Works fine; just know the newest guide nodes carry different names.

How it works

You provide up to two guide latents - guide and guide_bkg - plus a mask for each, and the node bundles them into one GUIDES object for the sampler's guides input. During denoising the sampler applies the foreground guide inside its mask and the background guide inside its own, each fading out at its own end step. That independence is the whole reason this node exists: subject and background rarely want the same guide strength or the same release point.

The inputs that matter

The parameters come in mirrored pairs - one set for the main guide, one suffixed _bkg for the background:

  • guide_mode (default epsilon_projection) - the injection method, shared across both guides. 17 modes; the epsilon family is the usual start, blend/projection modes for softer adherence.
  • guide_weight / guide_weight_bkg (both default 0.75) - how hard each guide pulls. Tune them separately; a strong subject over a light background is a common setup.
  • guide_end_step / guide_bkg_end_step (both default 15) - when each guide stops. You might hold the background longer than the subject, or the reverse.
  • guide_weight_scheduler (default beta57) and guide_weight_scheduler_bkg (default constant) - how each weight evolves over its guided steps.

Optional inputs let you wire it up: guide and guide_bkg (the two LATENTs, from VAE Encodes of your references), guide_mask and guide_mask_bkg (the two MASKs), plus guide_weights / guide_weights_bkg (SIGMAS curves for fully manual weight control). The single output is guides (GUIDES).

Installing it

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

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

pip install inside the venv (or portable Python), restart, hard-refresh F5. No model downloads - but you'll want VAE Encodes to build the guide latents.

Common issues

The classic mistake with a dual-guide setup is overlapping or missing masks. If your two masks overlap, the region where they collide gets pulled by both guides and the result looks muddy; if you leave a mask off, that guide applies globally, which is rarely what you want with a background reference. Draw clean, complementary masks. Beyond that, the single-guide troubleshooting carries over: verify each GUIDES wire reaches the sampler, and if a guide seems to do nothing, raise its weight or push its end step later to confirm it's active before dialing back. If the node's absent, RES4LYF isn't installed; if you only need one guide, use the simpler singular node instead.

CategoryRES4LYF/legacy/sampler_extensions

Inputs (15)

NameTypeDefaultDescription
guide_modeCOMBOepsilon_projectionRecommended: epsilon or mean/mean_std with sampler_mode = standard, and unsample/resample with sampler_mode = unsample/resample. Epsilon_dynamic_mean, etc. are only used with two latent inputs and a mask. Blend/hard_light/mean/mean_std etc. require low strengths, start with 0.01-0.02.
guide_weightFLOAT0.75-100–100Set the strength of the guide.
guide_weight_bkgFLOAT0.75-100–100Set the strength of the guide_bkg.
guide_weight_scaleFLOAT1.000–1Disables the guide for the next step when the denoised image is similar to the guide. Higher values will strengthen the effect.
guide_weight_bkg_scaleFLOAT1.00-100–100Disables the guide for the next step when the denoised image is similar to the guide. Higher values will strengthen the effect.
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_stepINT151–10000
guideoptLATENT
guide_bkgoptLATENT
guide_maskoptMASK
guide_mask_bkgoptMASK
guide_weightsoptSIGMAS
guide_weights_bkgoptSIGMAS

Outputs (1)

NameTypeDescription
guidesGUIDES