# comfyui-krea2edit: instruction-based identity editing for Krea 2 in ComfyUI

> A ComfyUI node pack and LoRA pair that turns Krea 2 Raw or Turbo into an instruction-driven image editor, with two nodes that must both be wired. It solves appearance drift, not general editing.

**lbouaraba/comfyui-krea2edit** — Instruction-based, identity-preserving image editing for Krea 2 in ComfyUI — nodes + workflows for the Krea 2 Identity Edit LoRA

- Repository: https://github.com/lbouaraba/comfyui-krea2edit
- Stars: 665 · Forks: 48
- Language: Python
- License: Apache-2.0
- Published: 2026-09-17 · Updated: 2026-09-17 · Language: en
- Canonical page: https://hysenlabs.com/projects/lbouaraba-comfyui-krea2edit

## The problem: instruction edits that stop looking like the subject

A plain Krea 2 text-to-image pass with an edit prompt will change the picture, but it has no obligation to keep the person, the car, or the object intact. The identity drifts, the face softens into a generic one, and the model re-renders rather than edits. comfyui-krea2edit exists for that gap. The README describes it as the node pack that powers the Krea 2 Identity Edit LoRA, and its stated goal is instruction-based editing with a source image injected twice: once as VAE latent tokens for appearance, and once into the Qwen3-VL text encoder for semantic grounding. The audience is narrow by design. You need Krea 2 (Raw or Turbo) already running in ComfyUI, plus the Qwen3-VL 4B text encoder that Krea 2 uses, plus the LoRA file. This is not a standalone editor and it is not a hosted service. It is a patch layer over a diffusion model you already have.

## Dual conditioning, and why both nodes are required

The mechanism is a two-track injection. Krea2EditModelPatch wraps the diffusion model so the VAE-encoded source image is prepended as clean in-context tokens at RoPE frame 1, with an optional second reference at frame 2. That track carries appearance. Krea2EditGroundedEncode handles the other track: it feeds the same source image into the text encoder alongside your prompt, so the encoder reads the instruction while looking at the image, which the README says matches how the LoRA was trained. The README is blunt about the consequence of skipping the second node: with a stock CLIPTextEncode the model never sees the image semantically and quality drops sharply, especially for scene-referential instructions such as "the man on the left." That is a real architectural constraint rather than a suggestion, and it is the single most common way to get disappointing output from this pack. The pixel path adds a third piece. If you connect vae and source_image, the node fits the raw image to the target grid in pixel space, which the README calls the blur-proof path and which fit_mode: fit requires. target_latent then tells the node the output resolution ahead of time.

## Installing it and wiring a first single-image edit

Installation is a clone into the custom nodes directory followed by a ComfyUI restart. The README states there are no extra Python dependencies, and pyproject.toml lists an empty dependencies array, which is consistent with that claim. You still need the Krea 2 model, the Qwen3-VL 4B text encoder, and krea2_identity_edit_v1_2.safetensors placed where ComfyUI expects them.

```bash
cd ComfyUI/custom_nodes
git clone https://github.com/lbouaraba/comfyui-krea2edit
# restart ComfyUI
```

After the restart, the fastest route is the shipped workflow rather than a blank canvas. The README points at workflows/krea2_identity_edit.json, which is a single-image editor by default; enabling group 2 (toggling its Bypass off) switches it to two-image person-into-scene edits. If you wire it by hand instead, the README's minimal graph is the shape to copy: LoadImage splits into VAEEncode for source_latent and into Krea2EditGroundedEncode.image; the UNETLoader goes through LoraLoaderModelOnly with the LoRA at 1.0 and then into Krea2EditModelPatch.model. The patch feeds KSampler.model, the grounded encode feeds KSampler.positive, and a second grounded encode with an empty prompt and the same image feeds the negative. EmptySD3LatentImage feeds both KSampler.latent_image and Krea2EditModelPatch.target_latent. For a first run, use Turbo at 8 steps and CFG 1, which the README describes as the fast path at roughly a minute for 2MP on most edits. Watch the console. A pre-encode line naming the target resolution means the pixel path ran before sampling; a NOTE line asking you to connect target_latent means it did not.

## The target_latent detail is a VRAM bug, not a nicety

The README devotes a whole section to why target_latent matters, and the reasoning is worth reading rather than skimming. Without it, the node does not know the output resolution until sampling begins, so the VAE encode runs on the first sampling step. At that moment the diffusion model is already resident and mid-run, and vae.encode asks ComfyUI for VRAM. ComfyUI makes room by partially offloading what is loaded, including the sampler, and the README states nothing loads it back because the sampler loads once before its loop. Every remaining step then streams weights from CPU. Wiring target_latent moves the encode to node-execution time and restores the ordinary VAEEncode to KSampler order, where the sampler evicts the VAE instead of the reverse. The encode is cached either way, so the difference is purely timing. The README concedes this only bites setups without VRAM headroom for the model and the VAE at once, and then says to wire it anyway because it is free. That is fair, but it also means the symptom is environment-dependent: on a large card you may never notice the omission, and on a smaller one the same graph runs dramatically slower with no obvious cause.

## Where it breaks: removals, two people, and the 2MP ceiling

