DiffSynth: FLUX.2 Inference
FLUX.2 Inference — Klein in four steps, and a mask socket for inpainting
- pipe
- input_image
- edit_image
- initial_noise
- inpaint_mask
- image
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_imagewithedit_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_sizeandinpaint_blur_sigma, both 0 by default). If your seam is visible, that's what the blur pair is for; start with a small nonzeroinpaint_blur_sizeand ainpaint_blur_sigmaaround 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.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| pipe | DIFFSYNTH_PIPE | — | |
| prompt | STRING | — | |
| seed | INT | 00–4294967295 | — |
| num_inference_steps | INT | 301–200 | — |
| height | INT | 102464–4096 | — |
| width | INT | 102464–4096 | — |
| negative_promptopt | STRING | — | |
| cfg_scaleopt | FLOAT | 1.00–10000 | — |
| embedded_guidanceopt | FLOAT | 4.00–10000 | — |
| input_imageopt | IMAGE | — | |
| denoising_strengthopt | FLOAT | 1.00–10000 | — |
| edit_imageopt | IMAGE | — | |
| edit_image_auto_resizeopt | BOOLEAN | true | — |
| initial_noiseopt | * | — | |
| inpaint_maskopt | IMAGE | — | |
| inpaint_blur_sizeopt | INT | 00–4294967295 | — |
| inpaint_blur_sigmaopt | FLOAT | 0.00–10000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |