Skip to content
Node packVerifiedExternal
Open source

comfyui-krea2edit

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

Maintainer@lbouarabaBgrade

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 edited
  • source_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 for fit_mode: fit.
  • target_latent (optional, recommended whenever you use the pixel path) — wire the same latent you feed KSampler.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 (default fit) — 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_a is 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 with type: krea2)
  • prompt — the edit instruction ("recolor the car to matte black")
  • image — the same source image
  • image_b (optional) — second reference for two-input edits
  • grounding_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
  • Krea2EditGroundedEncode
  • Krea2EditModelPatch

Related resources

15 connections
Used byKrea2 ID Edit Character Dataset Creator w/ tagger & optional RTX50xx attention fix — v3.0.1 2nd ref & UpgradesUsed byKrea2 Identity Instant Pose & Outfit Generator (No LLM Required) — v1.0Used byKrea2 ID Edit Character Dataset Creator w/ tagger & optional RTX50xx attention fix — v3.0.1 2nd ref & Upgrades — V4.001 🎨Post ProcessingUsed byKrea2 ID Edit Character Dataset Creator w/ tagger & optional RTX50xx attention fix — v3.0.1 2nd ref & Upgrades — V7.1.1 TweaksUsed byKrea2 ID Edit Character Dataset Creator w/ tagger & optional RTX50xx attention fix — v3.0.1 2nd ref & Upgrades — V9.1 Vision Assistant 🔬Used by|Fadoo] Edit Krea2 + Lora loader + Identity EditUsed byKrea2 ID Edit Character Dataset Creator w/ tagger & optional RTX50xx attention fix — V2.0.1 upgradesUsed byKrea 2 Identıty & Qwen3 vl Easy Workflow — v1.0Used byKrea2 ID Edit Character Dataset Creator w/ tagger & optional RTX50xx attention fix — v3.0.1 2nd ref & Upgrades — V8.0 Remove BackgroundUsed byKrea2 ID Edit Character Dataset Creator w/ tagger & optional RTX50xx attention fix — v1.0.1Used byKrea 2 QuadView Simple Workflow for Low VRAMUsed byKrea2 ID Edit Character Dataset Creator w/ tagger & optional RTX50xx attention fix — v3.0.1 2nd ref & Upgrades — v 9.0 Speed Boost 🚀Used byKrea2 ID Edit Character Dataset Creator w/ tagger & optional RTX50xx attention fix — v3.0.1 2nd ref & Upgrades — V4.1 Filename # fixUsed byKrea2 ID Edit Character Dataset Creator w/ tagger & optional RTX50xx attention fix — v3.0.1 2nd ref & Upgrades — V8.1 filename bug fixUsed byLonecat's Krea2 Identity Edit (w/ optional RTX50xx attention fix) — v1.0

Sources

3 sources
GitHubSourceVersion 86f886dac23013d88996e3a2e99093ba44d322fb
github.com/lbouaraba/comfyui-krea2edit

Verified Oct 11

GitHubSource
github.com/lbouaraba/comfyui-krea2edit

Verified Oct 13

Source excerpts

1 excerpt

Source context: Repo lbouaraba/comfyui-krea2edit