Nodes/RES4LYF/SharkChainsampler
ComfyUI Node Runs on cloud

SharkChainsampler

Hand a half-sampled latent to the next sampler and change the rules

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
SharkChainsampler
  • model
  • positive
  • negative
  • sampler
  • sigmas
  • latent_image
  • options_group
  • output
  • denoised
  • options
steps_to_run-1
cfg5.50
sampler_moderesample

Normally a sampler runs your whole schedule start to finish and spits out a finished latent. SharkChainsampler runs part of it, then passes the in-progress latent to the next chainsampler, which can pick up with a different sampler, CFG, or conditioning. String several together and you can change the rules partway through a single generation - different solver for the coarse structure than for the fine detail, or a prompt swap mid-run.

"Chainsamplers" are one of the tricks the RES4LYF README explicitly shows off as a workflow enhancer, and they're a natural fit for the pack's philosophy: a big chunk of its quality gains come from modulating parameters against time, and chaining is the blunt, legible way to do that. Instead of one monolithic sampler node you get a relay of them, each owning a slice of the denoising process.

How it works

Each chainsampler runs for steps_to_run steps of the schedule at its own CFG and mode, then emits the partially denoised latent for the next link. The default sampler_mode of resample is the giveaway that this is designed for multi-stage and unsampling-style pipelines. Set steps_to_run to -1 (the default) to run whatever's left of the schedule. Options flow through the group input so shared settings ride along the chain.

The inputs and outputs that matter

  • steps_to_run (default -1) - how many steps this link handles; -1 means "the rest."
  • cfg (default 5.5) - guidance for this segment. Different links can run different CFG, which is the point.
  • sampler_mode (default resample) - the stage this link is operating in.
  • Optional model, positive, negative, sampler, sigmas, latent_image - the first link in a chain supplies these; later links inherit the running latent. Swapping positive between links is how you get a mid-generation prompt change.

Outputs: output (LATENT, the running latent to pass onward), denoised (LATENT, the current clean estimate), and options (OPTIONS) to carry settings to the next link.

How to install it

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

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

Portable builds use the embedded pip. Restart, hard-refresh (F5). Grab rgthree-comfy too so the sampler menus nest correctly.

Common issues

The step accounting is where chains go wrong. Each link consumes part of one shared schedule, so if your total across links doesn't line up with the sigmas you're feeding, you either run out of schedule early or leave the image under-denoised. Think of the whole chain as one schedule split into segments. Second, this is genuinely advanced and under-documented - the pack's own community keeps asking for a guide - so build up from a single link that just runs the whole schedule (steps_to_run = -1) and confirm it matches a normal sampler before you start splitting. Finally it's the "Beta" line, meaning the current experimental generation; inputs can shift on a pack update, so re-verify a chain after upgrading rather than assuming it survived.

CategoryRES4LYF/samplers

Inputs (10)

NameTypeDefaultDescription
steps_to_runINT-1-1–10000
cfgFLOAT5.50-10000–10000Negative values use channelwise CFG.
sampler_modeCOMBOresample2 options: unsample, resample
modeloptMODEL
positiveoptCONDITIONING
negativeoptCONDITIONING
sampleroptSAMPLER
sigmasoptSIGMAS
latent_imageoptLATENT
options_groupoptCOMFY_AUTOGROW_V3

Outputs (3)

NameTypeDescription
outputLATENT
denoisedLATENT
optionsOPTIONS