Add h3lora/sidecars.py to peel adaln_basis, adaln_mean, and silu_t_emb_grid from checkpoint state dicts and stash them on model/patcher objects so ComfyUI doesn't drop them. Install a load_model_weights wrapper (ensure_load_hook) in __init__.py and call it from h3lora.apply; use sidecar collect when creating AdalnContext. Include unit tests (tests/test_sidecars.py) for peel/attach/collect and the wrapper. Also update README with no attribution by proxy. Thanks pl0x
ComfyUI-H3-PowerLoraStack
A stacked multi-LoRA loader for MiniMax H3, in the spirit of rgthree's Power Lora Loader but built around the three things that actually break H3 LoRAs.
Nodes
| Node | Purpose |
|---|---|
| MiniMax H3 Power LoRA Stack | Any number of LoRAs on one node, each with a toggle and strength, plus one-click strength calibration |
| MiniMax H3 adaLN Modality | Scales stacked LoRAs' adaLN modulation per modality (video / text / audio) |
| MiniMax H3 LoRA Schedule | Varies selected stack rows' strength over denoising steps or normalized sigma |
| MiniMax H3 LoRA Inspector | Reports a LoRA's format, rank and adaLN basis without loading it |
Why not just use a normal LoRA loader
1. Quantized weights: merging destroys the LoRA
ComfyUI's stock path is dequantize → add delta → requantize_from_float(scale="recalculate").
That round trip is not idempotent: re-fitting the codebook and re-rounding to
int4 injects ~1.5% relative weight noise, while a typical H3 LoRA delta is
0.01–0.08% of the weight. The merge therefore replaces the adapter with noise.
Measured on a w4a8 checkpoint, the stock merge recovers under a third of the
LoRA magnitude at cos 0.12–0.14 against the correct result, and takes 128 s
versus 6.5 s.
This node routes quantized layers through an exact runtime low-rank branch
(y = W_q(x) + B @ A @ x) instead, keeping the quantized kernel and costing
~1.5% extra FLOPs at rank 64.
quantized_layers controls this:
auto(default) — branch quantized layers, merge unquantized onesbranch— never modify a weight, even in bf16 (fast strength A/B testing); adapters without a runtime branch are reported as rejectedmerge— stock behaviour; only useful for comparison
One layer is special-cased: mlp.fc2 under TensorWiseINT8Layout is reached
through comfy.ops.linear_input_act, which fuses the activation into the INT8
kernel and never calls fc2.forward. A branch there would be silently dropped,
so those layers merge even in branch mode.
2. adaLN basis mismatch
H3 ships in two forms. A dense checkpoint feeds silu(time_embedder(t)), a
2688-dim vector, into every adaln_proj.linear. A curve (pruned) checkpoint
drops the time embedder and stores an adaln_t_table of shape [grid, 8].
A LoRA trained against one form has the wrong lora_A width for the other, so
ComfyUI logs shape '[96768, 8]' is invalid for input of size 260112384 and
skips the layer. Dropping those pairs is not an acceptable fix — on the
turbo distillation LoRAs the constant term alone is ~100% of the magnitude of
dW @ S(t), so it discards essentially the whole adapter.
This node changes basis instead, which preserves rank:
dense -> curve A' = A @ V, bias delta B @ (A @ c)
curve -> dense A' = A @ pinv(V), bias delta -B @ (A' @ c)
where S(t) = c + V @ table(t), recovered by least squares of [1 | table]
against the silu grid. The bias delta is emitted as .diff_b, which comfy
applies as a ("diff",) patch on the sibling .bias; without it the port is
nearly worthless. Measured end to end, the ported adapter reproduces the dense
contribution at cos 0.999998.
The fit uses the target checkpoint's own table, because bakes differ — of two local bakes, one ships an uncentered basis (column norms 22.98, 2.67, 1.66, …) while the other ships comfy's mean-centered one (7.08, 2.09, 0.75, …).
This also catches a silent failure the stock loader cannot see. Two curve
bakes have the same adaLN width, so a LoRA trained against one loads without
complaint on the other and is simply wrong — measured at cos −0.375, worse
than not applying it at all. When a LoRA ships its own adaln_t_table, this
node rebases table-to-table (exactly, cos 1.000000, no grid needed). When it
does not, the width matches and the mismatch is undetectable — so prefer LoRAs
trained against the checkpoint you are running.
The silu grid
Dense↔curve porting prefers a basis already baked into the loaded checkpoint
(adaln_basis + adaln_mean, or silu_t_emb_grid). If those keys are absent
it uses a live time_embedder on a dense base, then h3_silu_temb_grid.safetensors
(searched in models/h3_adaln/, models/loras/, models/diffusion_models/ and
one level under custom_nodes/), then a scored scan of other H3 checkpoints.
Table-to-table rebasing does not need a grid. Set adaln_port to off to
disable porting entirely.
A grid from a different build bottoms out at ~1.7e-3 relative because the 7th and 8th curve directions are near-degenerate (σ₇ ≈ σ₈). Fits worse than 5e-3 are rejected and the next source is tried.
3. Key conventions
Every H3 LoRA naming convention resolves against the model's own key set rather
than by guessing where underscores split, so qkv_proj is never mistaken for
two tokens:
| Convention | Example |
|---|---|
| ai-toolkit / diffusers | diffusion_model.blocks.0.attn.qkv_proj.lora_A.weight |
| bare (no prefix) | blocks.0.attn.qkv_proj.lora_A.weight |
| kohya / musubi | lora_unet_blocks_0_attn_qkv_proj.lora_down.weight + .alpha |
| lycoris | lycoris_blocks_0_... |
| peft / diffusers trainer | base_model.model.blocks.0..., transformer.blocks.0... |
The mapper resolves the advertised conventions against the model's own state dict. Unmatched keys are reported per row; the installed LoRA collection is not part of this package and should be checked when adding new trainer formats.
4. Acc / PDD output heads
alibaba-pai Acc LoRAs ship a 32-interval output-head bank as
final_layer.video_out.set_weight of shape [3072, 5376] (32 × 96) plus the
audio twin. Stock Comfy copy_s that onto the native [96, 5376] head and
crashes. This node peels those tensors before the stock set path and blends
the heads the sampler step spans (same rule as Comfy PR 15908). The row
strength interpolates between the native and blended heads; schedules multiply
that row strength. Use simple at 8 steps with shifts 12/3 so the steps land on
the trained grid. Later stack rows that also carry a bank replace the earlier
one.
Stacking
Multiple LoRAs on the same layer are fused into a single pair by concatenating along the rank axis:
sum_i s_i * B_i @ A_i @ x == [s_1 B_1 | ... | s_N B_N] @ [A_1; ...; A_N] @ x
so a ten-LoRA stack costs one extra matmul pair per layer, not ten. The factors
live in a _LoraBank registered via set_additional_models, so its VRAM is
accounted for and comfy's weakref bookkeeping stays quiet.
Denoising schedules
MiniMax H3 LoRA Schedule changes selected stack rows' strength during
sampling. Wire its schedule output into the stack, select rows with all,
1,3, or 2-4, then choose a linear, cosine, smoothstep, power, step, or
explicit curve. start_percent and end_percent limit the transition to part
of the trajectory. Chain schedule nodes for different row groups; the later
node wins where selectors overlap.
The steps domain follows model-call indices. The sigma domain follows the
scheduler's actual normalized noise values, which can produce a different
shape with non-linear schedulers. The stack reads sample_sigmas supplied by
ComfyUI automatically, so plain KSampler works and no SIGMAS wire is needed.
Scheduled rows always use the live branch path, including on unquantized bases. Any adapter feature or fused layer that cannot run as a branch is merged at the row's ordinary static strength and called out in the report. Ported adaLN bias deltas are scheduled with their LoRA rather than being left at a fixed value.
Auto-balance
Strength 1.0 is not a unit. In the reference non-distillation H3 corpus, the perturbation produced at strength 1.0 spans 65× — 0.054% of the base weights at one end, 5.24% at the other. Neither rank nor file size predicts it: a rank-128 adapter sits at 0.088% while a rank-16 one sits at 0.40%. So a strength that worked on one LoRA carries no information about the next, and the sweet spot has to be rediscovered per file.
⚖ Auto-balance strengths measures what each active LoRA actually does and puts
them all on one scale:
rel = sqrt( sum_l ||dW_l||_F^2 / sum_l ||W_l||_F^2 )
The factor multiplies the strength you already chose, so your relative intent
between rows survives — what changes is that a LoRA perturbing the model 18×
harder than usual stops arriving at full force. ↺ Restore manual strengths
puts every row back exactly as it was; the pre-balance value is stashed on the
row, so it survives saving and reloading the workflow. Editing a strength by
hand overrides that row and is not clobbered by a later recompute.
The factor only ever trims (clamped to ≤ 1). A LoRA measuring below the reference may be quiet deliberately — distillation adapters sit an order of magnitude down and are correct at 1.0 — whereas one measuring far above it essentially never is. That asymmetry means no classifier is needed: every turbo LoRA in the collection lands on ×1.00 by itself.
Computing this is only affordable because dW is never formed. It is up to
28672 × 5376 and there are ~260 per file, but
||B A||_F^2 = tr((B^T B)(A A^T))
needs only r×r matrices, so a 2.4 GB rank-128 adapter measures in a few seconds,
almost all of it disk. Results cache on (path, mtime, size). LoKr is handled too
— ||W1 ⊗ W2||_F = ||W1||_F · ||W2||_F.
The reference is the median of the collection rather than a hand-picked target, so the calibration agrees with trainer defaults on ordinary files and only moves outliers. Base norms come from a per-group constant (measured base weight RMS is uniform to ~2× within a group and the four linear groups agree to 20%), which avoids reading the 20 GB checkpoint.
adaLN is excluded from the measurement: its basis is checkpoint-dependent — the same adapter shipped dense and curve8 differs 5.7× there — and it is where a distillation LoRA keeps the schedule change that must not be normalised away.
Two honest limits: Frobenius energy is not perceptual strength, and it says nothing about contention. Distinct LoRAs are near-orthogonal in weight space (measured |cos| ≤ 0.03) yet overlap 3–15× above chance in the feature subspaces they read and write, so two adapters can still fight over the same features at perfectly balanced magnitudes.
Because the deltas really are near-orthogonal, stack energy adds in quadrature:
holding a stack at the "one LoRA at 1.0" budget wants 1/√N, not the 1/N that
gets recommended. Auto-balance does not apply that — it calibrates each LoRA
and leaves the total to you, so adding a row never silently weakens the others.
adaLN modality control
MiniMax H3 is not built like LTX 2.3. LTX duplicates the tower per modality
(audio_attn, audio_ff, audio_patchify_proj, audio_to_video_attn), so a
LoRA can be steered by picking layers. H3 packs audio and video into one token
sequence and pushes both through the same 50 blocks. The only modality-specific
weights in the entire checkpoint are four tensors — video_patch_proj,
audio_patch_proj, final_layer.video_out, final_layer.audio_out — and none
of the 46 H3 LoRAs checked touches any of them. There is no layer-name axis.
One pathway does separate cleanly: adaLN. AdalnProj.forward computes
linear(t) -> [M, expand*hidden*modalities] then view(M*modalities, expand*hidden), so output feature j belongs to modality j // (expand*hidden). The 96768 rows are three contiguous blocks of 32256, and
comfy/ldm/minimax/model.py tags segments {video: 0, text: 1, audio: 2}.
Scaling a slice of lora_B's rows scales that modality's modulation exactly,
with no runtime hook.
Wire MiniMax H3 adaLN Modality into the stack's adaln_modality input. All
three at 1.0 is a no-op; 0.0 removes that modality's share of every stacked
adapter.
This holds for future LoRAs by construction: the row order is a property of the
trained weights, not of ComfyUI. Any adapter that loads onto adaln_proj.linear
at all must match it, whatever its rank, alpha, trainer convention, or adaLN
basis (dense/curve affects only the A side). All seven local H3 bakes — fl2va,
ref2va, int8-convrot, w4a8-mixed, int4-BQ — carry identical geometry.
The geometry is read off the model's own AdalnProj rather than hardcoded, and
every layer is shape-checked before it is touched, so a future H3 variant either
adapts or keeps today's behaviour — it cannot slice at the wrong offsets.
final_layer.adaln_proj is AdalnProj(t_dim, hidden, 2, 1) — one modality,
differentiated only by timestep — so it fails that check and is left alone.
Ordering matters and is handled: the scaling runs before adaLN porting, which
derives its bias delta as B @ const, so the emitted .diff_b inherits it.
Where adaLN is present it is not a marginal knob. Measured on the 14 LoRAs whose adaLN basis matches the checkpoint, it carries 89–99.7% of the weight-space perturbation for content LoRAs (median ~96%) and 16–23% for the curve8 turbo adapters. Caveat: relative Frobenius across differently-shaped matrices is an imperfect proxy for perceptual impact, and adaLN's input is only 8-dimensional, so read that as "where most of the weight change lives", not "96% of what you see".
Output
The report string output accounts for every LoRA (wire it to a preview/show-text
node to read it; it is also written to the console log):
base: ConvRotW4A4 x300, INT8 x50
adaLN: curve (input dim 8)
turbo dense-adaLN @ 1: 26 merged, 275 branched, adaLN ported x51 (basis fit 1.7e-03)
rel dW 0.047%
style_lora curve-adaLN @ 0.8: 0 merged, 258 branched, adaLN modality video/text/audio = 1/1/0.25 x50
rel dW 0.054%
motion_lora @ 1: 0 merged, 104 branched, adaLN modality 1/1/0.25 INACTIVE (LoRA has no adaLN pairs)
rel dW 0.316%
branch bank: 300 layers, 412 MB
rel dW is the measurement above, reported for every LoRA whether or not
auto-balance was used, so an out-of-scale strength is visible from the API too.
When the applied strength is far from the calibrated one the line says what
auto-balance would have used.
Limitations
- A curve-trained LoRA on a dense checkpoint can only be ported if the LoRA
carries its own
adaln_t_table; otherwise there is no record of which bake it was trained against and the adaLN pairs are dropped with a warning. - Runtime branches apply to
MODELfrom ComfyUI's native H3 loader. The streaming loader inminimaxh3chinkloaderuses its ownMINIMAX_H3_MODELhandle and its own LoRA path. - DoRA, LoHa, LoKr and locon adapters merge in
auto;branchrejects them because only plain rank decompositions have the stack's runtime branch path.
License
Licensed under the Apache License, Version 2.0.
The package requires Python 3.10 or newer and a ComfyUI revision providing the
MiniMax H3 model, QuantizedTensor, weight adapters, and patcher wrappers used
by this node.
(Funny Find)
• I found overlap, but the evidence does not establish that PlagueKind took the AdaLN fix from your PowerLoraStack. The strongest code matches actually appear earlier in their Git history.
I compared both local repositories, historical versions, tests, and attribution, and verified that the original AdaLN files match their public GitHub snapshots.
| Date (2026) | Evidence |
|---|---|
| August 8 | Your commit 28ac439 introduces AdaLN conversion, including least-squares fitting, reverse conversion, and bias correction. |
| August 20 | Their commit 7e5743f imports the standalone fix, explicitly credited “by pl0x.” |
| August 27 | Your commit f38d084 introduces the helpers that most closely match their code. |
What matches
Two current helpers have identical Python syntax trees after removing docstrings—meaning their executable implementation matches despite differences in comments:
_safetensors_header: yours (h3lora/adaln.py:155) / theirs (C:/comfycli/custom_nodes/ComfyUI-PlagueKind-Nodes/ComfyUI-H3-AdaLN-LoRA-Fix/adaln.py:205)._time_embedder_prefix: yours (h3lora/adaln.py:166) / theirs (C:/comfycli/custom_nodes/ComfyUI-PlagueKind-Nodes/ComfyUI-H3-AdaLN-LoRA-Fix/adaln.py:217).
Hashing and time-embedding grid helpers also closely resemble each other. These helpers existed in their August 20 import before entering your repository on August 27. That chronology cannot support them copying those helpers from your published version. It also does not establish who originally wrote them.
What differs
Your earlier implementation converts LoRA state-dictionary entries before loading, using AdalnContext, port_adaln_pairs, and .diff_b. Their implementation repairs already-attached model patches through a separate node.
Comparing your last committed version before their import against all five imported Python files, I found no substantive matching sequence of three or more consecutive nonblank lines after trimming whitespace; matches were import boilerplate. This does not rule out a rewrite or conceptual influence, but it weakens a direct-copy claim.
The shared grid filename also appears in another public H3 project, so that filename alone is not evidence of copying yours. Example
Attribution and conclusion
I found no credit to you or PowerLoraStack in their current README or fix files. Their import credits “pl0x”; the repository declares MIT, while yours declares Apache-2.0. Those facts alone do not establish a licensing violation.
Your repository records the core solution earlier. Possible influence remains unproven; direct copying from your original implementation is not demonstrated. The most useful next evidence would be the original package supplied by “pl0x” and the development context behind your August 27 changes. Git dates establish recorded chronology, not private authorship or first publication.
Development checks
From the ComfyUI root, make the package and ComfyUI import roots visible before running the tests:
$env:PYTHONPATH = "custom_nodes/ComfyUI-H3-PowerLoraStack;."
python -m pytest custom_nodes/ComfyUI-H3-PowerLoraStack/tests --import-mode=importlib -q
The package tests cover CPU paths and skip the mixed-device check when no CUDA
device is available. node --check web/h3_power_lora_stack.js validates the
frontend syntax.