Three limits are documented and each one changes what you should attempt. First, removals. The README states that delete-salient-content edits need the Raw model at CFG 3 and around 20 steps, because distilled Turbo at CFG 1 will usually re-render the subject instead of removing it. If your pipeline is built around the fast Turbo path, this is the edit class you cannot do. Second, two distinct people. The README advises placing both references in a single pass, scene or subject A on the main inputs and subject B on the _b inputs, because simultaneous placement is currently more reliable than chaining separate edits. It then says face separation is still imperfect and a focus for future versions. Chaining edits to add people one at a time is the workflow this pack handles worst. Third, resolution. The README says to generate at 2MP or below, and that above the trained range source content can bleed into the output or subjects can duplicate. That is a hard ceiling on the use case, not a tuning preference. There is also a geometry caveat: fit_mode: fit handles mismatched aspect ratios only when vae and source_image are connected, and the crop mode is the v1 and v1.1 legacy geometry that expects matched aspect ratios and older weights. Mixing fit with legacy weights, or crop with v1.2 weights, is out of distribution.

## How it differs from a generic ComfyUI img2img or IPAdapter graph

A conventional img2img graph in ComfyUI works by noising the source latent to a chosen strength and denoising back, so the instruction and the image meet only through the prompt and the initial noise. Identity preservation is a side effect of low denoise, and low denoise also limits how much the image can change. IPAdapter-style conditioning is a different trade: it injects an image embedding into cross-attention to steer style and appearance, but it does not give the text encoder the image, so a phrase like "the man on the left" has nothing to bind to. comfyui-krea2edit takes a third route by training the LoRA against a specific geometry and then reproducing that geometry at inference: appearance tokens at RoPE frame 1, semantic grounding in the text encoder, and a training-matched resample when the aspect ratio differs. The ref_boost dial, default 1.0, is the explicit control over how hard the output is pulled toward the reference, above 1 for stronger fidelity and below 1 to loosen it. That dial exists because identity preservation and edit strength trade against each other, and this pack exposes the trade instead of hiding it behind denoise strength.

## Maintenance, licensing, and what upgrading costs

The repository is not archived, and the last push was on 2026-07-29, which is recent enough that the project is being worked on rather than parked. Two releases landed that same day: v1.2.4 fixed a vertical-outpaint seam, and v1.2.5 pre-encodes the pixel path, which is the target_latent behaviour described above. The README recommends v1.2 over earlier versions for better face likeness plus the fit reference geometry and the ref_boost dial. That recommendation carries a migration cost: fit_mode: fit is the v1.2 default, and the crop mode exists specifically for v1 and v1.1 legacy weights, so an existing graph built around older weights needs either the weights updated or the mode set back to crop. The package is licensed Apache-2.0, declared in pyproject.toml as a file reference to LICENSE and stated in the repository metadata. Apache-2.0 permits commercial use and modification and includes a patent grant, but it also requires that you keep the licence and notice files with redistributed copies. That covers the node pack. It does not automatically cover the Krea 2 model, the Qwen3-VL text encoder, or the LoRA weights, which are separate artifacts with their own terms. Check those separately before shipping anything; this is a description of the licence text, not legal advice. Upgrades are cheap in dependency terms, since pyproject.toml declares no dependencies and requires Python 3.10 or newer, which means the real upgrade cost is re-checking your graph against the changelog rather than resolving packages.

## Conclusion

Adopt comfyui-krea2edit if you already run Krea 2 in ComfyUI and need edits that keep a face or a product looking like itself, and if you can stay at or below 2MP. Do not adopt it for removals on the Turbo model at CFG 1, for placing two distinct people cleanly, or if you have no Krea 2 checkpoint, no Qwen3-VL 4B text encoder, and no krea2_identity_edit_v1_2.safetensors. Before trusting it, run the shipped krea2_identity_edit.json workflow once and read the console line that says whether sources were pre-encoded at the target resolution or whether the node is asking you to connect target_latent.

## FAQ

### How do I use Krea 2 in ComfyUI with comfyui-krea2edit?

Clone the repository into ComfyUI/custom_nodes, restart ComfyUI, and load workflows/krea2_identity_edit.json. Both Krea2EditModelPatch and Krea2EditGroundedEncode must be wired, because the README states that with a stock CLIPTextEncode the model never sees the image semantically and quality drops sharply.

### Can Krea 2 edit images?

Yes, with this node pack and the Krea 2 Identity Edit LoRA. The README describes Krea 2 Raw or Turbo becoming an image editor through dual conditioning, with the source image injected as VAE latent tokens and into the Qwen3-VL text encoder.

### What are the differences between Krea 2 RAW and Krea 2 Turbo in comfyui-krea2edit?

The README treats Turbo at 8 steps and CFG 1 as the fast path for most edits, roughly a minute at 2MP. Removals and other delete-salient-content edits need the Raw model at CFG 3 and around 20 steps, because distilled Turbo at CFG 1 usually re-renders the subject instead of removing it.

### Which ComfyUI tool is the best for image editing?

That depends on the edit. comfyui-krea2edit is built for instruction edits that must preserve identity, and the README lists its own boundaries: removals need the Raw model at CFG 3, two distinct people are still imperfectly separated, and output above 2MP can bleed or duplicate subjects.

## Sources

- [Issues](https://github.com/lbouaraba/comfyui-krea2edit/issues)
- [lbouaraba/comfyui-krea2edit on GitHub](https://github.com/lbouaraba/comfyui-krea2edit)
- [License: Apache-2.0](https://github.com/lbouaraba/comfyui-krea2edit/blob/main/LICENSE)
- [README](https://github.com/lbouaraba/comfyui-krea2edit/blob/main/README.md)
- [Releases](https://github.com/lbouaraba/comfyui-krea2edit/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/lbouaraba-comfyui-krea2edit
