KSampler Advanced XY ๐
The stock advanced sampler, wired to accept a whole batch of models
- model_xy
- positive
- negative
- latent_image
- LATENT
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.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model_xy | XY_MODEL | โ | |
| add_noise | COMBO | 2 options: enable, disable | |
| noise_seed | INT | 00โ18446744073709550000 | โ |
| steps | INT | 201โ10000 | โ |
| cfg | FLOAT | 8.00โ100 | โ |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| positive | CONDITIONING | โ | |
| negative | CONDITIONING | โ | |
| latent_image | LATENT | โ | |
| start_at_step | INT | 00โ10000 | โ |
| end_at_step | INT | 100000โ10000 | โ |
| return_with_leftover_noise | COMBO | 2 options: disable, enable |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | โ |