Nodes/ComfyUI-MaxedOut/Krea 2 Edit MXD
ComfyUI Node

Krea 2 Edit MXD

Making Krea 2 stop redrawing the face you liked

By Maxed-Out-99·Created about a year ago·Updated 5 days ago· 9
Krea 2 Edit MXD
  • model
  • image_1
  • image_2
  • image_1_boost_mask
  • image_2_boost_mask
  • vae
  • model
  • source_latent
image_1_boost1.00
image_2_boost1.00

Instruction editing has one chronic flaw: the model re-emits the entire frame, so the pixels you never mentioned still drift. Faces change identity across a chain of edits, backgrounds get "improved", the logo relocates. Every editing stack since Kontext has been a fight against that, and the answer is always the same shape - keep a clean copy of the source inside the model's attention instead of hoping the noisy latents remember it.

This node is that answer for Krea 2, with a dial per reference image.

How it works

It clones your MODEL and wraps the diffusion forward. On every step it takes the current noisy latent, VAE-encodes each reference image at exactly the resolution you're sampling (center-cropped to fit, or fitted inside a 16-aligned box when the aspect is way off), then prepends those clean source tokens in front of the target tokens with stride-1 position ids centred in the grid. The blocks run over text + source + target together, and only the target slice comes back out.

So the model isn't editing from a compressed memory of your image - it's attending to a clean, latent-matched copy on every step. References are cached per (image index, height, width), so changing sampler resolution forces a re-encode rather than reusing something stale.

Boost is the knob on top. 1.0 means unchanged, and the code skips it entirely; anything else becomes an attention bias on the target-to-source attention columns, added on a log scale. So image_1_boost: 2.0 doubles the pull toward Image 1, and 0.0 all but mutes it (the bias floors at log(1e-4)). Attach a boost mask and only the white areas get boosted - that's the face-pinning trick the tooltip is describing.

The sockets

Required: model and image_1 (the scene, or the picture you're editing). Optional but load-bearing:

  • vae - the tooltip says Required and the node means it; leave the socket empty and it raises Connect a VAE to Krea 2 Edit MXD. Use the VAE Krea 2 ships with.
  • image_2 - a second reference, typically a subject to place into Image 1. It stays internal to the wrapper.
  • image_1_boost / image_1_boost_mask and image_2_boost / image_2_boost_mask - the per-image dials. Image 2's boost does nothing when Image 2 is disconnected, which is a sensible no-op rather than a bug.

Two outputs: model, which goes into your sampler, and source_latent - deliberately just the plain VAE latent of Image 1, encoded at its native size, with Image 2 nowhere in it. That's what you feed as the sampler's starting latent, which is also how your output resolution gets set. Image 1's size is your target size.

Install

ComfyUI Manager: search Maxed Out, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/Maxed-Out-99/ComfyUI-MaxedOut.git

Restart after install. No pip dependencies in the pack, and no separate Krea 2 Edit node pack required - the source-preservation path is vendored inside these MXD nodes, adapted from Conrad Locke's Apache-2.0 comfyui-krea2edit with the upstream revision recorded in the file header. Weights are on you to download; the pack ships code only.

Practical notes and traps

Use it with the encode node, not instead of it. This one preserves the pixels; Krea2 Edit MXD (the grounded encode) puts the instruction and reference through Qwen3-VL. Krea 2's encoder was chosen as a vision model precisely so an edit path could exist, and the functional edit LoRAs are trained against that combination. One without the other is half a workflow.

Exact filenames are easy to confuse. Krea 2 Edit MXD is this node, the model patch. Krea2 Edit MXD is the encoder. One space and one digit apart, and people wire the wrong one.

Boost trades prompt adherence for likeness. Stay near 1–2 while dialling it in; the widget goes to 1000, but a source that dominates attention is a source that ignores your instruction.

You pay for the extra tokens every step. Each reference is its own grid of tokens in the attention sequence on every sampling step, so two references at high resolution are measurably slower than one. Drop Image 2 when you don't need it.

Patch once, on the model everything downstream shares. Since it wraps MODEL, every sampler after it inherits it. On a two-stage workflow (high-noise pass, then low-noise), patch before the split rather than after.

Watch the crop. If your source is a very different aspect from the target, the fit path crops to match, and the crop is centred. Give it a source with similar framing and you'll spend less time wondering where somebody's shoulder went.

CategoryMXD/Krea

Inputs (8)

NameTypeDefaultDescription
modelMODEL
image_1IMAGEPrimary reference image, usually the scene or image to edit.
image_2optIMAGEOptional second reference, usually a subject to place into Image 1.
image_1_boostoptFLOAT1.000–1000Attention strength for Image 1. 1.0 = unchanged.
image_1_boost_maskoptMASKOptional mask limiting Image 1 Boost to a region such as a face. White areas are boosted.
image_2_boostoptFLOAT1.000–1000Attention strength for Image 2. 1.0 = unchanged; no effect when Image 2 is disconnected.
image_2_boost_maskoptMASKOptional mask limiting Image 2 Boost to a region such as a face. White areas are boosted; no effect when Image 2 is disconnected.
vaeoptVAERequired. VAE used to encode the reference images.

Outputs (2)

NameTypeDescription
modelMODEL
source_latentLATENT