lbouaraba/comfyui-krea2edit
Instruction-based, identity-preserving image editing for Krea 2 in ComfyUI — nodes + workflows for the Krea 2 Identity Edit LoRA
What it solves
This project enables instruction-based image editing for the Krea 2 model within ComfyUI. It allows users to modify images using text prompts (e.g., "recolor the car to matte black") while maintaining the identity and appearance of the original subject, solving the problem of losing likeness or semantic grounding when using standard text encoders.
How it works
The system uses a dual-conditioning approach to ensure the model understands both what the image looks like and what the prompt is asking for:
- Appearance Injection: The source image is injected as VAE latent tokens into the diffusion model to preserve visual identity.
- Semantic Grounding: The source image is also fed into the Qwen3-VL text encoder, allowing the model to "see" the image while processing the text instruction.
It provides two primary nodes: Krea2EditModelPatch for handling the image latents and geometry (including aspect ratio fitting), and Krea2EditGroundedEncode for the image-grounded text encoding.
Who it’s for
It is designed for ComfyUI users who want to perform high-fidelity image edits, such as recoloring, adding/inserting objects, attribute changes, or character restaging, while keeping the original subject's identity intact.
Highlights
- Dual Conditioning: Combines latent tokens and grounded text encoding for superior identity preservation.
- Flexible Reference Geometry: Supports fitting source images to different output aspect ratios to prevent distortion.
- Multi-Reference Support: Ability to use two reference images (e.g., a person and a scene) for complex edits.
- VRAM Optimization: Includes a specific "pixel path" and
target_latentwiring to prevent performance drops caused by VAE offloading during sampling.
Related
- Project
- Dispatch
- Project
- Project
- Dispatch