Wraps lbouaraba/comfyui-krea2edit (the Krea 2 Identity Edit node pack) as a native SwarmUI Generate-tab feature, instead of only being usable through the raw Comfy Workflow tab.
- Registers the
comfyui-krea2editnode pack as an installable feature, so SwarmUI auto-installs/updates it into your ComfyUIcustom_nodesfolder the same way it does for any other node-pack-backed feature. You still need to grab the model files yourself (Krea 2 Turbo/Raw, the Qwen3-VL 4Bkrea2text encoder,qwen_image_vae, and thekrea2_identity_edit_v1_2.safetensorsLoRA) — apply the LoRA through SwarmUI's normal LoRA picker, same as any other LoRA. - Adds a "Krea 2 Identity Edit" parameter group (Advanced Options tab, ComfyUI backend only)
with:
- Grounding Resolution — the
grounding_pxdial (default 768). - Fit Mode —
fit(default, resamples the source to the output grid) orcrop(legacy, for pre-v1.2 weights). - Ref Boost / Ref Boost (Second Reference) — the
ref_boost/ref_boost_afidelity dials (default 1.0 = neutral; the node pack's own preset workflow uses 4.0 for stronger likeness; keep it under ~10 or removals/replacements start failing). - Enabling the group is what triggers the feature — there's no separate on/off switch.
- Grounding Resolution — the
- Your normal Prompt box becomes the edit instruction ("recolor the car to matte black", "place this person at the cafe table"). Your Prompt Images (reference-image slot -- NOT Init Image) become the image(s) being worked with: the first is the image being edited, an optional second is the second reference for two-input person-into-scene edits.
- At generation time, it VAE-encodes the source (and optional second reference), patches your
selected/LoRA'd model with
Krea2EditModelPatch, and swaps the stock CLIPTextEncode nodes forKrea2EditGroundedEncodeon both positive and negative conditioning.
- Install the model files per the node pack's README —
Krea 2 (Turbo or Raw), the Qwen3-VL 4B
krea2text encoder,qwen_image_vae, andkrea2_identity_edit_v1_2.safetensors. The node pack itself gets auto-installed by this extension the first time your ComfyUI backend starts with it enabled — no manualgit cloneintocustom_nodesneeded. - Drop this folder into
SwarmUI/src/Extensions/Krea2Edit/(keep the folder name — extensions are identified by their folder). - Rebuild: run SwarmUI's
updatescript (or alaunch-devscript if you're iterating), then start SwarmUI as usual. - In the Generate tab, turn on Display Advanced Options, find Krea 2 Identity Edit, and toggle it on.
- Pick a Krea 2 checkpoint, add the
krea2_identity_edit_v1_2LoRA via the normal LoRA picker, load your source image via the Prompt Images / reference-image slot (not Init Image), and write your edit instruction as the Prompt.
This was written against the current master WorkflowGenerator.cs (confirmed: CreateNode,
WorkflowGenerator.NodePath, UserInput.TryGet/Get, BasicInputImage, CurrentModel/
CurrentTextEnc/CurrentVae as WGNodeData with .Path, FinalPrompt/FinalNegativePrompt as
plain settable JArray fields, and the T2IParamTypes.PromptImages + GetPromptImage(...) combo
used by the built-in Kontext/OmniGen/Qwen-Image edit paths). A few spots are best-effort and worth
double-checking, since this codebase has a lot of recently-[Obsolete]'d fields (a sign the
workflow-gen internals are actively being refactored):
- Step priority (
7) — I don't have visibility into the exact priority values core uses for CLIPTextEncode creation, LoRA application, or KSampler creation in your specific build. If you get a "node not found" referencing"6"/"7"(the default prompt/negative-prompt node IDs) or the model chain, the step is running too early — try6.5or lower. If the identity-edit LoRA doesn't seem to land on the patched model, it's running too late relative to LoRA loading — try7.5+. - Node schema for
Krea2EditModelPatch/Krea2EditGroundedEncodewas originally guessed from the README prose and got it wrong (a nonexistenttarget_latentinput was being sent, which likely errored the node outright). It's now been corrected against an actual exported workflow JSON from the node pack — confirmed inputs:model,source_latent,source_latent_b(opt),ref_boost_mask(opt, not wired by this extension),vae/source_image/source_image_b(opt, fit-mode pixel path), and widgetsfit_mode/ref_boost/ref_boost_a. GetPromptImage(true, false, 0)for the optional second reference — confirmed as a real call pattern in core (used for Kontext/OmniGen/Qwen-Image multi-image edits), but I couldn't verify the exact meaning of the second boolean argument. If the second reference comes out scaled unexpectedly, checkGetPromptImage's definition in yourWorkflowGenerator.cs.Krea2EditFitModeas free text rather than a real dropdown — I didn't want to guess at the exactT2IParamTypefield name your version uses for enum/dropdown values (e.g.Valuesvs.GetValues). If you want a proper dropdown, checkT2IParamTypes.csfor how other string dropdowns (like sampler name) register their choices and mirror that inOnInit().
None of these are "this definitely won't compile" concerns — the extension should build and the core wiring (model patch + grounded encode swap) is solid — but they're the parts most likely to need a tweak once you see it run against your actual install.