Nodes/ComfyUI-WepeNerd/Load LoRA Masked
ComfyUI Node

Load LoRA Masked

The LoRA that only lives where you paint it

By WepeNerd·Created 5 months ago·Updated about 17 hours ago· 0
Load LoRA Masked
  • model
  • image
  • MODEL
lora_name
strength1.00
mask_data

A normal LoRA loader patches the whole model. Load LoRA Masked patches part of it, and you choose the part with a brush. You paint a region of the image, and the LoRA's influence only gets applied inside that region while the rest of the latent keeps running on clean weights. If you've ever wanted a style or character LoRA to shape just one corner of a composition - without it bleeding across the whole frame - this is that tool, and there isn't much else like it in the wild.

Two things to know before you get excited. First, it's Krea 2 only - the node checks that the incoming MODEL is a native Krea2 model and throws otherwise. Krea 2 (a 12B diffusion transformer that took the open ecosystem by storm in mid-2026) is the model you're buying into anyway, so that constraint stings less than it sounds. Second, the honest caveat from the README: a mask here is not a crop. Attention and denoising spread effects beyond your painted area, so if you need pixel-exact isolation you still composite in post. This node is for steering where a LoRA's weights bite, which is subtler than masking an inpaint pass.

How the masking actually works

Under the hood it's a regional patch, not an image-mask hack. The mask_data widget stores a base64 PNG whose alpha channel is your painted coverage. On execution the node loads the LoRA and, for every spatial linear layer, computes the LoRA (or LoKr) delta and adds it to the layer output - multiplied by the mask, interpolated to the latent grid - but only over image tokens, never text.

That's why it works on a DiT like Krea 2 and why the list of supported adapters is fussy. The regex only matches spatial layers (attn, mlp, the first/last.linear convs), and only linear LoRA and full or factored LoKr pass validation. DoRA, convolution, Tucker and reshape variants are rejected outright. Text, timestep, modulation and normalization layers are simply omitted and logged. Empty mask? The model comes back untouched - zero cost.

A few details worth knowing:

  • The base model keeps its quantized forward pass. It works with native floating-point or native INT8 ConvRot Krea 2 weights loaded through ComfyUI's Load Diffusion Model. Custom INT8 loaders, GGUF, FP8 and NVFP4 paths are not supported - it refuses rather than silently corrupting.
  • Negative strengths are fine (that's how you push a LoRA's concept away), and chained masked nodes add independent spatial contributions while ordinary global LoRA patches keep working.

The inputs that matter

Only a handful, and you'll mostly leave them alone:

  • model - the MODEL. Must be native Krea2 from Load Diffusion Model. This is the trap.
  • lora_name - pick from your installed LoRAs.
  • strength - default 1.0, range −20 to 20, step 0.01. Negative values supported.
  • mask_data - don't hand-type this. Click Edit mask and paint with brush, rectangle or eraser. The magenta overlay is a fixed 45% preview; the interiors you paint get the full selected strength.
  • image (optional) - feed a reference so the editor matches your real aspect ratio: drop an image for its exact dimensions, or paint the default 1024×1024 canvas and let the mask map proportionally. A full mask painted on the wrong aspect ratio misses where you want it, so use a reference with your intended shape.

Output: one MODEL, wired straight into your sampler. The mask and any reference PNGs are embedded in the workflow JSON, so exporting the workflow keeps them.

Install

It ships in the WepeNerd pack. ComfyUI Manager: search WepeNerd, or:

cd ComfyUI/custom_nodes
git clone https://github.com/WepeNerd/ComfyUI-WepeNerd.git
cd ComfyUI-WepeNerd
pip install -r requirements.txt

Restart ComfyUI and the node sits under WepeNerd/Loaders. The node itself only needs Pillow/numpy on top of ComfyUI's own torch/PIL - but requirements.txt also drags in trimesh, pyrender and av for the pack's 3D and video nodes, so the install is chunkier than this one node needs.

When it won't work

Errors here are mostly the design doing its job: "requires a native Krea2 MODEL" means you loaded via a GGUF or FP8 path; "no supported spatial LoRA/LoKr layers matched" means the file is a conv/DoRA/Tucker adapter or its layers didn't line up with Krea 2. Reference-image layouts beyond index and index_timestep_zero are rejected, as are token-rearranging patches. One more honest note: this pack is new enough that comfy.icu shows zero impressions - you're early. The author, the same WepeNerd behind the well-regarded Obscura LTX video LoRA, ships 85 unit tests plus a CPU/GPU INT8 validation script: more rigor than most packs this size manage. None of that is an image-quality or timing benchmark though, so run your own before you trust it in production.

CategoryWepeNerd/Loaders

Inputs (5)

NameTypeDefaultDescription
modelMODEL
lora_nameCOMBO0 options:
strengthFLOAT1.00-20–20
mask_dataSTRING
imageoptIMAGE

Outputs (1)

NameTypeDescription
MODELMODEL