comfyui-krea2edit
Instruction-based, identity-preserving image editing for Krea 2 in ComfyUI — nodes + workflows for the Krea 2 Identity Edit LoRA
Package profile
- Status
- Verified
- Publisher
- @lbouaraba
- Source
- GitHub
- Stars
- 698
README
ComfyUI-Krea2Edit
Instruction-based image editing for Krea 2 in ComfyUI — the node pack that powers the Krea 2 Identity Edit LoRA. Turns Krea 2 (Raw or Turbo) into an image editor with dual conditioning: the source image is injected both as VAE latent tokens (appearance) and into the Qwen3-VL text encoder (semantic grounding), matching how the LoRA was trained.
☕ Support on Ko-fi — all tips go straight to GPU compute for future versions.
🧰 Training code is public: krea2edit-trainer — the ai-toolkit extension these LoRAs were trained with, geometry-matched to the nodes, with measured consumer-GPU VRAM requirements.
Model versions
See CHANGELOG.md — v1.2 is recommended (better face likeness,
plus the new fit reference geometry and ref_boost fidelity dial).
Installation
cd ComfyUI/custom_nodes
git clone https://github.com/lbouaraba/comfyui-krea2edit
# restart ComfyUI
Requirements: a ComfyUI version with native Krea 2 support, the Krea 2 model
(Raw or Turbo), the Qwen3-VL 4B text encoder used by Krea 2, and the Krea 2 Identity Edit
LoRA (krea2_identity_edit_v1_2.safetensors). No extra Python dependencies.
Nodes
Krea2EditModelPatch
Wraps the diffusion model so the VAE-encoded source image is prepended as clean in-context tokens (RoPE frame 1). Inputs:
model— Krea 2 (LoRA already applied)source_latent— VAEEncode of the image being editedsource_latent_b(optional) — second reference (RoPE frame 2) for two-input edits (e.g. person + scene)vae+source_image(optional, recommended) — the blur-proof pixel path: give the raw image (and VAE) and the node fits it to the target grid in pixel space. Required forfit_mode: fit.target_latent(optional, recommended whenever you use the pixel path) — wire the same latent you feedKSampler.latent_image. It only tells the node the output resolution ahead of time, so the source can be VAE-encoded here instead of on the first sampling step. Skipping it can cost real speed — see Pixel path and VRAM.fit_mode(defaultfit) — how a source fits a mismatched output aspect ratio.fit= training-matched resample at a centered offset (v1.2);crop= center-crop, the v1/v1.1-legacy geometry (use with older weights).ref_boost(default 1.0) — reference-fidelity dial; >1 pulls harder toward the reference's appearance, <1 loosens.ref_boost_ais the same dial for the scene ref in two-ref edits.
Krea2EditGroundedEncode
Image-grounded instruction encoding — the text encoder sees the image while reading your instruction, exactly as during training. Inputs:
clip— the Krea 2 CLIP (Qwen3-VL, loaded withtype: krea2)prompt— the edit instruction ("recolor the car to matte black")image— the same source imageimage_b(optional) — second reference for two-input editsgrounding_px— grounding resolution (default 768; v1.2 trained range 384–768, and 1024+ often still works nicely). This is a quality dial: lower = stronger edit adherence, higher = stronger identity/likeness. Try 1024 for people, 512 for stubborn scene changes. (v1's trained range was 512–1536.)
Both nodes are required. With a stock CLIPTextEncode the model never sees the
image semantically and quality drops sharply, especially for scene-referential
instructions ("the man on the left").
Minimal wiring
LoadImage ─┬─ VAEEncode ── Krea2EditModelPatch.source_latent
└─ Krea2EditGroundedEncode.image (+ your prompt)
UNETLoader ── LoraLoaderModelOnly (krea2_identity_edit_v1_2 @1.0) ── Krea2EditModelPatch.model
Krea2EditModelPatch ── KSampler.model
Krea2EditGroundedEncode ── KSampler.positive
Krea2EditGroundedEncode (empty prompt, same image) ── KSampler.negative
EmptySD3LatentImage ─┬─ KSampler.latent_image
└─
Nodes in this pack
2 nodes
Nodes in this pack
2 nodes- Krea2EditGroundedEncode
- Krea2EditModelPatch
Related resources
15 connections
Related resources
15 connectionsSources
3 sources
Sources
3 sourcesVerified Oct 11
Verified Oct 11
Source excerpts
1 excerpt
Source excerpts
1 excerptSource context: Repo lbouaraba/comfyui-krea2edit
