A SwarmUI extension with a small toolbox of Krea 2 tricks. Everything is gated on the selected
model being detected as Krea 2 (krea-2 / krea-2/lora) and does nothing otherwise.
Three features, each backed by a third-party ComfyUI node pack and each living in its own nested sub-group under the Krea Gone Wild parameter group. Each sub-group's toggle is the feature's on/off switch — there is no separate enable param. Install buttons appear inside the sub-group of whichever node pack is missing.
Applies ComfyUI-ConditioningKrea2Rebalance to both the positive and negative Krea 2 conditioning (and the refiner pass, if present).
- Toggle the KGW Rebalance group on to enable it.
- KGW Multiplier — overall conditioning multiplier.
- KGW per_layer_weights — comma-separated weights for the 12 Krea 2 conditioning layers.
Runs ComfyUI-Krea2-Ostris-Edit edit LoRAs
(ai-toolkit krea2 arch, model_kwargs.edit: true) — "Kontext-style" reference-image editing.
It wires the edit natively into SwarmUI rather than replacing SwarmUI's conditioning:
- Your prompt image(s) are scaled to ~1 MP (÷16 snapped, matching the training preprocessing) and
VAE-encoded, then attached as reference latents onto the positive and negative conditioning via
the core
ReferenceLatentnode. - The model is wrapped in
Krea2OstrisEditModelPatchso the Krea 2 DiT actually consumes those reference latents (index_timestep_zero).
Because SwarmUI's own SwarmClipTextEncodeAdvanced still builds the conditioning, all the advanced
prompt syntax (<break>, weighting, [from:to:when], regions, …) keeps working on edits. Only the
model patch comes from the ostris pack; the reference latents use core ComfyUI nodes — exactly the
"chain conditioning from … Set Reference Latent nodes" path the pack documents.
- Toggle the KGW Ostris Edit group on to enable it. Requires a Krea 2 edit LoRA loaded and at least one prompt image. With no prompt image it is a no-op (the model patch passes through unchanged).
- KGW Edit Reference Megapixels — target size the reference is scaled to before VAE-encoding (default 1.0, matching ai-toolkit).
Note: the reference latents are attached to the main generation pass only; a separate refiner pass is not edit-patched.
Runs comfyui-krea2edit — instruction-based editing
with the krea2_edit identity LoRA. Different approach from the ostris pack: instead of reference
latents on the conditioning, the source is prepended to the sampling sequence as a block of clean
in-context tokens (RoPE frame=1), with the instruction encoded through Qwen3-VL alongside the image in
the exact layout the LoRA trained on.
Two halves to the recipe. Only the model patch comes from the pack:
- Grounding. SwarmUI already routes Krea 2 through
SwarmClipTextEncodeAdvancedwith the prompt images wired and its stock"krea2"template, which appends the vision blocks after the instruction with aPicture N:label. krea2_edit trained with them before the instruction and unlabelled. That node passes any non-magicllama_templatestring straight through toclip.tokenizeand leaves the prompt text alone, so this extension just retemplates the existing positive and negative encoders in place. Result: the pack's grounded encode, with<break>,[from:to:when],[alter|nate], weighting and per-step scheduling all still working — none of which the pack's ownKrea2EditGroundedEncodenode supports. - In-context source.
Krea2EditModelPatchwraps the model. It gets the raw prompt image(s) plus the VAE on the pixel path (immune to input/output resolution mismatches), the VAE-encoded source as the requiredsource_latent, and the sampler's own latent astarget_latentso the source encode happens before sampling instead of evicting the diffusion model mid-run.
Up to two prompt images feed the model patch: the first is the scene (ref_boost_a), the second the
subject (ref_boost) — the training-matched order for the multi-reference LoRAs. Grounding sees every
prompt image SwarmUI batched, one vision block each.
- Toggle the KGW Krea2Edit group on to enable it. Needs the
krea2_editLoRA and at least one prompt image; with no prompt image it is a no-op. - KGW Krea2Edit Ref Boost — reference-fidelity dial on the last reference. 1.0 = off, above 1 pulls harder toward the reference's appearance. Optimal value is model-specific.
- KGW Krea2Edit Ref Boost A (advanced) — same dial for the first reference (the scene). No effect with a single prompt image.
- KGW Krea2Edit Fit Mode (advanced) —
fit(training-matched, default) orcrop (legacy)for older weights. - KGW Krea2Edit Grounded Encode — on by default. Turn it off to keep SwarmUI's stock
"krea2"template (still grounded, just with the training-mismatched vision-block placement). - KGW Krea2Edit Grounding Pixels — caps the longest side of the images fed to the vision tower,
via a core
ImageScaleToMaxDimensionnode. 0 = leave SwarmUI's own prompt-image sizing alone. The LoRA trained with 384–768px jitter, so 640–768 is in-distribution. - KGW Krea2Edit System Prompt (advanced) — replaces the system turn of the grounding template. Empty = krea2_edit's training default.
Note: the pack's own guidance — Turbo at 8 steps / CFG 1 for most edits, Raw at CFG 3 / 20 steps for removals, generate at ≤2 MP.
- Install the required ComfyUI node(s) using the button in the matching sub-group, then restart the ComfyUI backend when prompted.
- Select a Krea 2 model.
- Toggle on the sub-group(s) you want (and, for either editing mode, add a prompt image + the matching edit LoRA).
The features are independent toggles. The two editing modes are alternative approaches to the same job — enable one, not both.