Nodes/comfy-switch-samplers/CrossStepSwitchKSampler
ComfyUI Node

CrossStepSwitchKSampler

SDXL to Flux in One Node, Latent Bridge Included

By azazeal04·Created 11 months ago·Updated 11 months ago· 4
CrossStepSwitchKSampler
  • model1
  • positive1
  • negative1
  • vae1
  • model2
  • positive2
  • negative2
  • vae2
  • latent_image
  • LATENT
seed0
total_steps20
switch_point10
sampler_before
sampler_after
scheduler_before
scheduler_after
cfg_before7.5
cfg_after7.5
denoise_before1.00
denoise_after1.00

This is the headline node of the Azazeal / Switch Samplers pack, and it's the one people actually recommend the repo for. Two sampling stages, but this time each stage gets its own model, VAE and conditioning - the README pitches it as SDXL → Flux. Sample with SDXL for composition, then hand off to Flux for the polish pass.

You've been able to fake this by hand for a while: sample, decode to pixels, re-encode with the other model's VAE, sample again. The community was describing exactly that workflow on r/comfyui years ago. What this node adds is making the handoff automatic and keeping all the per-stage settings in one place.

How it works

Stage 1 runs model1 for switch_point steps with sampler_before/scheduler_before/cfg_before, using positive1/negative1 and vae1. Then comes the bridge: if the two VAEs differ, it decodes stage 1's latent to pixels and re-encodes them with vae2. Same VAE on both stages? The latent passes straight through, no decode/encode at all. Stage 2 then runs model2 for the remaining total_steps - switch_point steps with its own sampler, scheduler, CFG, denoise and conditioning.

The bridge also snaps dimensions to multiples of 8 (bilinear) and has code paths for video-shaped tensors - the author tested the pack with Wan models, and it shows.

Why the separate conditioning matters

This is the detail people get wrong first. You cannot feed an SDXL text encode to Flux. Flux's conditioning comes from its dual CLIP-L + T5 encoder, which is a different stack entirely. So positive1/negative1 come from your SDXL CLIP, and positive2/negative2 come from Flux's own encoder - wire each stage from the right text encoder or the second stage won't know what you asked for.

One nuance: Flux Dev is guidance-distilled and has no real negative-prompt mechanism. The negative2 slot is required, but it's largely a formality - hook it to an empty or zeroed conditioning from the Flux CLIP rather than reusing your SDXL negative.

The inputs that matter

  • model1 / vae1 / positive1 / negative1 and model2 / vae2 / positive2 / negative2 - two complete stacks. There's no way around it; this node holds two architectures.
  • total_steps and switch_point - the handoff (defaults 20 and 10).
  • sampler/scheduler/cfg/denoise before and after - per-stage recipes. Same denoise rule as the rest of the pack: leave denoise_after at 1.0 and stage 2 restarts instead of refining; 0.5–0.7 makes it a real pass over the first result.
  • seed and latent_image - usual suspects.

Output is a single LATENT, straight into a VAE Decode.

Installing it

The whole pack installs in one shot, with zero dependencies and no model downloads - it only calls ComfyUI's own sampler internals:

cd ComfyUI/custom_nodes
git clone https://github.com/azazeal04/comfyui-switch-samplers.git

Restart ComfyUI (or search comfyui-switch-samplers in ComfyUI Manager) and it appears under Azazeal / Switch Samplers.

Where people get burned

  • VRAM. Two models, two VAEs, two text encoders resident at once. On 12GB this is rough; on 8GB it's mostly a non-starter. Load Flux's T5 in fp8 if you can - it saves a chunk of VRAM for negligible quality loss.
  • The bridge is lossy. Every VAE decode/encode round trip costs detail - that's true of all of ComfyUI, not this node, but it's worth remembering before you turn every image into a two-architecture pipeline. Use the cross switch as a targeted second pass, not a habit.
  • Latent channel mismatches. SDXL lives in a 4-channel latent, Flux in 16. The node validates this and raises a clear error if the numbers don't line up - usually a sign the wrong VAE got wired.
  • Same denoise trap as the whole pack. Stage 2 at 1.0 is a fresh generation wearing stage 1's latent as a trench coat.

For same-family blending this is overkill - StepSwitchKSampler does that with one conditioning pair. But for a real cross-architecture handoff, SDXL structure → Flux light and texture, this is the node that makes it one box instead of a plumbing project.

CategoryAzazeal / Switch Samplers

Inputs (20)

NameTypeDefaultDescription
model1MODEL
positive1CONDITIONING
negative1CONDITIONING
vae1VAE
model2MODEL
positive2CONDITIONING
negative2CONDITIONING
vae2VAE
seedINT00–18446744073709550000
total_stepsINT20
switch_pointINT10
sampler_beforeCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
sampler_afterCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
scheduler_beforeCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
scheduler_afterCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
cfg_beforeFLOAT7.50–100
cfg_afterFLOAT7.50–100
denoise_beforeFLOAT1.000–1
denoise_afterFLOAT1.000–1
latent_imageLATENT

Outputs (1)

NameTypeDescription
LATENTLATENT