Nodes/DiffSynth-ComfyUI/DiffSynth: FLUX.2 Inference
ComfyUI Node

DiffSynth: FLUX.2 Inference

FLUX.2 Inference — Klein in four steps, and a mask socket for inpainting

By modelscope·Created about a month ago·Updated a day ago· 8
DiffSynth: FLUX.2 Inference
  • pipe
  • input_image
  • edit_image
  • initial_noise
  • inpaint_mask
  • image
◄prompt►
◄seed0►
◄num_inference_steps30►
◄height1024►
◄width1024►
◄negative_prompt►
◄cfg_scale1.0►
◄embedded_guidance4.0►
◄denoising_strength1.0►
◄edit_image_auto_resizetrue►
◄inpaint_blur_size0►
◄inpaint_blur_sigma0.0►

Text to image, plus the multi-reference and inpainting paths FLUX.2 is actually good at. Required sockets: pipe (from the FLUX.2 Loader), prompt, seed, num_inference_steps, height, width. Optional ones split into three groups: guidance, image inputs, and inpainting. Output: image → Save Image.

Guidance first, because this is where people lose an evening

cfg_scale defaults to 1 and embedded_guidance defaults to 4. That pairing is not a typo - FLUX.2 dev is guidance-distilled, meaning the model takes its own distilled guidance in the conditioning rather than relying on a second unconditional pass. CFG 1 is the intended setting, and raising it doesn't buy adherence, it applies the correction twice and roughly doubles your render time. If you want more control, move embedded_guidance in small steps, not cfg_scale.

Which checkpoint you loaded decides the numbers. Klein distilled: 4 steps, CFG 1, and the template says exactly that. Dev: 50 steps in the shipped workflow. If you're on a base Klein rather than the distilled one, the whole picture inverts - 50 steps, real CFG of 4-5 - and that's the single most common bad take on the family.

negative_prompt deserves a mention for the same reason: at CFG 1 it is discarded outright, since ComfyUI skips the unconditional pass entirely. Constraint has to be written as presence in the positive prompt. Get above CFG 1 on a base checkpoint and the negative box comes back to life.

The image sockets

  • input_image + denoising_strength - the plain img2img pass. Strength default is 1.0, meaning the input is ignored; drop it to 0.4-0.6 to keep structure.
  • edit_image with edit_image_auto_resize (default on) - the reference-image path. FLUX.2's party trick is taking up to ten references, and this is the socket that does it. Auto-resize keeps you from fighting aspect ratios; turn it off when you specifically want the model to see the original framing.
  • initial_noise - a wildcard socket. Wire a latent or tensor here and the pipeline starts from your noise instead of fresh RNG, which is how you reproduce or hand off a trajectory.
  • inpaint_mask, inpaint_blur_size, inpaint_blur_sigma - a real inpainting path, not a stitch-around: mask in, optional feather (inpaint_blur_size and inpaint_blur_sigma, both 0 by default). If your seam is visible, that's what the blur pair is for; start with a small nonzero inpaint_blur_size and a inpaint_blur_sigma around 1-2 rather than cranking either.

Install

# Manager: search "DiffSynth-ComfyUI" → Install → restart
pip install git+https://github.com/modelscope/DiffSynth-Studio.git
cd ComfyUI/custom_nodes && git clone https://github.com/modelscope/DiffSynth-ComfyUI.git

Then Template tab → the DiffSynth FLUX.2 workflow for the checkpoint you downloaded. Dev, Klein 4B and Klein 9B all have one, and they're the same graph with different model ids - which makes them the easiest way to A/B the family.

Troubleshooting

Washed-out, deep-fried output on a Klein run almost always means cfg_scale crept above 1; put it back. A four-step Klein render that looks like a photograph of a smear means you're running base weights at distilled settings. Times that feel double what they should be are usually the same CFG problem - you're paying for an unconditional pass the model didn't need. And on VRAM: dev quantized is 18-24GB territory, Klein 4B is around 13GB, so if a run dies at the first step, that's a memory problem and the VRAM Limit buffer plus offload is where you fix it, not height/width.

CategoryDiffSynth/inference

Inputs (17)

NameTypeDefaultDescription
pipeDIFFSYNTH_PIPE—
promptSTRING—
seedINT00–4294967295—
num_inference_stepsINT301–200—
heightINT102464–4096—
widthINT102464–4096—
negative_promptoptSTRING—
cfg_scaleoptFLOAT1.00–10000—
embedded_guidanceoptFLOAT4.00–10000—
input_imageoptIMAGE—
denoising_strengthoptFLOAT1.00–10000—
edit_imageoptIMAGE—
edit_image_auto_resizeoptBOOLEANtrue—
initial_noiseopt*—
inpaint_maskoptIMAGE—
inpaint_blur_sizeoptINT00–4294967295—
inpaint_blur_sigmaoptFLOAT0.00–10000—

Outputs (1)

NameTypeDescription
imageIMAGE—