NakuNode Flux2 Image Reference
Flux2 reference images without the reference loader — the stats-based way
- vae
- image1
- image2
- image3
- image4
- image5
- conditioning
- CONDITIONING
Here's the thing about Flux2: reference editing is already built in. Both Dev and Klein accept multiple reference images natively - it's the whole reason people reach for the model to edit a photo rather than dream a new one. So when you find a one-file custom node claiming to add image reference to Flux2, the question is what it does differently.
NakuNode Flux2 Image Reference takes a much hackier road. Instead of feeding your reference images into the model's own attention machinery, it VAE-encodes them, squashes each latent down to a handful of statistics, and adds those straight into your text conditioning. It's not "preserve this exact face" editing. It's "steer the whole image toward this reference's look" - think mood, palette, composition, not identity. For that job it's genuinely handy, and it's one of the few nodes you can read in full in about ten minutes.
How it works
Wire up to five images into image1 through image5. The node encodes each one through whatever VAE you give it, then computes per-latent statistics (mean and std; min and max get added when there's no text conditioning to work with). Those stats are averaged across all your images, scaled by strength, and - this is the neat part - added to every token of your text embedding. It's a global nudge in latent-statistics space rather than a per-pixel attention edit, so the image's influence lands uniformly on the prompt.
The code is refreshingly honest about its own limits. The comments literally describe the injection as a "simplified implementation" and note that a real one needs more complex attention operations. Read that as: it works, but don't expect it to do what Flux2's native reference mechanism does.
The inputs that matter
- vae (required) - a VAE from any standard VAE loader. Match it to your checkpoint. This is the one input a beginner usually gets wrong, and a mismatched VAE gives the washed-out colors you'd see anywhere else in ComfyUI.
- strength (default 1.0, range 0.0–2.0) - how hard the image stats push on your conditioning. 0 = ignored; values much past 1 start fighting your prompt.
- image1–image5 (optional) - reference images from a Load Image node. At least one must be connected.
- conditioning (optional) - normal text conditioning from your text encoder. Connect it. See below.
Output is a single CONDITIONING that goes straight into your sampler's positive input, next to (or instead of) your normal text conditioning.
Installing it
No model downloads, no dependencies - the node only imports torch and comfy.model_management, both already in ComfyUI, and there's no requirements.txt. In ComfyUI Manager, search for "ComfyUI_Flux2ImageReference", or:
cd ComfyUI/custom_nodes
git clone https://github.com/naku-yh/ComfyUI_Flux2ImageReference.git
Restart ComfyUI and the node appears as "NakuNode Flux2 Image Reference" in the NakuNode_Flux2 category.
Where it bites
"Optional" images aren't optional. The schema lists all five images as optional, so ComfyUI won't warn you - but if all five are empty the node raises At least one image is required. Easy to hit, easy to fix, baffling the first time.
Leave conditioning unplugged and it gets weird. With no text conditioning, the node fabricates a 768-dim embedding from the image stats and calls it conditioning. 768 is a CLIP-era assumption - Flux2's conditioning is built from a Qwen3 LLM with far larger hidden states, so that fallback path is where this node behaves most erratically. Always feed it a real conditioning.
It's not the native reference path. If you actually want Klein's editing - holding a face, following a character sheet - use ComfyUI's built-in Flux2 reference loader, and kv-fp8 weights if you want the cached-reference speedup. This node is the quick "match this image's vibe" tool, not the identity-preserving one. Treat it as a complement, and you'll be happy with it; treat it as a replacement, and you'll be disappointed.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| vae | VAE | — | |
| strength | FLOAT | 1.000–2 | — |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| image5opt | IMAGE | — | |
| conditioningopt | CONDITIONING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |