Eric Krea2 Edit
Recolor, restyle and re-pose Krea 2 images with a sentence
- source_image
- source_image_b
- ref_boost_mask
- edit
- grounding_preview
Instruction editing is where most of what used to be inpainting went - that's the honest reading of the last eighteen months, and Krea 2 was built for it. Eric Krea2 Edit is the node that wires that capability into the pack: source image plus a sentence, and the model returns the edited image.
Use it for recolor ("make the car matte black"), restyle, re-pose, add or replace or remove objects, try-on, and dropping a person into a scene. Don't use it when unmasked pixels must survive unchanged - an instruction model rewrites the whole frame, and that's the one thing masked inpainting still owns.
How it works
This node implements the Krea 2 Identity Edit recipe, which needs the matching LoRA: conradlocke/krea2-identity-edit v1.2 (full, or the near-identical r128/r64 files), loaded on the pack's Multi-LoRA Stack at S1 = 1.0, S2 = 0, S3 = 0. The node itself is a bundle builder; the runtime goes in and out around one generation on the Ultra node.
Two conditioning paths run, exactly as the LoRA was trained. Appearance puts the clean VAE-encoded source into the sequence as [text | source (frame 1) | source_b (frame 2) | target (frame 0)] with a shared timestep - that's pixel-level identity. Semantics encodes your instruction through Qwen3-VL together with the source images, so the instruction is grounded in the picture rather than floating next to it. Grounded encoding is natural length, no 512-token cap - which matters, because two 768-pixel references alone would blow the text budget.
The inputs that matter
source_image (the scene, RoPE frame 1) and instruction. Then:
source_image_b- the subject, frame 2. For person-into-scene, put both people in one pass rather than chaining edits; chaining compounds drift and re-renders faces.ref_boost- the fidelity dial on the last reference (the subject in two-ref edits, else the source). 1 = off, ~4 is what the model card calls strong likeness, above ~10 it starts breaking removals, below 1 it loosens.ref_boost_ais the same dial for the first reference (the scene) and does nothing with a single reference.ref_boost_maskrestricts the boost to a region of the last reference - a face, usually.grounding_px- the longest side Qwen3-VL sees, default 768, trained 384–768. Lower it for stronger instruction adherence, raise it for stronger likeness. Lower it if subjects duplicate.fit_mode-fitis the v1.2 training geometry (aspect-preserving resample onto the target grid at a centred offset, any output aspect).crop (legacy)is for v1/v1.1 weights only.size_from-sourcetakes the source aspect at the Ultra node's S1 megapixels;ultra settingslets Ultra decide and letsfithandle the mismatch, which is what you want for wide outpaints.ground_negative- with CFG on, the negative becomes the empty instruction grounded on the same images, which is the trained unconditional. Leave it on.vision_processor_source- points at the folder holding the Qwen3-VL image-processor config, and its default is a hardcoded path on the author's own machine (H:\Testing\Qwen3-VL-4B-Instruct-heretic-7refusal). Set this on your first run. Nothing warns you nicely if it's wrong.
Outputs: edit into Ultra's edit socket, and grounding_preview - the images the VLM actually saw at grounding_px. That preview is the fastest way to diagnose "the instruction wasn't followed": if the subject is a smudge in there, it was never going to work.
The recipe that works
Turbo, 8–12 steps, guidance off. Stage 1 at 2 MP or less - above ~2.2 MP sources bleed and subjects duplicate, and the node warns you; let S2/S3 do the upscaling. S2/S3 run stock (no sources) and refine using Ultra's own prompt text, so describe the edited image there, or leave it empty to reuse the grounded instruction.
Removals are the known weak spot. The model card's route is Raw, ~20 steps, CFG 3 (s1_cfg 2.0 in Krea's g convention, where CFG = 1 + g), ground_negative on - and in the pack author's own testing even that removed both people for "remove the person in the background". Word removals as what to keep, not what to delete. For outpaint, prefer the ODE samplers (euler, res, deis); SDE churn breaks the reference-copy channel.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Krea2_ComfyUI_Advanced
Then the pack's one real dependency - a diffusers build containing Krea2Pipeline, which landed after the version string was frozen:
python_embeded\python.exe -m pip install --upgrade --force-reinstall --no-deps git+https://github.com/huggingface/diffusers.git
Plus transformers>=4.57.0, Krea 2 weights in diffusers layout, and the Identity Edit LoRA where the Multi-LoRA Stack can see it.
Where it goes wrong
Combination rules. Edit works with control and with guidance. It does not combine with style, paint or ref_latents - those combinations raise a clear error. If a Vision Prompt prompt_conditioning is also connected, the edit's grounded conditioning wins (and it prints that). crop_bottom is forced to 0 for edit runs, since a guard band would shift how the source is registered.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| source_image | IMAGE | Image to edit (the scene / main reference, RoPE frame 1). | |
| instruction | STRING | Edit instruction, e.g. 'recolor the car to matte black'. NegPiP (phrase:-1) works here when the Negative Guidance node has NegPiP on. | |
| source_image_bopt | IMAGE | Second reference (the subject, RoPE frame 2) for person-into-scene edits. Place two people in ONE pass rather than chaining. | |
| fit_modeopt | COMBO | fit | fit = v1.2 training geometry (resample to the target grid at a centered offset; any aspect ratio). crop (legacy) = center-crop to the output aspect - only for v1/v1.1 weights. |
| ref_boostopt | FLOAT | 1.000–100 | Reference-fidelity dial on the LAST reference (the subject in two-ref edits, else the source): multiplies target->reference attention. 1 = off, ~4 strong likeness (model card), >10 breaks removals, <1 loosens. |
| ref_boost_aopt | FLOAT | 1.000–100 | Same dial for the FIRST reference (the scene) in two-ref edits. No effect with one reference. |
| ref_boost_maskopt | MASK | Optional region of the LAST reference to boost (e.g. the face), in that image's pixels. | |
| grounding_pxopt | INT | 7680–2048 | Longest side of the image(s) Qwen3-VL sees. Trained 384-768. Lower = stronger instruction adherence, higher = stronger likeness. Lower it if subjects duplicate. 0 = native size. |
| size_fromopt | COMBO | source | source: Stage 1 takes the source aspect at Ultra's s1_megapixels (width/height on Ultra still win if set). ultra settings: Ultra's aspect_ratio decides; the fit geometry handles the mismatch. |
| ground_negativeopt | BOOLEAN | true | With guidance (CFG) on: the negative is the EMPTY instruction grounded on the same image(s) - the trained unconditional. Off = Ultra's negative_prompt as plain text. |
| system_promptopt | STRING | Advanced: override the grounding system prompt (empty = Krea 2 / training default). | |
| vision_processor_sourceopt | STRING | H:\Testing\Qwen3-VL-4B-Instruct-heretic-7refusal | Folder with the Qwen3-VL image-processor config (same as the Vision Prompt node). |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| edit | KREA2_EDIT | — |
| grounding_preview | IMAGE | — |