Nodes/comfyui-sdnq/SDNQ Sampler
ComfyUI Node

SDNQ Sampler

Run FLUX and Qwen-Image on a 12GB card without rebuilding your graph

By EnragedAntelope·Created 9 months ago·Updated 5 months ago· 83
SDNQ Sampler
  • image1
  • image2
  • image3
  • image4
  • image
  • latent
model_selectionFLUX.1-dev-qint8
custom_model_path
prompt
negative_promptblurry, low quality, distorted, deformed, ugly, bad anatomy, bad hands, text, watermark, signature
steps25
cfg7.0
width1024
height1024
seed0
schedulerDPMSolverMultistepScheduler
dtypebfloat16
memory_modebalanced
auto_downloadtrue
lora_selection[None]
lora_custom_path
lora_strength1.00
lora2_selection[None]
lora2_custom_path
lora2_strength1.00
lora3_selection[None]
lora3_custom_path
lora3_strength1.00
lora4_selection[None]
lora4_custom_path
lora4_strength1.00
lora5_selection[None]
lora5_custom_path
lora5_strength1.00
use_quantized_matmultrue
use_xformersfalse
enable_vae_tilingfalse
image_resizeNo Resize
num_frames1

The SDNQ Sampler is the one node in comfyui-sdnq you'll actually use, and it's a different beast from what you're used to in ComfyUI. Instead of the usual graph - checkpoint loader, CLIP, VAE, sampler, decode - it's a single box that loads a pre-quantized model, downloads it if you don't have it, runs the denoise loop, and hands you a finished image. Drop it in, pick a model, type a prompt, hit queue. That's the whole pitch, and it genuinely works.

Why would you want that? Because the model list is the draw. Thirty-plus pre-quantized builds of FLUX.1, FLUX.2, Qwen-Image, Z-Image, SD3.5, even LTX-2 video, all hosted by Disty0's SDNQ collection. The quantization is SDNQ, Disty0's own engine that registers itself into diffusers via an import side effect - the pack's own source literally calls from sdnq import SDNQConfig to hook in. The node then loads through DiffusionPipeline.from_pretrained, which is why it can swallow FLUX and Qwen and Z-Image alike without caring what architecture they are. This is diffusers running inside ComfyUI, not ComfyUI's native loaders.

That's also the catch, and you should know it before you fall in love: it's a walled garden. You can't wire your own VAE, CLIP, or ControlNet into it, and your LoRAs go through the node's own dropdowns, not the ComfyUI LoRA loader. What you get in return is VRAM relief - the advertised 50-75% saving is in the right ballpark for the uint4 builds - plus zero setup for models that would otherwise take you an afternoon of GGUF hunting. It's the "I just want to see what FLUX.2 looks like" node. There's a case to use it forever; there's also a case to treat it as a demo and graduate to a native workflow when you outgrow it.

The inputs that matter

The dropdown list is long, so start with the sensible defaults rather than reading everything:

  • model_selection - 31 pre-configured models, each auto-downloaded from HuggingFace on first use. FLUX.1-dev-SDNQ-uint4 or Qwen-Image-SDNQ-uint4 are safe first picks. [Custom Path] plus custom_model_path lets you point at a local diffusers directory if you'd rather manage downloads yourself.
  • prompt / negative_prompt - self-explanatory, but note the tooltip: FLUX-schnell runs at cfg 0 and ignores your negative prompt entirely. Don't be surprised when it does.
  • scheduler - the one that bites. The tooltip is emphatic for a reason: FlowMatchEulerDiscreteScheduler for FLUX/SD3/Qwen/Z-Image, DPMSolverMultistepScheduler/Euler/UniPC for SDXL/SD1.5. Wrong family = broken, banded garbage. The default is DPM, so if you're on a flow-matching model, switch it before your first queue.
  • memory_mode - gpu (24GB+), balanced (12-16GB, the default), or lowvram (8GB, sequential offload, slowest). Same logic as ComfyUI's own low-VRAM flags: only climb down as far as you need to.
  • cfg, steps, seed, width, height, dtype - the usual knobs; bfloat16 is the right dtype for FLUX on a modern card.

Outputs are image (an IMAGE tensor, feed it to any preview/save node) and latent (LATENT, if you want to pass the result on). For LTX-2 video, set num_frames above 1 and you get a batch of frames out.

Install

ComfyUI Manager → search "comfyui-sdnq" → install → restart. Manual:

cd ComfyUI/custom_nodes/
git clone https://github.com/EnragedAntelope/comfyui-sdnq.git
cd comfyui-sdnq && pip install -r requirements.txt

The requirements pull in sdnq>=0.1.7, diffusers ≥0.36, huggingface-hub, safetensors, accelerate, and hf-xet for fast chunked downloads. First model fetch is 5-20GB and lands in ComfyUI/models/diffusers/sdnq/.

Where people get burned

The number-one troubleshooting section in the README is library versions, because it's the real problem. Newest models (FLUX.2-klein, GLM-Image, Qwen-Image-2512, LTX-2) need diffusers built from source:

pip install --upgrade transformers diffusers
pip install git+https://github.com/huggingface/diffusers.git

If you hit a Config has no attribute error, that's exactly this. Slow? Install Triton (pip install triton on Linux, triton-windows on Windows) to unlock the quantized matmul path - the node auto-disables it if Triton's missing. OOM at big resolutions? Toggle enable_vae_tiling and/or drop to a uint4 model. And remember the quantization rule from the broader ComfyUI world: it exists so models fit, not so they're faster - if the full model already fits your card, uint4 buys you little and costs quality in fine details like eyes. Use it when you need it.

It's opinionated, it's a one-shot convenience box, and for running bleeding-edge models on modest VRAM it's the fastest on-ramp there is.

