CHANGELOG:
v2.0 Rebuild — LanPaint Context Sampling
Added LanPaint KSampler with context-aware “thinking” iterations.
Replaced the empty latent with:
VAEEncode → SetLatentNoiseMask → LanPaint KSampler.Improved continuity with textures, lighting, perspective and nearby geometry.
Increased Crop & Stitch context factor from
1.5to2.0.Kept Krea2 Identity Edit v1.2 grounded image conditioning.
Kept identity fidelity controls and optional second-reference mode.
Preserves the original image dimensions.
Pixels outside the stitched mask remain unchanged.
Removed the need for a separate LanPaint blend node to avoid double blending.
Added workflow notes explaining LanPaint settings and A/B testing.
Krea2 Inpaint&Edit v2.0 is a complete rebuild focused on improving contextual inpainting.
The previous version used Krea2 Identity Edit to regenerate a cropped area before stitching it back into the original image. While this worked well for many local edits, difficult masks could sometimes lose nearby texture, perspective, lighting or structural context.
This version adds LanPaint as the sampling system.
Instead of beginning from an empty latent, the workflow now VAE-encodes the original crop, applies the cropped mask as a latent noise mask, and lets LanPaint condition the generated area using the surrounding known pixels.
The resulting pipeline is:
Mask → Crop with context → Krea2 Identity Edit → LanPaint sampling → Stitch back
This is particularly useful for:
Continuing textures or line art through a mask.
Reconstructing walls, fabric or backgrounds.
Replacing objects while respecting nearby perspective.
Maintaining surrounding shadows and lighting.
Editing connected clothing, hair or geometry.
The workflow still uses Crop & Stitch, so the edited region is returned to its original location and canvas size. Areas outside the final blend remain part of the untouched source image.
LanPaint officially supports Krea2 and works similarly to a regular ComfyUI sampler, but its extra thinking iterations require more processing time.
Required custom nodes
LanPaint (https://github.com/scraed/LanPaint)
comfyui-krea2edit (https://github.com/lbouaraba/comfyui-krea2edit)
ComfyUI-Inpaint-CropAndStitch (https://github.com/lquesada/ComfyUI-Inpaint-CropAndStitch)
rgthree-comfy — only for the comparison viewer (https://github.com/rgthree/rgthree-comfy)
Optional
ComfyUI-TrixLoader (https://github.com/trx7111/ComfyUI-TrixLoader)
Recommended only for its enhanced mask editor. The workflow itself still uses ComfyUI’s native LoadImage node.
Performance note: LanPaint is slower than the original standard-sampler version because it performs additional conditional sampling iterations. Keep v1.0 available as a lighter legacy option for simple recolors and quick edits.
Hey everyone, I've been messing around with Krea2 and the community Identity Edit LoRA so this is my first workflow that I'm sharing publicly. I'm still pretty new to ComfyUI, so it’s probably not the most optimized or the "best" way to do this. But it worked well for me, so I figured I'd upload it in case it helps someone else.
Basically, this uses a manual inpainting approach. You have to load your image, open the mask editor, and draw the mask yourself over the exact area you want to change. The workflow then forces Krea 2 to only generate inside that mask, leaving the rest of the original image completely untouched at the pixel level.
I threw in a few extra things to make it easier to use:
A node to automatically detect the size of your input image, so you don't have to manually type in the width and height.
A mask expanding node so you can feather the edges a bit. If the model keeps making the object bigger when you just want to change its color, I recommend lowering the "expand" number or even using a negative number.
rgthree's Power Lora Loader so you can stack the Identity Edit LoRA with more LoRAs.
An image comparer node so you can slide back and forth between the original and the edit.
A quick tip: when prompting, using words like "recolor" instead of "change" helps prevent the model from redrawing the shape and making it larger than it should be.
Feel free to tweak it, break it, or let me know what I could have done better. Still learning :p
Description
FAQ
Comments (3)
Hi.
Thanks for the workflow. It basically works for me.
But I got the problem that the inpainted area uses the colors of the reference. So my result looks more like a bad photoshop than an actual inpaint. Am I doing it wrong or is this something that does not work without extra nodes for color matching?
Hi! You are probably not doing anything wrong. The default workflow settings prioritize reference fidelity quite strongly, which can sometimes transfer too much of the reference image’s color palette.
-Try reducing "ref_boost" from 4.0 to 1.0-2.0.
-Change LanPaint prompt mode from Image first to Prompt first.
-Make explicit instructions like "Insert the referenced object, but match the target scene’s lighting, white balance, contrast, saturation and surrounding colors. Do not copy the reference image’s color grading.". It depends on what you are trying to do.
Hope that helps!
@lvperka Thanks alot. On a first quick try I can already tell it is much better now. Will need to try and find the perfect values.
