Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Krea2Edit — SwarmUI extension

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.

What it does

  • Registers the comfyui-krea2edit node pack as an installable feature, so SwarmUI auto-installs/updates it into your ComfyUI custom_nodes folder 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 4B krea2 text encoder, qwen_image_vae, and the krea2_identity_edit_v1_2.safetensors LoRA) — 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_px dial (default 768).
    • Fit Modefit (default, resamples the source to the output grid) or crop (legacy, for pre-v1.2 weights).
    • Ref Boost / Ref Boost (Second Reference) — the ref_boost/ref_boost_a fidelity 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.
  • 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 for Krea2EditGroundedEncode on both positive and negative conditioning.

Install

  1. Install the model files per the node pack's README — Krea 2 (Turbo or Raw), the Qwen3-VL 4B krea2 text encoder, qwen_image_vae, and krea2_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 manual git clone into custom_nodes needed.
  2. Drop this folder into SwarmUI/src/Extensions/Krea2Edit/ (keep the folder name — extensions are identified by their folder).
  3. Rebuild: run SwarmUI's update script (or a launch-dev script if you're iterating), then start SwarmUI as usual.
  4. In the Generate tab, turn on Display Advanced Options, find Krea 2 Identity Edit, and toggle it on.
  5. Pick a Krea 2 checkpoint, add the krea2_identity_edit_v1_2 LoRA 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.

Things to verify against your SwarmUI checkout before you trust this blind

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 — try 6.5 or lower. If the identity-edit LoRA doesn't seem to land on the patched model, it's running too late relative to LoRA loading — try 7.5+.
  • Node schema for Krea2EditModelPatch/Krea2EditGroundedEncode was originally guessed from the README prose and got it wrong (a nonexistent target_latent input 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 widgets fit_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, check GetPromptImage's definition in your WorkflowGenerator.cs.
  • Krea2EditFitMode as free text rather than a real dropdown — I didn't want to guess at the exact T2IParamType field name your version uses for enum/dropdown values (e.g. Values vs. GetValues). If you want a proper dropdown, check T2IParamTypes.cs for how other string dropdowns (like sampler name) register their choices and mirror that in OnInit().

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.

About

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.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages