Krea2 Identity Edit (source patch) ⚡
The node that sneaks your photo into the diffusion model's frame 1
- model
- source_latent
- source_latent_b
- ref_boost_mask
- vae
- source_image
- source_image_b
- target_latent
- MODEL
Here's the thing about the Krea 2 Identity Edit LoRA: Krea 2's native forward pass only ever builds [text | target]. There is no built-in way to prepend a clean copy of your source photo. The LoRA, though, was trained on [text | source | target] - the source sitting there as an extra image frame the model cross-attends to while it generates the edit. This node is the wrapper that rebuilds that sequence at runtime.
It's the appearance half of the identity-edit pair. Its partner, Krea2 Identity Edit (grounded encode), feeds the same photo into Qwen3-VL alongside your prompt for the semantic half ("the man on the left"). Together they reproduce the training recipe; separately they underperform. This node takes model + a latent of your photo and wraps the diffusion model's forward so the source gets prepended as clean in-context tokens at RoPE frame 1 - the exact [text | source(frame=1) | target(frame=0)] layout from training (ai-toolkit's predict_velocity_edit). It's implemented through ComfyUI's real ModelPatcher extension point, not a from-scratch sampler, so CFG and the sampler stay fully intact.
The inputs that matter
modelandsource_latent- required. The latent comes from a stockVAEEncodeof your photo. Minimal graph:LoadImage→VAEEncode→ here.vae+source_image- the recommended upgrade. This is the blur-proof pixel-space path: the node fits the raw image to the target grid in pixel space instead of resizing an already-VAE-encoded latent, which is what causes the classic fuzzy-reference look when your photo's aspect ratio doesn't match the output.fit_mode="fit"(default) is the training-matched geometry;crop (legacy)is for v1/v1.1 weights.target_latent- recommended whenever you use the pixel path. Wire in the same latent that feedsKSampler.latent_image. Without it, the node VAE-encodes the source on the first sampling step, which can yank the VAE onto the GPU mid-sampling and evict part of the diffusion model on VRAM-tight setups - the rest of the run silently streams from CPU. The console tells you which path you got.ref_boost/ref_boost_a- reference-fidelity dials (1.0 = off). Higher pulls harder toward the reference's appearance; the optimum is model-specific. In two-ref workflows,ref_boostis the subject andref_boost_athe scene.source_latent_b/source_image_b- a second reference at RoPE frame 2 for two-input edits (person + scene).ref_boost_mask- optionally boost just a region, e.g. the face.
Output is a MODEL, which flows into your KSampler (with the source-patch applied to model and the grounded-encode CONDITIONINGs feeding positive/negative).
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/ChrisColeTech/ComfyUI-GGUF-Loader
pip install --upgrade gguf
Restart, then download the Identity Edit LoRA separately - krea2_identity_edit_v1_2.safetensors from conradlocke/krea2-identity-edit - along with the Krea2 model, Qwen3-VL-4B encoder, and VAE. Nodes live under 🤖 CCTech/Krea2.
Gotchas
Wire target_latent or live with the slowdown. Match input/output aspect ratios - mismatched ones are the #1 cause of that "bad photoshop job" look. And the LoRA must actually be loaded upstream (stock LoraLoaderModelOnly at ~1.0); with no LoRA, the extra context tokens are inert, so nothing breaks but nothing changes either.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| source_latent | LATENT | — | |
| source_latent_bopt | LATENT | 2nd reference (subject photo) for multi-ref LoRAs -> RoPE frame=2, training-matched order: scene first, subject second. | |
| ref_boostopt | FLOAT | 1.000–1000 | Reference-fidelity dial: multiplies target->reference attention. Applies to the LAST ref (= the subject in two-ref workflows, the only ref in single-ref). 1.0 = off, >1 pulls harder toward the reference's appearance, <1 loosens. Optimal value is model-specific. |
| ref_boost_aopt | FLOAT | 1.000–1000 | Same dial for the FIRST ref (= the scene in two-ref workflows). No effect in single-ref workflows. 1.0 = off. |
| fit_modeopt | COMBO | fit | How a source fits a mismatched output aspect ratio (needs vae + source_image connected): fit = resample the source to the target grid at a centered offset - matches how this model was trained (default, use this). crop (legacy) = center-crop to the target AR then resize (v1/v1.1 geometry, only for older weights). |
| ref_boost_maskopt | MASK | Optional region on the (last) reference to boost, e.g. the face; empty = whole reference. | |
| vaeopt | VAE | RECOMMENDED with source_image: enables the blur-proof pixel-space path (crop+resize in pixels, encode internally) - immune to input/output resolution mismatches. | |
| source_imageopt | IMAGE | Source as IMAGE (with vae connected): overrides source_latent with exact pixel-space fitting - fixes blurry results from mismatched resolutions. | |
| source_image_bopt | IMAGE | 2nd reference as IMAGE (with vae). | |
| target_latentopt | LATENT | RECOMMENDED with vae + source_image: wire the SAME latent you feed KSampler.latent_image. Lets the node VAE-encode the source here, before sampling starts, instead of on the first step - otherwise the VAE is pulled onto the GPU mid-sampling and can evict part of the diffusion model, slowing every remaining step on VRAM-tight setups. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |