Legacy2_ClownsharKSamplerGuides
Dual guides for subject + background
- guide
- guide_bkg
- guide_mask
- guide_mask_bkg
- guide_weights
- guide_weights_bkg
- guides
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; theepsilonfamily 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 (defaultconstant) - 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.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| guide_mode | COMBO | epsilon_projection | Recommended: 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_weight | FLOAT | 0.75-100–100 | Set the strength of the guide. |
| guide_weight_bkg | FLOAT | 0.75-100–100 | Set the strength of the guide_bkg. |
| guide_weight_scale | FLOAT | 1.000–1 | Disables the guide for the next step when the denoised image is similar to the guide. Higher values will strengthen the effect. |
| guide_weight_bkg_scale | FLOAT | 1.00-100–100 | Disables the guide for the next step when the denoised image is similar to the guide. Higher values will strengthen the effect. |
| guide_weight_scheduler | COMBO | beta57 | 12 options: constant, simple, sgm_uniform, karras, exponential, ddim_uniform, +6 |
| guide_weight_scheduler_bkg | COMBO | constant | 12 options: constant, simple, sgm_uniform, karras, exponential, ddim_uniform, +6 |
| guide_end_step | INT | 151–10000 | — |
| guide_bkg_end_step | INT | 151–10000 | — |
| guideopt | LATENT | — | |
| guide_bkgopt | LATENT | — | |
| guide_maskopt | MASK | — | |
| guide_mask_bkgopt | MASK | — | |
| guide_weightsopt | SIGMAS | — | |
| guide_weights_bkgopt | SIGMAS | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| guides | GUIDES | — |