Nodes/WAS_Extras/KSampler Sequence
ComfyUI Node

KSampler Sequence

Looping KSampler passes for prompt-progression generations

By WASasquatch·Created 3 years ago·Updated 11 days ago· 43
KSampler Sequence
  • model
  • positive_seq
  • negative_seq
  • latent_image
  • LATENT
seed0
seed_mode_seq
alternate_valuestrue
steps20
cfg8.0
sampler_name
scheduler
sequence_loop_count20
use_conditioning_slerpfalse
cond_slerp_strength0.500
use_latent_interpolationfalse
latent_interpolation_mode
latent_interp_strength0.500
denoise_start1.00
denoise_seq0.50
unsample_latentsfalse

A normal KSampler runs once. This one runs a KSampler in a loop, evolving the seed, the prompt, and optionally the latent itself on every pass, so the image nudges forward instead of regenerating from scratch each time. The README calls this "prompt progression" - each loop is a small push toward the next described state, and it's built specifically to consume the frame-indexed prompt schedules from this pack's CLIPTextEncodeList node.

How it works

sequence_loop_count sets how many passes to run. Each loop, the seed evolves according to seed_mode_seq (increment, decrement, random, or fixed), and the prompt is pulled from wherever the positive_seq/negative_seq schedule says it should be for that point in the sequence. The first loop denoises from denoise_start (typically close to 1.0, a full pass from your starting latent); every loop after that uses denoise_seq - usually a lower value, since you're now nudging an existing image rather than generating one cold. That gap between the two denoise values is the actual mechanism behind "progression": high denoise once to establish the image, lower denoise repeatedly to walk it forward.

Two smoothing options sit on top of that core loop. use_conditioning_slerp (with cond_slerp_strength) spherically interpolates between consecutive prompts in the schedule instead of hard-switching, softening the transition. use_latent_interpolation (with latent_interpolation_mode - Blend, Slerp, or Cosine Interp - and latent_interp_strength) does the same thing to the latent between loops, blending consecutive outputs instead of letting each loop fully replace the last. unsample_latents is a different trick entirely: it reverses a few sampling steps before resampling, which injects a bit of controlled variation rather than just repeating the same trajectory.

The inputs and outputs that matter

  • model, latent_image - the usual sampler inputs; latent_image is your starting point for loop one.
  • positive_seq / negative_seq (CONDITIONING_SEQ) - this is the part that makes this node specific: it only accepts the schedule type from CLIPTextEncodeList, not a plain CONDITIONING. If you don't have that node upstream, this input has nothing valid to connect to.
  • sequence_loop_count (default 20, 1–1024) - how many times to loop. Start small (4–8) while you're tuning everything else; 20 loops of a slow model is a long feedback cycle to debug against.
  • denoise_start (default 1) / denoise_seq (default 0.5) - the two denoise values that drive progression versus regeneration. This pair is worth understanding before touching anything else on the node.
  • sampler_name / scheduler - the same full sampler and scheduler lists as a standard KSampler.

Single output: LATENT.

How to install it

Via ComfyUI Manager: search "WAS_Extras", install, restart. Manually:

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

This node lives in ksampler_sequence.py, and the README is explicit that this file needs its requirements.txt installed even if you're grabbing individual .py files rather than the whole repo - don't skip it.

Common issues & troubleshooting

Can't connect a normal CLIP Text Encode to positive_seq. Expected - only CLIPTextEncodeList's CONDITIONING_SEQ output fits here. A plain CONDITIONING won't type-match.

Wired CLIPTextEncodeSequence2 in instead and it won't connect. That node's output type is CONDITIONING, built for KSamplerSeq2, not this node. The pack ships two parallel "sequence" systems (v1 here, v2 elsewhere) that don't cross-wire.

The image barely changes across loops, or changes too drastically. That's denoise_seq. Too low and successive loops barely move the image; too high and each loop is closer to a full regeneration, which fights the whole point of progression. 0.4–0.6 is a reasonable range to start experimenting in.

Long runs are slow to iterate on. This is genuinely an experimental, exploratory node - the README bills the whole pack that way. Drop sequence_loop_count down while dialing in denoise and slerp strengths, then raise it back up once the per-loop behavior looks right.

Categorysampling

Inputs (20)

NameTypeDefaultDescription
modelMODEL
seedINT00–18446744073709550000Base seed for the sequence.
seed_mode_seqCOMBOHow to evolve the seed each loop.
alternate_valuesBOOLEANtrueAlternate certain parameters every other loop.
stepsINT201–10000Sampler steps per loop.
cfgFLOAT8.00–100Classifier-free guidance.
sampler_nameCOMBOSampler algorithm.
schedulerCOMBONoise schedule.
sequence_loop_countINT201–1024How many loops to run.
positive_seqCONDITIONING_SEQList of positive conditionings with frame indices.
negative_seqCONDITIONING_SEQList of negative conditionings with frame indices.
use_conditioning_slerpBOOLEANfalseInterpolate between consecutive conditionings using slerp.
cond_slerp_strengthFLOAT0.5000–1Interpolation amount for slerp.
latent_imageLATENTInitial latent input.
use_latent_interpolationBOOLEANfalseBlend/slerp/cosine between consecutive outputs.
latent_interpolation_modeCOMBOMethod for latent interpolation.
latent_interp_strengthFLOAT0.5000–1Interpolation weight for latents.
denoise_startFLOAT1.000–1Denoise for the first loop (1.0 = full).
denoise_seqFLOAT0.500–1Denoise for subsequent loops.
unsample_latentsBOOLEANfalseReverse a few steps before resampling to add variation.

Outputs (1)

NameTypeDescription
LATENTLATENT