Categorysampling/SDNQ

Inputs (37)

NameTypeDefaultDescription
model_selectionCOMBOFLUX.1-dev-qint8Select a pre-configured SDNQ model (auto-downloads from HuggingFace) or choose [Custom Path] to specify a local model directory
custom_model_pathSTRINGLocal path to SDNQ model directory (only used when [Custom Path] is selected). Example: /path/to/model or C:\path\to\model
promptSTRINGText description of the image to generate. Be descriptive for best results.
negative_promptSTRINGblurry, low quality, distorted, deformed, ugly, bad anatomy, bad hands, text, watermark, signatureWhat to avoid in the image. Default includes common quality issues. Clear this for no negative prompt. Note: FLUX-schnell (cfg=0) ignores negative prompts.
stepsINT251–150Number of denoising steps. More steps = better quality but slower. 20-30 is typical for most models.
cfgFLOAT7.00–30Guidance scale - how closely to follow the prompt. Higher = more literal. FLUX-schnell uses 0.0, FLUX-dev uses 3.5-7.0, SDXL uses 7.0-9.0.
widthINT102464–4096Image width in pixels. Must be multiple of 8. Larger = more VRAM usage. 1024 is standard for FLUX/SDXL.
heightINT102464–4096Image height in pixels. Must be multiple of 8. Larger = more VRAM usage. 1024 is standard for FLUX/SDXL.
seedINT00–18446744073709550000Random seed for reproducible generation. Same seed + settings = same image.
schedulerCOMBODPMSolverMultistepScheduler⚠️ IMPORTANT: Use FlowMatchEulerDiscreteScheduler for FLUX/SD3/Qwen/Z-Image. Use DPMSolver/Euler/UniPC for SDXL/SD1.5. Wrong scheduler = broken images!
dtypeCOMBObfloat16Model precision. bfloat16 recommended for FLUX (best quality/speed). float16 for older GPUs. float32 for CPU.
memory_modeCOMBObalancedMemory management: 'gpu' = All on GPU (fastest, needs 24GB+ VRAM). 'balanced' = Model offloading (12-16GB VRAM). 'lowvram' = Sequential offloading (8GB VRAM, slowest).
auto_downloadBOOLEANtrueAutomatically download model from HuggingFace if not found locally. Disable to only use local models.
lora_selectionoptCOMBO[None]Select LoRA from ComfyUI loras folder ([None] = disabled, [Custom Path] = use custom path below). LoRAs add styles or concepts to generation.
lora_custom_pathoptSTRINGCustom LoRA path or HuggingFace repo ID (only used when [Custom Path] is selected). Example: /path/to/lora.safetensors or username/lora-repo
lora_strengthoptFLOAT1.00-5–5LoRA 1 influence strength. 1.0 = full strength, 0.5 = half strength, 0.0 = disabled. Negative values invert the LoRA effect. Range: -5.0 to +5.0.
lora2_selectionoptCOMBO[None]Optional second LoRA. Select from ComfyUI loras folder or use [Custom Path].
lora2_custom_pathoptSTRINGCustom path for LoRA 2 (only used when [Custom Path] is selected).
lora2_strengthoptFLOAT1.00-5–5LoRA 2 influence strength.
lora3_selectionoptCOMBO[None]Optional third LoRA. Select from ComfyUI loras folder or use [Custom Path].
lora3_custom_pathoptSTRINGCustom path for LoRA 3 (only used when [Custom Path] is selected).
lora3_strengthoptFLOAT1.00-5–5LoRA 3 influence strength.
lora4_selectionoptCOMBO[None]Optional fourth LoRA. Select from ComfyUI loras folder or use [Custom Path].
lora4_custom_pathoptSTRINGCustom path for LoRA 4 (only used when [Custom Path] is selected).
lora4_strengthoptFLOAT1.00-5–5LoRA 4 influence strength.
lora5_selectionoptCOMBO[None]Optional fifth LoRA. Select from ComfyUI loras folder or use [Custom Path].
lora5_custom_pathoptSTRINGCustom path for LoRA 5 (only used when [Custom Path] is selected).
lora5_strengthoptFLOAT1.00-5–5LoRA 5 influence strength.
use_quantized_matmuloptBOOLEANtrueEnable Triton quantized matmul for 30-80% speedup. Uses torch.compile internally for dequantization. Linux: 'pip install triton'. Windows: 'pip install triton-windows'. Auto-disabled if unavailable.
use_xformersoptBOOLEANfalseEnable xFormers memory-efficient attention for 10-45% speedup. Works with all memory modes (gpu/balanced/lowvram). Auto-fallback to SDPA if xformers not installed or incompatible. Requires: pip install xformers
enable_vae_tilingoptBOOLEANfalseEnable VAE tiling for very large images (>1536px). Prevents out-of-memory errors on high resolutions. Minimal performance impact. Recommended for images >1536x1536.
image1optIMAGEOptional source image for image editing models (Qwen-Image-Edit, ChronoEdit, etc.). Leave unconnected for text-to-image generation.
image2optIMAGEOptional second image for multi-image editing models (Qwen-Image-Edit-2509/2511). Not all models support multiple images.
image3optIMAGEOptional third image for multi-image editing models.
image4optIMAGEOptional fourth image for multi-image editing models.
image_resizeoptCOMBONo ResizeResize input images before processing. Smaller = faster inference, less VRAM. 'No Resize' keeps original dimensions.
num_framesoptINT11–257Number of frames for video models (LTX-2, Wan). Set to 1 for image models. Video models: 161 frames ~= 6 sec at 25fps. Must be divisible by 8+1 for some models.

Outputs (2)

NameTypeDescription
imageIMAGE
latentLATENT