Add LoRA loading support for MiniMax-H3 (#14408)
* Add LoRA support for MiniMax-H3
* Address review: Copied-from loader, LoRA badge, docstring caveats, drop generic scale test
* Move the MiniMax-H3 LoRA tests to tests/lora
* Support the remaining published MiniMax-H3 LoRA layouts
Three more published H3 LoRAs did not load. Two were key-layout gaps and the
third was the reason neither was noticed: a layout that reaches no module at
all used to return without an exception.
- musubi-tuner writes one flattened `lora_unet_` name per module. It is
un-flattened against the H3 module vocabulary, since `qkv_proj`,
`token_refiner`, `final_layer` and the output heads carry underscores that
are not path separators, and then goes through the existing kohya path.
- one producer publishes its own converter's output: diffusers module names
with peft's `.default.` infix left in and no component prefix. The infix is
dropped and the prefix added.
- a state dict that filters to nothing in both partitions now warns instead of
loading as a silent no-op, in the wording `load_lora_adapter` uses for the same
situation.
A fourth loaded, but at the wrong strength. One producer ships no `.alpha` scalars
and records the alpha it trained with in the file's own `__metadata__` instead,
under `alpha`. Its 8-step turbo LoRA pairs that entry's 8 with rank 128, an
effective scale of 0.0625, so synthesizing `alpha == rank` applied the adapter 16x
too strong. That entry is now read as the uniform network alpha. Per-module scalars
still win when a file carries both, since the converter has already folded them into
the weights, and a non-numeric value is warned about and ignored. `__metadata__` only
exists on a file, so `_fetch_state_dict` hands it back on request.
* Simplify the MiniMax-H3 LoRA comments
* Trim the MiniMax-H3 LoRA tests to loading and effectiveness
* Reference the alpha convention in the MiniMax-H3 LoRA docstring
* Drop a redundant format comment
* Test only diffusers-written state dicts
* Rely on get_peft_kwargs for alpha-less files
* Drop the peft version guards after the main cleanup
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>