D2 KSampler(Advanced)
A KSampler that decodes its own image and reads its prompts as text
- 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
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_interpretationto take effect. - "Wrong" steps/cfg - a
d2_pipeis 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 inComfyUI/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.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| add_noise | COMBO | 2 options: enable, disable | |
| noise_seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 7.000–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 | |
| latent_image | LATENT | — | |
| start_at_step | INT | 00–10000 | — |
| end_at_step | INT | 100000–10000 | — |
| return_with_leftover_noise | COMBO | 2 options: disable, enable | |
| token_normalization | COMBO | 4 options: none, mean, length, length+mean | |
| weight_interpretation | COMBO | 5 options: comfy, A1111, compel, comfy++, down_weight | |
| preview_method | COMBO | 5 options: auto, latent2rgb, taesd, vae_decoded_only, none | |
| positive | STRING | — | |
| negative | STRING | — | |
| modelopt | MODEL | — | |
| clipopt | CLIP | — | |
| vaeopt | VAE | — | |
| positive_condopt | CONDITIONING | — | |
| negative_condopt | CONDITIONING | — | |
| cnet_stackopt | D2_CNET_STACK | — | |
| d2_pipeopt | D2_TD2Pipe | — |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| LATENT | LATENT | — |
| MODEL | MODEL | — |
| CLIP | CLIP | — |
| positive | STRING | — |
| formatted_positive | STRING | — |
| negative | STRING | — |
| positive_cond | CONDITIONING | — |
| negative_cond | CONDITIONING | — |
| d2_pipe | D2_TD2Pipe | — |