Nodes/bsz-cui-extras/BSZ Principled Sampler
ComfyUI Node

BSZ Principled Sampler

One sampler that runs base + refiner, and fixes batch seeds while it's at it

By Beinsezii·Created 3 years ago·Updated 2 years ago· 27
BSZ Principled Sampler
  • base_model
  • base_clip
  • latent
  • refiner_model
  • refiner_clip
  • latent
  • positive_prompt
  • negative_prompt
  • steps
  • denoise
  • cfg
  • refiner_amount
  • refiner_asc_pos
  • refiner_asc_neg
  • sampler
  • scheduler
  • seed
positive_promptanalogue photograph of a kitten
negative_promptblurry, cropped, text
steps30
denoise1.00
cfg8.00
refiner_amount0.15
refiner_asc_pos6.00
refiner_asc_neg2.50
samplereuler
scheduler
seed0

BSZ Principled Sampler is the flagship node of this pack: a whole text-to-image / image-to-image pipeline - prompting, conditioning, base sampling, optional SDXL refiner pass - collapsed into one node. It's opinionated, it's handy, and it does one thing stock ComfyUI genuinely gets wrong: batches are seeded by increment, so batch index 3 of seed 4 is the same image as seed 7. No more "why does my batch look nothing like the seed I picked?"

Why you'd reach for it

You want the whole SDXL base-plus-refiner dance without babysitting five KSamplers, you want your conditioning to auto-fit the latent's resolution, and you want batch results that are actually reproducible. This node gives you all of that in one box. The author's design philosophy (from the pack FAQ) is chained single-stage nodes rather than all-in-one monsters, because that plays nice with ComfyUI's caching - but the sampler itself is deliberately the big convenience node.

It also has real history: when Terminus XL - a v-prediction, zero-terminal-SNR SDXL model - shipped, its author pointed people at Beinsezii's BSZ nodes as the way to run it properly in ComfyUI. Full control over sampling start/end steps and force-full-denoise is exactly what zero-terminal-SNR models need, and this node has it.

Inputs that matter

  • base_model / base_clip - from your Load Checkpoint.
  • latent - empty latent, or the input image's latent for img2img.
  • positive_prompt / negative_prompt - plain text, no conditioning nodes needed.
  • steps, denoise, cfg - the usual knobs. README recommendation: denoise 0.3 for img2img / pixel scale, 0.6 for latent scale.
  • refiner_model / refiner_clip - optional, and you must supply both or neither. Only one raises an error.
  • refiner_amount - fraction of steps handed to the refiner (default 0.15).
  • refiner_asc_pos / refiner_asc_neg - refiner aesthetic scores; ignored unless your refiner is SDXL-refiner architecture.
  • sampler / scheduler - defaults euler + normal, which the README says are what you want for proper refiner use.

Outputs: the latent, plus echoes of every setting - positive/negative prompt, steps, denoise, cfg, refiner values, sampler, scheduler, seed. That echo list is the point: you can chain this node into a second stage (like BSZ Principled Scale) and pass the exact same settings forward.

How it works

Under the hood it's two common_ksampler calls: a base pass from start_step to base_end (computed from denoise and refiner_amount), then a refiner pass with noise disabled, then it restores the original noise function. The seed-by-increment behavior comes from hot-patching comfy.sample.prepare_noise so each batch slot gets seed + index - and it carefully restores the original function afterward, including on errors.

Install & gotchas

cd ComfyUI/custom_nodes
git clone https://github.com/Beinsezii/bsz-cui-extras

restart, or use ComfyUI Manager. No requirements to install. Two things to watch: it hot-patches a ComfyUI internals function while running, so it's worth keeping ComfyUI reasonably current - and the conditioning it builds internally is resolution-aware (see BSZ Principled Conditioning), so don't feed it a latent whose aspect is wildly off from what your model was trained on. Also note the author's FAQ: they recommend launching ComfyUI with --preview-method latent2rgb so you get live previews of each stage, since this node runs long.

Categorybeinsezii/sampling

Inputs (16)

NameTypeDefaultDescription
base_modelMODEL
base_clipCLIP
latentLATENT
positive_promptSTRINGanalogue photograph of a kitten
negative_promptSTRINGblurry, cropped, text
stepsINT300–10000
denoiseFLOAT1.000–1
cfgFLOAT8.000–100
refiner_amountFLOAT0.150–1
refiner_asc_posFLOAT6.000–1000
refiner_asc_negFLOAT2.500–1000
samplerCOMBOeuler34 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +28
schedulerCOMBO9 options: normal, karras, exponential, sgm_uniform, simple, ddim_uniform, +3
seedINT00–18446744073709550000
refiner_modeloptMODEL
refiner_clipoptCLIP

Outputs (12)

NameTypeDescription
latentLATENT
positive_promptSTRING
negative_promptSTRING
stepsINT
denoiseFLOAT
cfgFLOAT
refiner_amountFLOAT
refiner_asc_posFLOAT
refiner_asc_negFLOAT
samplereuler,euler_cfg_pp,euler_ancestral,euler_ancestral_cfg_pp,heun,heunpp2,dpm_2,dpm_2_ancestral,lms,dpm_fast,dpm_adaptive,dpmpp_2s_ancestral,dpmpp_2s_ancestral_cfg_pp,dpmpp_sde,dpmpp_sde_gpu,dpmpp_2m,dpmpp_2m_cfg_pp,dpmpp_2m_sde,dpmpp_2m_sde_gpu,dpmpp_3m_sde,dpmpp_3m_sde_gpu,ddpm,lcm,ipndm,ipndm_v,deis,res_multistep,res_multistep_cfg_pp,res_multistep_ancestral,res_multistep_ancestral_cfg_pp,gradient_estimation,ddim,uni_pc,uni_pc_bh2
schedulernormal,karras,exponential,sgm_uniform,simple,ddim_uniform,beta,linear_quadratic,kl_optimal
seedINT