Nodes/D2 Nodes ComfyUI/D2 KSampler(Advanced)
ComfyUI Node

D2 KSampler(Advanced)

A KSampler that decodes its own image and reads its prompts as text

By da2el-ai·Created 2 years ago·Updated about a month ago· 66
D2 KSampler(Advanced)
  • latent_image
  • model
  • clip
  • vae
  • positive_cond
  • negative_cond
  • cnet_stack
  • d2_pipe
  • IMAGE
  • LATENT
  • MODEL
  • CLIP
  • positive
  • formatted_positive
  • negative
  • positive_cond
  • negative_cond
  • d2_pipe
add_noise
noise_seed0
steps20
cfg7.00
sampler_name
scheduler
start_at_step0
end_at_step10000
return_with_leftover_noise
token_normalization
weight_interpretation
preview_method
positive
negative

The standard KSampler is a fine citizen, but it has a habit of making your graph needlessly tall: CLIP text encode on one side, VAE decode on the other, and a conditioning wire you can't easily inspect. D2 KSampler(Advanced) is the pack's take on fixing that friction - it takes your prompts as plain STRING, does the encoding and decoding internally, and hands you an IMAGE plus a d2_pipe that carries every parameter forward in one wire. It's the sampler around which the whole D2 ecosystem is built.

What's actually different

Three things, and they're the whole pitch. First, it outputs an IMAGE directly - no separate VAE Decode node needed. Second, positive and negative are plain multiline text boxes instead of CONDITIONING sockets, which means you can wire in a text node, a regex node, or an XY plot's output without an encoder in between. Third, it understands A1111-style LoRA tags in the prompt: write <lora:foo.safetensors:1> and it'll load and apply the LoRA to model and CLIP for you, stripping the tag out of the formatted prompt. That last bit is genuinely handy if you're coming from webui habits.

The "Advanced" adds the controls the basic version hides: add_noise, start_at_step / end_at_step, return_with_leftover_noise, plus token_normalization and weight_interpretation (the A1111-style prompt weight algorithms). The weight settings only actually do something if you have Advanced CLIP Text Encode installed - otherwise they're inert, so don't go hunting for bugs if you set A1111 and nothing changes.

The d2_pipe gotcha that bites everyone

Connect a d2_pipe (from D2 XY Plot Easy, or a D2 Checkpoint Loader) and it works the way you'd hope, with one exception that's easy to trip on: pipe values take priority over the widget values. If D2 XY Plot Easy sends steps: 15 through the pipe and this node shows steps: 20, you get 15 steps. The author is explicit about this in the docs. The counter-rule is that model, clip, vae, positive_cond and negative_cond give priority to directly-connected inputs - a direct wire beats the pipe. So when something "ignores" your widget settings, look for a pipe feeding the node before you look for a bug.

Inputs and outputs you'll actually set

For a normal run you touch noise_seed, steps, cfg, sampler_name, scheduler, latent_image, and the two prompt boxes. end_at_step defaults to 10000, which just means "run to the end" - leave it. The outputs worth knowing: IMAGE (the decoded result), LATENT (for passing into a second pass), formatted_positive (prompt with LoRA tags stripped out, useful for metadata), and d2_pipe (wire this into D2 Save Image Eagle so your saved files get full A1111-style generation params without you typing a word).

Installing

Part of the D2 Nodes ComfyUI pack:

cd ComfyUI/custom_nodes
git clone https://github.com/da2el-ai/D2-nodes-ComfyUI

or search "D2 Nodes ComfyUI" in ComfyUI Manager. No model downloads, just the pack's light deps (piexif, charset-normalizer). Since v32.0.0 the pack needs ComfyUI's V3 schema, so old ComfyUI installs should pin to an earlier release.

Troubleshooting

  • Prompt weights "not working" - you need Advanced CLIP Text Encode installed for weight_interpretation to take effect.
  • "Wrong" steps/cfg - a d2_pipe is overriding the widgets. Unplug the pipe or change the source.
  • LoRA not loading - the syntax is strictly <lora:name:strength>. The name must match a file in ComfyUI/models/loras.
  • Can't find the image output - it is an output node, but IMAGE still flows to whatever you connect next.

If all you need is a sampler, the stock one works. If you want text prompts, A1111 LoRA tags, one-wire plumbing and a metadata pipeline that follows you to Eagle, this is the one the pack was built around.

CategoryD2

Inputs (22)

NameTypeDefaultDescription
add_noiseCOMBO2 options: enable, disable
noise_seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT7.000–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
latent_imageLATENT
start_at_stepINT00–10000
end_at_stepINT100000–10000
return_with_leftover_noiseCOMBO2 options: disable, enable
token_normalizationCOMBO4 options: none, mean, length, length+mean
weight_interpretationCOMBO5 options: comfy, A1111, compel, comfy++, down_weight
preview_methodCOMBO5 options: auto, latent2rgb, taesd, vae_decoded_only, none
positiveSTRING
negativeSTRING
modeloptMODEL
clipoptCLIP
vaeoptVAE
positive_condoptCONDITIONING
negative_condoptCONDITIONING
cnet_stackoptD2_CNET_STACK
d2_pipeoptD2_TD2Pipe

Outputs (10)

NameTypeDescription
IMAGEIMAGE
LATENTLATENT
MODELMODEL
CLIPCLIP
positiveSTRING
formatted_positiveSTRING
negativeSTRING
positive_condCONDITIONING
negative_condCONDITIONING
d2_pipeD2_TD2Pipe