Nodes/Krea 2 Ostris Edit/Krea 2 Ostris Edit Model Patch
ComfyUI Node

Krea 2 Ostris Edit Model Patch

The node that makes Krea 2 actually edit your image

By ostris·Created about a month ago·Updated about a month ago· 277
Krea 2 Ostris Edit Model Patch
  • model
  • MODEL
kv_cachefalse

The whole trick in one node

Krea 2 is a text-to-image model. Hand it a reference image and a sentence and it will politely ignore the image, because the stock checkpoint was never trained to consume one. The Krea 2 Ostris Edit Model Patch is the half of Ostris's edit workflow that fixes that: it patches the loaded Krea 2 model so it actually reads the reference latents sitting in your conditioning.

You won't use it alone. This is the second half of a pair - Text Encode Krea 2 Ostris Edit builds the conditioning with your images in it, and this node makes the model respect it. If you've loaded an edit LoRA trained with ai-toolkit's krea2 arch (that's model_kwargs.edit: true) but skipped the patch, you'll get whatever the LoRA does to a plain text prompt - the reference image never reaches the model. That's the exact failure mode this node exists to prevent.

How it works

The patch uses what ai-toolkit calls the index_timestep_zero reference method. Each reference is appended to the image token sequence and conditioned at timestep 0, and the denoising prediction only ever has to cover the target image's tokens. The references are the context; the generation is the answer.

Because the reference latents come embedded in the conditioning (the text-encode node attaches them when you connect a VAE), and the LoRA was trained against this exact layout, the model behaves like the editor it was trained to be. Nice property worth knowing: if the conditioning has no reference latents, the patched model behaves exactly like stock - so it's safe to leave it in the graph permanently.

The two inputs, and the trap

  • model - wire this from your diffusion model, after the edit LoRA. The README's chain is Load Diffusion Model → Load LoRA → this patch → KSampler.
  • kv_cache (default off) - caches the reference tokens' attention K/V in a single t=0 pass and reuses them every step, so the references never ride along in the per-step sequence. Faster, especially at many steps. Here's the trap: it only works if the LoRA was trained with ai-toolkit's kv_cache model kwarg. For normally trained edit LoRAs, leave it off, or you'll get wrong output and blame the wrong thing.

Wiring

Load Diffusion Model (krea2) -> Load LoRA -> Krea 2 Ostris Edit Model Patch -> KSampler

That's the whole positive path. The negative path is the text encoder with a prompt and no images - reference latents belong on the positive side only.

Install

Same story for the whole pack. Search "Krea 2 Ostris Edit" in ComfyUI Manager, or:

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

then restart. No extra dependencies. The nodes appear under ostris/krea2. This is a first-party pack from Ostris, the same developer behind ai-toolkit, so it tracks whatever the trainer does - check for updates when you train something new.

Issues to expect

Set expectations before you judge the results. The whole method is experimental, and the community's honest read is that Krea 2 will alter the input image, drift slightly on lighting and color, and sometimes produce faulty output on horizontal aspect ratios. It is not Qwen-Image-Edit or Flux Kontext precision - don't hold it to that bar. Hold it to "you can now train edit LoRAs for Krea 2," which is genuinely new.

Where people actually get burned:

  • No reference latents in the conditioning - you forgot the VAE on the encode node, or chained a node that doesn't pass them through. The patch then silently behaves like stock, and the image does nothing.
  • kv_cache flipped on for a LoRA that wasn't trained for it.
  • Expecting editing precision from a text-to-image model with a reference bolted on. It's a hint and a strong LoRA, not a warp tool.
Categoryostris/krea2

Inputs (2)

NameTypeDefaultDescription
modelMODEL
kv_cacheBOOLEANfalseCache the reference tokens' attention K/V: they are precomputed in one t=0 pass and reused every denoising step, so the refs never ride along in the per-step sequence. The LoRA must be trained with ai-toolkit's kv_cache model kwarg for this to work properly. Leave off for normal edit LoRAs.

Outputs (1)

NameTypeDescription
MODELMODEL