ComfyUI Node

DoRA Power LoRA Loader

The Flux2 DoRA loader that actually applies the whole file

By xmarre·Created 7 months ago·Updated 8 days ago· 13
DoRA Power LoRA Loader
  • model
  • clip
  • dora_state
  • state_control
  • MODEL
  • CLIP
  • auto_strength_report_json
  • analysis_report
  • lora_stack
state_slotdefault
broadcast_modulationstrue
broadcast_include_dora_scalefalse
dora_decompose_debugfalse
dora_decompose_debug_n30
dora_decompose_debug_stack_depth10
dora_slice_fixtrue
dora_adaln_swap_fixtrue
zimage_lumina2_compattrue
auto_strength_enabledfalse
auto_strength_devicegpu
auto_strength_ratio_floor0.30
auto_strength_ratio_ceiling1.50
runtime_bypass_lorafalse

Ever load a OneTrainer-trained DoRA LoRA on Flux.2 and watch the console fill with lora key not loaded spam while half the file silently goes unused? That's the exact pain this node was built to kill. The DoRA Power LoRA Loader is a stacked, Power LoRA Loader-style node that loads regular LoRAs and DoRA LoRAs together, and it carries the compatibility fixes plain loaders are missing for Flux / Flux.2, OneTrainer, and Diffusers/PEFT exports. If your DoRA loads but "does nothing," or throws shape errors on Flux2 targets, this is the loader to try.

Why this node exists

DoRA (weight-decomposed low-rank adaptation) splits a LoRA update into a magnitude and a direction component, which trains more like a full fine-tune at LoRA size - better face accuracy and less style bleeding at the same rank. It also never quite hit critical mass in the community, and one reason is that ComfyUI's plain loading path has always handled DoRA exports poorly. The author's own release post spells out the trigger: Flux.2 Klein 9B DoRAs trained in OneTrainer with "Decompose Weights (DoRA)," "Use Norm Epsilon," and "Apply on output axis" enabled partially fail in loaders like rgthree's Power LoRA Loader, with the modulation and dora_scale keys never landing. This loader is the answer to that specific class of problem.

How it works

Under the hood it's two things bolted together. First, the loader itself: a stack of LoRA rows (each with a file dropdown, a weight, and an enable toggle) read from ComfyUI's normal loras folder, applied to both model and CLIP in one pass. Second - the part that matters - a pile of loading fixes. At import it monkey-patches ComfyUI internals so DoRA math runs in fp32, normalizes against the updated weight V = W + delta, slices dora_scale correctly for packed qkv targets, and forces fp32 intermediates so tiny products don't flush to zero. It also normalizes Diffusers/PEFT lora_magnitude_vector keys into Comfy-style dora_scale, extends key mapping with suffix matching (.linear.lin), broadcasts OneTrainer's global modulation LoRAs onto the per-block targets, fuses Z-Image Turbo / Lumina2 split QKV LoRAs, and even bypasses convert_lora when that would zero out a valid file's direction matrices. Since the patches apply process-wide, other loaders in the same session quietly get better DoRA behavior too.

The inputs that matter

The two required inputs are model and clip - take them straight from your model loader. Outputs: MODEL and CLIP (wire them into your sampler and CLIP Text Encode as usual), plus auto_strength_report_json, analysis_report, and lora_stack (a typed payload the pack's State Manager can consume). Of the globals, you'll actually touch these:

  • Runtime bypass LoRA - default off. Applies supported LoRA/LoKr adapters in the forward pass instead of materializing patched weights, which "greatly reduces persistent VRAM on very large HIGH_VRAM models." DoRA and unsupported forms are refused rather than approximated, so if a file gets rejected, this toggle is why.
  • Auto-strength enabled - default off. Redistributes relative strength across a stack by baking ratios into the tensors before loading. Ratio floor = ceiling = 1.0 is a true no-op. Adds real loader-time compute, so keep it off unless you're fighting an unbalanced multi-LoRA stack.
  • DoRA slice-fix, DoRA adaLN swap-fix, ZiT/Lumina2 compat - all default on. Leave them on; they're the compatibility layer.

Install

Via ComfyUI Manager (search ComfyUI-DoRA-Dynamic-LoRA-Loader) or:

cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-DoRA-Dynamic-LoRA-Loader

Then restart ComfyUI. There are no model downloads and no pip requirements - it's pure Python on top of the torch and ComfyUI bits you already have.

Where people get burned

  • lora key not loaded: ...lora_magnitude_vector means a Diffusers/PEFT DoRA export. Current versions normalize those keys to dora_scale, but if you still see it, enable Verbose + Log Unloaded Keys to inspect.
  • mat1 and mat2 shapes cannot be multiplied on Flux2 targets points to a direction-matrix layout mismatch in the export. Check the OneTrainer output-axis DoRA mat-fix lines in verbose logs.
  • LoRA loads but has zero effect - if the loader warns that all direction matrices are zero, that's a training/export problem, not a loader problem.
  • NaN/Inf warnings - make sure dora_adaln_swap_fix is enabled.

It's a niche tool for a real pain: if your DoRA works in a plain loader, you don't need it. If it doesn't, this is the one you reach for.

Categoryloaders

Inputs (18)

NameTypeDefaultDescription
modelMODEL
clipCLIP
dora_stateoptDORA_STATE
state_controloptSTATE_MANAGER_CONTROL
state_slotoptSTRINGdefault
broadcast_modulationsoptBOOLEANtrue
broadcast_include_dora_scaleoptBOOLEANfalse
dora_decompose_debugoptBOOLEANfalse
dora_decompose_debug_noptINT300–500
dora_decompose_debug_stack_depthoptINT102–64
dora_slice_fixoptBOOLEANtrue
dora_adaln_swap_fixoptBOOLEANtrue
zimage_lumina2_compatoptBOOLEANtrue
auto_strength_enabledoptBOOLEANfalse
auto_strength_deviceoptCOMBOgpu3 options: auto, cpu, gpu
auto_strength_ratio_flooroptFLOAT0.300–16
auto_strength_ratio_ceilingoptFLOAT1.500–16
runtime_bypass_loraoptBOOLEANfalseApply supported LoRA/LoKr adapters in the forward pass instead of materializing patched model weights. Greatly reduces persistent VRAM on very large HIGH_VRAM models. DoRA and unsupported adapter/offset forms are refused rather than approximated.

Outputs (5)

NameTypeDescription
MODELMODEL
CLIPCLIP
auto_strength_report_jsonSTRING
analysis_reportSTRING
lora_stackDORA_LORA_STACK