Nodes//Nougan Flux 3 RefMod Bake 🧬
ComfyUI Node

Nougan Flux 3 RefMod Bake 🧬

Bake your reference images into one file instead of re-encoding them every run

By WinnouganΒ·Created 3 months agoΒ·Updated about 16 hours agoΒ· 10
Nougan Flux 3 RefMod Bake 🧬
  • images
  • vae
  • image_2
  • image_3
  • image_4
  • path
β—„namemy_characterβ–Ί
β—„megapixels1.00β–Ί
β—„subfolderflux3β–Ί
β—„overwritefalseβ–Ί

Every reference-based workflow I've built eventually turns into the same pile: four Load Image nodes, a batch-join, a resize, a VAE Encode, and a nagging feeling that I'm computing the same latents for the fifth time today. Reference latents don't change. The images don't change. Only the prompt changes.

Nougan Flux 3 RefMod Bake 🧬 takes the pile and turns it into one file. Point it at your reference images, give it a name, and it writes a .safetensors into ComfyUI/models/refmods/flux3/ containing the VAE latents - ready to be attached to conditioning by name from then on.

Why Flux 3 makes this easy

Flux 3 in ComfyUI has a dedicated image_cond stream for reference latents, and its text encoder (Qwen3-VL-4B) is text-only. That combination is doing a lot of quiet work here: no model patch, no edit LoRA, no second copy of the image for the encoder. A RefMod is just the VAE latent, attached to the conditioning exactly the way core's Set Reference Multi Latent does it. One tensor per reference, float32 [1, 128, H/16, W/16], raw vae.encode() output.

Compare that with the Kontext-era and Krea 2 approaches, where a refmod had to store both a latent and a downscaled image because the text encoder needed to look at the picture. Flux 3's files are simpler. They're also a different format, marked with a nougan_flux3 metadata key - the H3, Qwen and MOSS refmod loaders ignore them, and these nodes ignore everything else. That's a feature: no accidental cross-wiring between model families.

What you set

images is the one that matters - every frame in the batch becomes one reference, capped at 16. So the way to bake four portraits is to hand it a batch of four, not to press bake four times. image_2, image_3 and image_4 are optional extra inputs if your graph already has images on separate lines.

vae - the Flux 2 / Flux 3 VAE. Not optional in spirit: wrong VAE, garbage latents, and you won't find out until the generation looks like static.

name - this is the filename (my_character.safetensors) and the name that shows up in the Apply node's dropdown. Use _v2 suffixes for versions rather than overwriting the only good bake you had.

megapixels (default 1.0, 0 to 16) - target size per reference, aspect preserved. 1.0 is roughly 1024Γ—1024. Here's the cost knob nobody mentions: every reference adds tokens to every step. Four references at 1MP is a very different bill than four at 0.4MP. Set it to 0 to keep each image's original size, which is usually the wrong instinct.

subfolder (flux3) and overwrite - where it lands in models/refmods, and whether re-baking a name is allowed. Default false means an accidental second bake won't clobber a file you liked.

Output

One output: path (STRING) - the file that was written. It's an output node, so it runs when you queue. Wire path into a Preview Any or a note if you want to see it; otherwise read it in the console.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Winnougan/Nougan_Nodes
# restart ComfyUI

Or ComfyUI Manager, search "Nougan". No models to download - but you do need a ComfyUI build with Flux 3 support, since the node leans on folder_paths and the Flux VAE path being present. The pack itself declares no pip dependencies. Hard-refresh the browser after restarting; the refmod cards are custom JS.

Set up a workflow like this:

Load Image(s) ──► Nougan Flux 3 RefMod Bake ──► models/refmods/flux3/<name>.safetensors
VAELoader (Flux) β”€β”˜

then run it once, and delete the bake node from your day-to-day graph. The file stays.

Where people get burned

Baking a batch you meant as one reference. Six frames of one character's video β†’ six references, six times the tokens, and a model that will happily try to jam six poses into one frame. If you want one reference, pass one image.

Wrong VAE. Flux 2/3 latents are 128-channel; an SD or Flux 1 VAE will produce something structurally wrong that fails late and confusingly.

Expecting it to work in a Krea 2 or MOSS graph. Different format, different loader. The metadata key is the wall, and it's deliberate.

Re-baking with overwrite off and assuming it failed. It refuses rather than replaces. That's the guard rail; flip the toggle when you actually mean it.

CategoryNougan/RefMod

Inputs (9)

NameTypeDefaultDescription
imagesIMAGEEvery frame in the batch becomes one reference (max 16).
vaeVAEThe Flux 2 / Flux 3 VAE.
nameSTRINGmy_characterβ€”
megapixelsFLOAT1.000–16Target size of each reference, aspect preserved (1.0 = about 1024x1024). Every reference adds tokens to every step. 0 keeps each image's own size.
subfolderSTRINGflux3β€”
overwriteBOOLEANfalseβ€”
image_2optIMAGEβ€”
image_3optIMAGEβ€”
image_4optIMAGEβ€”

Outputs (1)

NameTypeDescription
pathSTRINGβ€”