Nodes/WAS_Extras/KSampler Sequence (v2)
ComfyUI Node

KSampler Sequence (v2)

Sine-modulated denoise and seed keying for prompt progression

By WASasquatch·Created 3 years ago·Updated 11 days ago· 43
KSampler Sequence (v2)
  • model
  • positive_seq
  • negative_seq
  • latent_image
  • LATENT
seed0
seed_mode_seq
alternate_valuestrue
steps20
cfg8.0
sampler_name
scheduler
frame_count0
cond_keyframes0
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
inject_noisetrue
noise_strength0.100
denoise_sinetrue
denoise_max0.900
seed_keyingtrue
seed_keying_mode
seed_divisor4

This is the more elaborate sibling of KSampler Sequence (KSamplerSeq). Same core idea - loop a KSampler across multiple passes, evolving prompt and seed as you go - but v2 trades the v1 node's inline frameIndex:prompt scheduling for separate frame_count/cond_keyframes inputs (matching CLIPTextEncodeSequence2 upstream), and adds a handful of knobs v1 doesn't have: noise injection between loops, sine-modulated denoise, and periodic seed keying.

How it works

The base loop mechanic is the same as v1: denoise_start runs the first pass, denoise_seq covers the rest, seed evolves per seed_mode_seq, and you get the same conditioning-slerp (use_conditioning_slerp/cond_slerp_strength) and latent-interpolation (use_latent_interpolation/latent_interpolation_mode/latent_interp_strength) smoothing options plus unsample_latents for controlled variation.

Where v2 diverges is three added systems, all optional and all off some by default:

Noise injection. inject_noise (default true) adds random noise between loops at noise_strength - a different variation mechanism than unsample_latents, injecting fresh randomness rather than reversing existing steps.

Sine-modulated denoise. denoise_sine (default true) varies the effective denoise over the loop sequence using a sine wave up to denoise_max, instead of holding denoise_seq flat across every loop. The practical effect is a pulsing rhythm to how much each loop changes, rather than a constant nudge.

Seed keying. seed_keying (default true) modulates the seed on a schedule rather than simply incrementing or randomizing it - seed_keying_mode picks sine or modulo, and seed_divisor sets the period. This is for deliberately periodic patterns across the sequence rather than a monotonic drift.

All three default on, which means v2 behaves noticeably differently out of the box than v1 even at matching denoise_seq/seed_mode_seq settings - worth knowing before comparing the two side by side.

The inputs and outputs that matter

  • model, latent_image - usual sampler inputs.
  • positive_seq / negative_seq (CONDITIONING) - note the type: plain CONDITIONING, not CONDITIONING_SEQ. This node pairs with CLIPTextEncodeSequence2, not CLIPTextEncodeList.
  • frame_count / cond_keyframes (INT) - the schedule metadata that CLIPTextEncodeSequence2 outputs alongside its conditioning; wire all three across from that node, not just the conditioning.
  • denoise_sine / denoise_max - if you want v1's flatter, predictable denoise_seq behavior instead, turn denoise_sine off.
  • inject_noise / noise_strength, seed_keying / seed_keying_mode / seed_divisor - the three extra systems above; all can be disabled individually if you want closer-to-v1 behavior with the rest of v2's wiring.

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

Same ksampler_sequence.py file as v1 and both CLIP Text Encode Sequence nodes - the requirements.txt install is needed for all four, whether you clone the repo or copy individual files.

Common issues & troubleshooting

Wired CLIPTextEncodeList's output in and it won't connect. That node outputs CONDITIONING_SEQ, which doesn't match this node's CONDITIONING-typed positive_seq/negative_seq. Use CLIPTextEncodeSequence2 upstream instead.

Only wired the conditioning and left frame_count/cond_keyframes disconnected. Both need to come from CLIPTextEncodeSequence2's matching outputs - this node's schedule awareness depends on them, not just the conditioning tensor.

Results feel wildly different from v1 at "the same" settings. That's the three defaulted-on systems - denoise_sine, inject_noise, and seed_keying are all active out of the box and none of them exist in v1. Turn them off one at a time if you're trying to reproduce v1-like, more predictable behavior.

Output has a visible pulsing or periodic quality you didn't ask for. Check denoise_sine and seed_keying - both introduce genuinely periodic effects by design (a sine wave and a modulo/sine seed schedule respectively). If you want steady, monotonic progression instead, disable both and set denoise_seq directly like v1 does.

Categorysampling

Inputs (28)

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.
frame_countINT00–1024Total frames to run. If 0, inferred from conditionings.
cond_keyframesINT00–1024Keyframe indices to advance conditionings (list).
positive_seqCONDITIONINGPositive conditioning list.
negative_seqCONDITIONINGNegative conditioning list.
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.
inject_noiseBOOLEANtrueAdd random noise between loops for variety.
noise_strengthFLOAT0.1000.001–1Magnitude of injected noise.
denoise_sineBOOLEANtrueVary denoise over loops using a sine wave.
denoise_maxFLOAT0.9000–1Max denoise when sine modulation is enabled.
seed_keyingBOOLEANtrueModulate seed by a schedule to create patterns.
seed_keying_modeCOMBOMode for seed modulation.
seed_divisorINT42–1024Period or divisor for seed/keyframe modulation.

Outputs (1)

NameTypeDescription
LATENTLATENT