Nodes//Nougan Krea 2 RefMod Bake 🧬
ComfyUI Node

Nougan Krea 2 RefMod Bake 🧬

Reusable Krea 2 references β€” if you've done the two things Krea 2 demands first

By WinnouganΒ·Created 3 months agoΒ·Updated about 16 hours agoΒ· 10
Nougan Krea 2 RefMod Bake 🧬
  • images
  • vae
  • image_2
  • image_3
  • image_4
  • path
β—„namemy_characterβ–Ί
β—„resolution1024β–Ί
β—„subfolderkrea2β–Ί
β—„overwritefalseβ–Ί

Krea 2 is a lovely base model and a stubborn one. Stock Krea 2 ignores reference latents. Feed it a character reference and it will nod politely and generate whatever it wanted. So before Nougan Krea 2 RefMod Bake 🧬 can be useful to you, two things have to be true, and the pack is refreshingly honest about this:

  1. You have a Krea 2 edit LoRA trained with ai-toolkit (krea2 arch, model_kwargs.edit: true).
  2. You have ostris/ComfyUI-Krea2-Ostris-Edit installed, with its Krea 2 Ostris Edit Model Patch node sitting on your MODEL line - and kv_cache off unless the LoRA was trained with it.

The pack deliberately does not vendor that patch. What it does is give you the storage layer: bake references into one file, then encode them with the matching Encode node, producing the same conditioning the Ostris encode node produces.

What it bakes, and why there are two tensors per reference

Krea 2's edit path doesn't just hand the DiT some latents. The text encoder also looks at each reference image - its input becomes Picture 1: <|vision_start|><|image_pad|><|vision_end|>… stitched onto your prompt - and each image is fitted (never upscaled) into 384Γ—384 total pixels, because that's what training did.

So every baked reference stores two things: the raw latent (vae.encode() of the reference fitted to ~1MP and snapped to 16px so the latent grid patchifies), and a small uint8 copy of the image at 384Γ—384-ish for the encoder. Baking doesn't remove the encoder pass, it removes the VAE pass and gives you a library. That's still the win.

Files carry a nougan_krea2 metadata key, so H3, Qwen, MOSS and Flux 3 refmods can't be confused with them.

Inputs

images - the batch. Every frame becomes one reference, capped at 8. If you hand it five frames of one clip expecting one character, you'll get five references and a token bill to match.

vae - the Krea 2 VAE.

name - filename and dropdown label. subfolder defaults to krea2, overwrite defaults to off.

resolution (default 1024, 0 = no cap) - references larger than resolution Γ— resolution are scaled down to fit and snapped to 16px, never upscaled. 1024 is the ~1MP training default, so leaving it alone is usually right. Drop it to 768 if you're stacking several references and want the step time back.

image_2…image_4 - optional extra inputs for graphs where images arrive on separate wires.

One output: path (STRING), the file that was written. It's an output node, so it runs on queue.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Winnougan/Nougan_Nodes
git clone https://github.com/ostris/ComfyUI-Krea2-Ostris-Edit
# restart ComfyUI

Or install both through ComfyUI Manager (search "Nougan" and "Krea2 Ostris"). Restart, hard-refresh with Ctrl+F5 so the refmod card UI loads, and confirm the console announced the pack's families on boot. Check the Ostris patch node is on your MODEL path before blaming the bake.

Where people get burned

"The reference does nothing." Nine times out of ten there's no model patch on the MODEL line, or kv_cache is on for a LoRA that wasn't trained with it. The bake isn't the problem; the conditioning is never being read.

Resolution fights. Krea 2's latent grid needs the reference snapped to 16px - the node does that for you, but if you hand it a weird aspect at resolution 0 you can still hit awkward shapes. 1024 is the safe harbour.

Baking the whole clip. Batch in, references out. Count your frames before you queue.

Licence amnesia. Krea 2 ships under the Krea 2 Community License - commercial use under a $1M trailing-twelve-month revenue threshold, with an acceptable-use policy that explicitly bans circumventing safety measures and watermarks. The single most popular thing people do with Krea 2 is the one the licence prohibits. Worth knowing before you ship anything.

CategoryNougan/RefMod

Inputs (9)

NameTypeDefaultDescription
imagesIMAGEEvery frame in the batch becomes one reference (max 8).
vaeVAEThe Krea 2 VAE.
nameSTRINGmy_characterβ€”
resolutionINT10240–4096References larger than resolution x resolution pixels are scaled down to fit (1024 = ~1MP, the training default; never upscaled), then snapped to 16 px. 0 = no cap.
subfolderSTRINGkrea2β€”
overwriteBOOLEANfalseβ€”
image_2optIMAGEβ€”
image_3optIMAGEβ€”
image_4optIMAGEβ€”

Outputs (1)

NameTypeDescription
pathSTRINGβ€”