ComfyUI Node

D2 KSampler

The all-in-one sampler that decodes its own image

By da2el-ai·Created 2 years ago·Updated about a month ago· 66
D2 KSampler
  • latent_image
  • model
  • clip
  • vae
  • cnet_stack
  • d2_pipe
  • IMAGE
  • LATENT
  • MODEL
  • CLIP
  • positive
  • formatted_positive
  • negative
  • positive_cond
  • negative_cond
  • d2_pipe
seed0
steps20
cfg7.00
sampler_name
scheduler
denoise1.00
preview_method
positive
negative

Stock ComfyUI makes you assemble a sampler from five nodes: KSampler, CLIP Text Encode (twice), a VAE Decode, and a PreViewImage, with a ControlNet apply thrown in if you're feeling spicy. D2 KSampler collapses that whole column into one node that takes your prompts as plain STRING fields, runs the sample, decodes the latent with its own VAE, and hands you a finished IMAGE on the other side. It is the D2 pack's centerpiece, and it's the node almost everything else in the pack plugs into.

It's not just fewer nodes - it's a different way of wiring. The d2_pipe in particular: connect one wire from a D2 Checkpoint Loader or D2 Load Diffusion Model Set and the sampler gets model, clip, and VAE all at once. Connect it to a D2 XY Plot node and it'll sweep seeds, CFG, or prompts across a grid automatically. This is the node that makes the pack's XY Plot and batch features make sense.

The inputs that matter

  • positive / negative - prompts as multiline STRING fields, no CLIP encode node required.
  • seed / steps / cfg / sampler_name / scheduler / denoise / latent_image - the standard KSampler controls, all present.
  • preview_method - how the preview renders mid-generation (auto, latent2rgb, taesd, vae_decoded_only, none).
  • model, clip, vae - all optional now; a connected d2_pipe supplies them.
  • cnet_stack - plug in a D2 Controlnet Loader chain here for simple ControlNet.
  • d2_pipe - the consolidated parameter bundle.

The one rule that trips everyone: when a d2_pipe is connected, the pipe's values win over the widget values - so if XY Plot says steps 15 and the node shows steps 20, the grid uses 15. The exceptions are model/clip/vae and the conditioning inputs, where a direct wire beats the pipe.

Outputs

IMAGE (the decoded result - that's why you don't need a VAE Decode node), LATENT, MODEL and CLIP (with any LoRA applied), the positive/negative strings, formatted_positive (prompt with A1111-style <lora:...> tags stripped out - the node loads those LoRAs itself), positive_cond/negative_cond conditioning, and the d2_pipe.

Installing it

ComfyUI Manager → search "D2-nodes-ComfyUI" → install, or:

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

Restart. No model downloads, deps are piexif and charset-normalizer. Since v32.0.0 the pack requires ComfyUI's V3 schema; older builds should use a pre-32.0.0 version.

Where people get burned

The pipe-priority rule above is the #1 confusion. Second is the A1111-style LoRA loading: it only fires if you write <lora:name:1> inside the positive prompt - if you're using a separate D2 Load Lora node, that's fine, but double-loading the same LoRA both ways will stack strengths and give you overcooked results. Also note the denoise field: at 1.0 with a full-size latent you get a text-to-image run; drop it below 1 with an input latent and you're doing img2img. The node won't warn you which one you've built, but the output will.

CategoryD2

Inputs (15)

NameTypeDefaultDescription
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
denoiseFLOAT1.000–1
preview_methodCOMBO5 options: auto, latent2rgb, taesd, vae_decoded_only, none
positiveSTRING
negativeSTRING
modeloptMODEL
clipoptCLIP
vaeoptVAE
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