Nodes/ComfyUI-Apt_Preset/chx_Ksampler_Kontext_adv
ComfyUI Node

chx_Ksampler_Kontext_adv

KSamplerAdvanced-style step control for Kontext — also marked deprecated

By cardenluoĀ·Created 2 years agoĀ·Updated 18 days agoĀ· 309
chx_Ksampler_Kontext_adv
  • context
  • image
  • mask
  • redux_stack
  • union_stack
  • context
  • image
  • latent
ā—„add_noise▾►
ā—„seed0ā–ŗ
ā—„steps-1ā–ŗ
ā—„start_at_step0ā–ŗ
ā—„end_at_step1000ā–ŗ
ā—„return_with_leftover_noise▾►
ā—„prompt_weight0.50ā–ŗ
ā—„denoise1.00ā–ŗ
ā—„auto_adjust_imagefalseā–ŗ
ā—„image_outputPreviewā–ŗ
ā—„posā–ŗ

Same flag as its sibling: this node ships under Apt_Preset's own "🚫Deprecated🚫" category. If you're here because a saved workflow references it, that workflow predates whatever replaced the pack's Kontext controller stack - check the current README before building anything new on it. It still runs, and if you're maintaining an older graph it's worth understanding what it does, but it's not where the pack wants new work going.

What sets it apart from the non-advanced version

This is chx_Ksampler_Kontext with the same relationship stock ComfyUI's KSamplerAdvanced has to plain KSampler: it exposes step-range control instead of running the sampler start-to-finish in one call. That's genuinely useful for chaining sampling - running the first half of the steps with one setup and the second half with another (a common pattern for combining a base pass with a refine pass, or splitting a Kontext edit across two conditioning setups) - which is presumably why this variant existed alongside the simpler one in the first place.

Same Kontext editing model underneath, same licensing note worth repeating: Kontext's non-commercial license carries an anti-circumvention clause that makes NSFW LoRAs and fine-tunes a documented violation, and that's been enforced in practice - platforms have pulled NSFW Kontext derivatives over it. If your work needs an unrestricted instruction editor, Qwen-Image-Edit is the community's go-to Apache-2.0 alternative with no equivalent restriction.

The inputs and outputs that matter

The extra controls over the plain Kontext sampler are the tell that this is the "advanced" split-step version:

  • add_noise (enable/disable) - whether this call injects fresh noise at its starting step, exactly the same semantics as stock ComfyUI's KSamplerAdvanced. Disable it on a second call that's continuing from a first call's latent.
  • start_at_step / end_at_step - the step range this call actually samples, letting you split a full run across multiple calls (or multiple nodes) with different settings per range.
  • return_with_leftover_noise (disable/enable) - whether the output latent keeps unfinished noise for a subsequent sampling call to pick up, or returns as if sampling had completed.
  • steps (default -1, tooltip: -1 means no change) - the total step count this range is measured against, left alone unless explicitly set.
  • The rest - prompt_weight, denoise, auto_adjust_image, image_output, optional image/mask/redux_stack/union_stack/pos - carry the same roles as in the plain Kontext sampler.

Outputs: context, image, latent.

Installing it

Through ComfyUI Manager: search ComfyUI-Apt_Preset, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git

then install.bat on Windows for dependencies, restart. Needs a Flux Kontext checkpoint plus, if you're using them, Redux and Union ControlNet model files - none of it bundled with the pack.

Common issues

Confused about when to use this over the plain Kontext sampler. If you're not splitting sampling across steps or chaining multiple sampler calls on one latent, you don't need the extra complexity - the plain chx_Ksampler_Kontext covers a single-call edit fine. Reach for this one specifically when you need start_at_step/end_at_step control.

Output has residual noise, or looks unfinished. Check return_with_leftover_noise - if it's set to enable and nothing downstream is picking up that leftover noise for a final pass, you'll get an incomplete-looking result. Set it to disable on whatever call is meant to be the last one in the chain.

Given it's deprecated, behavior differs from what old tutorials describe. Reasonable to expect some drift if this node predates changes elsewhere in the pack's Kontext stack that it was never updated alongside. Cross-check against the pack's current README for the maintained path before spending much time debugging a deprecated node against old documentation.

CategoryApt_Preset/🚫Deprecated/🚫

Inputs (16)

NameTypeDefaultDescription
contextRUN_CONTEXT—
add_noiseCOMBO2 options: enable, disable
seedINT00–18446744073709550000—
stepsINT-1-1–10000-1 means no change
start_at_stepINT00–10000—
end_at_stepINT10000–10000—
return_with_leftover_noiseCOMBO2 options: disable, enable
prompt_weightFLOAT0.500–1—
denoiseFLOAT1.000–1—
auto_adjust_imageBOOLEANfalse—
image_outputCOMBOPreview5 options: None, Hide, Preview, Save, Hide/Save
imageoptIMAGE—
maskoptMASK—
redux_stackoptREDUX_STACK—
union_stackoptUNION_STACK—
posoptSTRING—

Outputs (3)

NameTypeDescription
contextRUN_CONTEXT—
imageIMAGE—
latentLATENT—