Nodes/cgem156-ComfyUI๐ŸŒ/KSampler Advanced XY ๐ŸŒ
ComfyUI Node

KSampler Advanced XY ๐ŸŒ

The stock advanced sampler, wired to accept a whole batch of models

By laksjdjfยทCreated 2 years agoยทUpdated about a month agoยท 93
KSampler Advanced XY ๐ŸŒ
  • model_xy
  • positive
  • negative
  • latent_image
  • LATENT
โ—„add_noiseโ–พโ–บ
โ—„noise_seed0โ–บ
โ—„steps20โ–บ
โ—„cfg8.0โ–บ
โ—„sampler_nameโ–พโ–บ
โ—„schedulerโ–พโ–บ
โ—„start_at_step0โ–บ
โ—„end_at_step10000โ–บ
โ—„return_with_leftover_noiseโ–พโ–บ

If you've ever built an XY comparison grid by hand - reload the checkpoint with LoRA strength 0.4, render, bump to 0.6, render, bump to 0.8, render - you know how much manual reloading that involves. This node exists to let you skip the manual part: it's a near-clone of ComfyUI's stock KSampler (Advanced), except its model slot expects a batch of models instead of just one, so a whole comparison sweep can run through a single queue.

What "XY" means here

The node lives in the pack's lora_xy folder, which is built around comparing something - most obviously LoRA strength - across a grid of values without you manually re-running the graph for each point. This sampler is the execution half of that pipeline: instead of taking a single MODEL, its model_xy input takes an XY_MODEL, a custom type that represents a batch of model variants (say, the same checkpoint patched with a LoRA at several different strengths). Feed that batch through this sampler once, and you get a batch of results back - a full comparison sweep in one queue instead of one manual run per data point.

The companion node that actually builds an XY_MODEL from a base model and a range of values isn't part of this batch of articles, but it lives in the same lora_xy category - this sampler is only useful paired with it.

Inputs and outputs

Almost a direct match to the stock KSampler (Advanced), with one swap:

  • model_xy - the XY_MODEL batch, instead of a plain MODEL.
  • add_noise, noise_seed, steps, cfg, sampler_name, scheduler - the usual sampling controls, same defaults you'd expect (20 steps, CFG 8).
  • positive / negative - CONDITIONING, same as any sampler.
  • latent_image - your starting latent.
  • start_at_step / end_at_step - partial-sampling range controls, same as stock KSampler (Advanced), useful if this is one stage of a multi-pass pipeline.
  • return_with_leftover_noise - same semantics as stock: whether to hand back a fully denoised latent or one with noise still left for a follow-up sampler.

Output is a single LATENT - a batch, matching the batch dimension of whatever model_xy fed in.

Installing it

ComfyUI Manager, search "cgem156-ComfyUI". Manual clone:

cd ComfyUI/custom_nodes
git clone https://github.com/laksjdjf/cgem156-ComfyUI

Restart ComfyUI afterward. No model download tied to this node - it's a sampling wrapper around whatever checkpoint and LoRAs you're already using.

Common issues

The obvious trap: plugging a plain MODEL into model_xy won't work, because it's typed for a batch, not a single model - this node only makes sense downstream of whatever lora_xy node produces that batch in the first place. If your batch of models has a different batch size than your latent_image, expect a shape mismatch rather than a silent broadcast - line those up before queuing. And because this is fundamentally running N model variants through sampling at once, VRAM and time cost scale with however many points are in your comparison sweep - a 10-point LoRA-strength grid is 10x the compute of a single render, same as if you'd done it manually, just automated instead of tedious.

Categorycgem156 ๐ŸŒ/lora_xy

Inputs (13)

NameTypeDefaultDescription
model_xyXY_MODELโ€”
add_noiseCOMBO2 options: enable, disable
noise_seedINT00โ€“18446744073709550000โ€”
stepsINT201โ€“10000โ€”
cfgFLOAT8.00โ€“100โ€”
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
positiveCONDITIONINGโ€”
negativeCONDITIONINGโ€”
latent_imageLATENTโ€”
start_at_stepINT00โ€“10000โ€”
end_at_stepINT100000โ€“10000โ€”
return_with_leftover_noiseCOMBO2 options: disable, enable

Outputs (1)

NameTypeDescription
LATENTLATENTโ€”