Krea2Edit Normalized Attention Guidance
Edit a photo with Krea 2, and subtract one concept without nuking the rest
- model
- nag_negative
- source_latent
- source_latent_b
- ref_boost_mask
- vae
- source_image
- source_image_b
- target_latent
- model
This is the image-edit cousin of the pack's text-to-image NAG node, and it answers a specific frustration: you're doing a Krea 2 edit ("change the bird's feathers to blue"), the model keeps leaving the old color in, and the normal negative-prompt fix is dead because Krea 2 runs at CFG 1. Krea2Edit Normalized Attention Guidance fuses the Krea2Edit forward pass with Normalized Attention Guidance so you can say "brown feathers" as a negative during the edit - without destroying the reference identity you're trying to preserve.
Why a combined node
Krea2Edit steers by source-reference attention: the model pays attention to your source image while regenerating a target, and that's what holds identity and pose. The problem is that a naive NAG patch would guide all image tokens, which would smear your reference as much as your output. This node instead runs NAG only on the target-image tokens - the code literally keeps the [text | source references] prefix of the attention output and guides just the noisy tail. Source-reference attention stays on the positive path; the negative only subtracts from what's being edited.
There's a second, practical reason it exists as one node: stacking Krea2EditModelPatch with the T2I NAG node doesn't work. The combined node raises a ValueError if it sees either wrapper already on the model and tells you to connect the base/LoRA model directly.
Inputs that matter
Required: model, nag_negative (the conditioning to suppress - put the concept that keeps sneaking in, e.g. "brown feathers"), and source_latent (your reference image, encoded). The knobs are shared with the T2I node: phi (4.0, how hard to push away), tau (2.5, normalization cap), alpha (0.25, blend back toward the plain positive). The output is one patched model - sampler gets the same model you'd use without NAG.
The optional block is where Krea2Edit's power lives: source_image + vae re-encode the reference at the target's resolution on the fly (with fit_mode "fit" vs the legacy "crop"), source_latent_b / ref_boost_a add a second reference image with its own strength, ref_boost sets overall reference influence (1.0 = neutral), and ref_boost_mask restricts where the reference binds. Beginners: leave all of these alone. Defaults are sensible.
Install
Same pack as the T2I node, but you also need the edit framework it plugs into:
cd ComfyUI/custom_nodes
git clone https://github.com/iljung1106/ComfyUI-Krea2-NAG
git clone https://github.com/lbouaraba/comfyui-krea2edit # v1.2.5 or newer
Restart ComfyUI and load workflows/Krea2Edit NAG - Raw FP8 Turbo.json. Expect the same Krea 2 file set as the T2I workflow: the FP8 raw checkpoint, the Turbo LoRA, the Qwen3-VL encoder (~8GB), and the Qwen-Image VAE. This pack itself has no pip dependencies.
Gotchas
- CFG must be 1.0, hard. If the sampler runs any branch other than the positive one, the node throws at runtime. This isn't optional - CFG > 1 isn't "less optimal," it's an error.
- Don't use
CLIPTextEncodefor the edit or the NAG negative. Krea2Edit was trained with image-grounded (Qwen3-VL) encoding; the README is explicit that stock text encode isn't appropriate for edit instructions. Use Krea2 Edit (grounded encode) for both prompts, wired to the same source image - that's the training path the model expects. - Don't stack a
Krea2EditModelPatchor the T2I NAG node ahead of this one; it errors on purpose, because the combined forward already includes both. - Keep the negative specific. NAG is strong medicine, and a vague negative during an edit can drag the whole composition.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| nag_negative | CONDITIONING | — | |
| source_latent | LATENT | — | |
| phi | FLOAT | 4.00–20 | — |
| tau | FLOAT | 2.500.01–20 | — |
| alpha | FLOAT | 0.250–1 | — |
| sigma_start | FLOAT | 1000.00–1000 | — |
| sigma_end | FLOAT | 0.00–1000 | — |
| source_latent_bopt | LATENT | — | |
| ref_boostopt | FLOAT | 1.000–1000 | — |
| ref_boost_aopt | FLOAT | 1.000–1000 | — |
| fit_modeopt | COMBO | fit | 2 options: fit, crop (legacy) |
| ref_boost_maskopt | MASK | — | |
| vaeopt | VAE | — | |
| source_imageopt | IMAGE | — | |
| source_image_bopt | IMAGE | — | |
| target_latentopt | LATENT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |