Nodes/ComfyUI-DSD/DSD Image Generator
ComfyUI Node

DSD Image Generator

Subject-preserving FLUX without training a LoRA

By irreveloper·Created about a year ago·Updated about a year ago· 42
DSD Image Generator
  • dsd_model
  • image
  • resize_params
  • image
  • reference_image
  • seed
prompt
negative_prompt
seed0
guidance_scale3.5
image_guidance_scale1.0
text_guidance_scale1.0
num_inference_steps28
width1024
height512
use_gemini_promptfalse

This is the payoff node. You hand it a photo of a subject - a character, a product, your dog - plus a sentence, and it generates that subject in a brand-new context, no per-instance training required. Where IP-Adapter and PuLID inject image embeddings through attention, DSD (Diffusion Self-Distillation) goes bigger: it's a research model from primecai that the community met with a now-famous "End of LoRA?" thread on r/StableDiffusion in March 2025. The honest read on that thread, even from fans: it threatens character LoRAs, not style LoRAs, and it eats VRAM (people were reporting roughly 24GB just to run it). It's a zero-shot subject-preservation model built on a FLUX.1-schnell base - not a speed hack.

How it works

DSD generates on a wide canvas. Your reference image gets resized to height × width/2 and slotted into the left half; the model denoises the right half conditioned on it. The reference is VAE-encoded and fed into the transformer as a conditioning signal, and the usual single CFG scale is split in two - one direction pulls the image toward your reference (image_guidance_scale), the other toward your text (text_guidance_scale). When decoding finishes, the canvas is cut down the middle: the right half is your generated image, the left half is returned as reference_image so you can eyeball exactly what the model was preserving.

That two-scale CFG is the thing to play with. If your subject drifts, raise image_guidance_scale; if your text prompt gets ignored, raise text_guidance_scale. The overall guidance_scale (3.5 default) stays in charge of prompt adherence.

The inputs that matter

  • dsd_model - comes from the DSD Model Downloader or Loader; nothing else will plug in.
  • image - your subject photo. Feed it something clean and well-lit; garbage in, garbage subject.
  • prompt / negative_prompt - multiline. The model strips newlines itself.
  • seed - 0 means "surprise me." The node rolls a random one and returns it on the seed output so you can lock in a keeper.
  • width / height - default 1024×512. Here's the trap: that's the combined canvas width, so at defaults you actually get two 512×512 panels, not a 1024-wide image. Expect the output to be width/2 square.
  • num_inference_steps - 28 default; lower it if you're memory-constrained.
  • use_gemini_prompt - cosmetic. It doesn't call Gemini itself (the Enhancer node does that); it only toggles the status text. What actually matters is wiring the enhanced prompt into this node's prompt input.
  • resize_params (optional) - from DSD Resize Selector; controls how your photo is crammed into the reference slot. Leave it unconnected and you get the same resize_and_center_crop behavior anyway.

The outputs are image (the real result, wire it to a Save Image), reference_image (the left panel), and seed.

Installing and first run

Install the pack, then grab the model - see the DSD Model Downloader article for the full dance. Fair warning: your first run of this node triggers two big downloads (the DSD transformer plus the FLUX.1-schnell base it loads behind the scenes), and generation is heavy. The README's own memory advice is the right ladder: stay on bfloat16, drop resolution, cut steps, and only reach for the CPU-offload options on the loader if you're truly VRAM-starved.

If you get CUDA out-of-memory, it's not a bug in the node - it's the nature of running a FLUX-sized conditional model locally. Drop to 512×512 and 20 steps and see if it breathes.

Wiring the whole thing

Load → (Downloader or Loader) → Image Generator, Load Image → Image Generator, and the two dsd_model/image wires are the whole graph. For better subject descriptions, route the Gemini Enhancer's output into prompt. That's the entire intended workflow, and it's refreshingly small.

CategoryDSD

Inputs (13)

NameTypeDefaultDescription
dsd_modelDSD_MODEL
imageIMAGE
promptSTRING
negative_promptSTRING
seedINT00–2147483647
guidance_scaleFLOAT3.50–20
image_guidance_scaleFLOAT1.00–20
text_guidance_scaleFLOAT1.00–20
num_inference_stepsINT281–100
widthINT1024512–2048
heightINT512512–2048
use_gemini_promptBOOLEANfalse
resize_paramsoptRESIZE_PARAMS

Outputs (3)

NameTypeDescription
imageIMAGE
reference_imageIMAGE
seedINT