Nodes/FLUX.2 SDNQ/FLUX.2 SDNQ Image Edit
ComfyUI Node

FLUX.2 SDNQ Image Edit

Change a photo instead of dreaming a new one

By GeneralShan·Created 6 months ago·Updated 6 months ago· 0
FLUX.2 SDNQ Image Edit
  • pipeline
  • references
  • IMAGE
prompt
steps4
seed0
num_images1
width0
height0

Editing is the reason Klein exists, full stop. Qwen-Image-Edit might hold a face better and Z-Image can't edit at all - but Klein is the model that lets you hand it a photo and say "make this," at 4 steps, on consumer hardware. This node is that capability inside the FLUX.2 SDNQ pack: feed it a pipeline from the Loader plus one or more reference images, give it an instruction, and get back an edited IMAGE.

The genuinely cool part is that references are ordered and growable. The references input is an autogrow socket - add reference0, reference1, up to 8 of them, and they're fed to the pipeline in order. That's what turns this from a simple img2img into a multi-reference compositor: three references on a Klein 4B was enough for someone to do virtual try-on with a ~100% success rate and no LoRA. Character sheets, subject-plus-style combos, "swap the jacket, keep the pose" - order matters, and reference0 is special.

Size, defaults, and what to set

  • references - connect only the sockets you need. When width and height are left at 0, reference0 anchors the output size - the edit comes out at the same dimensions as your first image. That's the behavior you want 95% of the time. If you override width/height, multiples of 16, up to 16384.
  • prompt - this is where Klein editing earns and loses its reputation, and the rules are the opposite of generator prompting. The community's hard-won guidance: treat the prompt as a Photoshop command list, not a scene description. "Direct, Technical, Post-Processing Prompts" - remove blur and noise, fix exposure and color profile, histogram equalization, shadow recovery - work far better than "make it beautiful." micro-contrast is specifically preferred over sharp because it doesn't add fake wrinkles or lashes. For scene changes, name what must not change: "Zoom out until the woman's white sneakers are visible. Maintain the faces. Maintain the posture."
  • steps - 4 default, same distilled logic as the Text to Image node. Klein's identity drift on edits is its known weak spot, and bumping to 8 (plus the CFG nudge) helps anatomy more than it helps identity - expect some drift and retry with the seed if the face wanders.
  • seed / num_images - standard; 0 is random, and you can batch up to 8 outputs to pick a winner.
  • pipeline - the FLUX2_SDNQ_PIPELINE from the Loader. Required.

Output

One IMAGE output. Wire it to a preview or save node like anything else. It's a plain image - no mask, no alpha, so if you want region-limited edits you'll do them the Comfy way (mask out, then run) rather than inside this node.

Install and gotchas

Pack-level install applies: ComfyUI Manager → FLUX.2 SDNQ, or git clone https://github.com/GeneralShan/comfyui-flux2-sdnq into custom_nodes, restart, and have sdnq/diffusers/peft pip-installed (ComfyUI 0.17+, Python 3.12+). The repo ships example workflows - flux2_klein_sdnq_image_edit.json and a multi-reference variant - that are the fastest way to see the autogrow sockets in action.

Known friction points, in order of how often people hit them:

  • Identity drift. Klein doesn't hold faces like Qwen-Image-Edit does. It looks more realistic and drifts more. Keep prompts focused on the action on the file, name what must survive, and batch a few seeds.
  • A warm color shift on edits. Reproducible, independent of quantization. Fix with a histogram/color match against the source image in your post-processing.
  • Reference order. The first reference anchors size and sets the tone. Swap the order and the output changes meaningfully.
  • Memory. Multi-reference edits are the pack's heaviest operation, and on a 12 GB card the decode is the first thing to blow up. If an edit OOMs, drop references, run the text_encoder_residency auto policy, and drop a Clear Caches node after heavy runs to hand the VRAM back.
Categoryflux2/sdnq

Inputs (8)

NameTypeDefaultDescription
pipelineFLUX2_SDNQ_PIPELINE
referencesCOMFY_AUTOGROW_V3Ordered FLUX.2 references. Connect only the sockets you need. reference0 anchors the default output size when width and height are 0.
promptSTRINGPrompt describing the desired edit.
stepsINT41–100Number of denoising steps. Distilled defaults are intentionally low.
seedINT00–18446744073709550000Random seed for the latent noise.
num_imagesINT11–8Number of images to generate for the prompt.
widthINT00–16384Optional output width override. Leave at 0 to match the reference-image size.
heightINT00–16384Optional output height override. Leave at 0 to match the reference-image size.

Outputs (1)

NameTypeDescription
IMAGEIMAGE