MiniMax H3 โ€” "Megan Fox" LoRA (diffusers/PEFT port)

Conversion of Playtime-AI/Minimax_H3-Megan_Fox (MM-H3 - Megan Fox v1.1.safetensors) from the original kohya/Fizgig layout into the diffusers-tree PEFT layout that MiniMaxAI/MiniMax-H3 and MiniMaxAI/MiniMax-H3-Turbo-Lora expect.

Trigger phrase: Megan Fox

What was changed

  1. Key normalisation. lora_unet_blocks_20_attn_qkv_proj.lora_down/.lora_up -> transformer_blocks.20.attn.to_q/to_k/to_v.lora_A/.lora_B, via the same transforms scripts/convert_minimax_h3_to_diffusers.py applies to the base weights:
    • blocks. -> transformer_blocks., token_refiner.blocks. -> token_refiner.refiner_blocks.
    • attn.out_proj -> attn.to_out.0, mlp.fc2 -> ff.net.2
    • mlp.fc1 -> ff.net.0.proj with the two fused SwiGLU halves swapped (store order is [gate; value], diffusers reads [value; gate])
    • attn.qkv_proj -> to_q/to_k/to_v by splitting lora_B's 21504 rows into contiguous thirds of num_attention_heads * attention_head_dim = 56 * 128 = 7168
  2. Inert modules dropped. In the source file all 208 lora_down are nonzero but lora_up is all-zero for blocks 0-19 (metadata: ss_photo_blocks = 20-49). Since delta = lora_up @ lora_down, those 80 modules are exact no-ops and were removed: 208 -> 192 modules.
  3. lora_B pre-scaled by 2.0. The source has alpha == rank == 16, i.e. a natural scale of 1.0. The Turbo-Lora Space's lightx loader computes scale = LIGHTX_ALPHA / rank = 8 / 16 = 0.5 with a non-configurable constant, so B is pre-multiplied by 2 to land the fold on exactly 1.0.

Row-layout note (do not "fix" this)

The fused QKV is contiguous [q_all; k_all; v_all], not per-head interleaved. Verified two ways: Fizgig (xmarre/Fizgig) writes split modules at contiguous offsets (padded_up_weight[sum(split_dims[:i]) : sum(split_dims[:i+1])]), and measurement on this file gives group-separation 0.175 for contiguous grouping vs 0.023 for interleaved, with row-norm autocorrelation at lag 7168 at 4.4x the lag-384 (interleave) signature. De-interleaving would scatter each head's q/k/v across all three projections.

Validated

Every one of the 312 converted targets was checked against MiniMaxAI/MiniMax-H3/transformer/diffusion_pytorch_model.safetensors.index.json: 0 missing. Uniform rank 16. No zero tensors. lora_B shape histogram: 96 x (7168,16) q/k/v thirds, 64 x (5376,16) fc2/out_proj, 32 x (28672,16) fc1.

192 modules / 384 tensors, 106,479,544 bytes.

Usage

Environment variables on a duplicate of MiniMaxAI/MiniMax-H3-Turbo-Lora โ€” no code changes:

H3_LORA=off
H3_LIGHTX_REPO=masra2/MiniMax-H3-Megan-Fox-LoRA
H3_LIGHTX_FILE=mfox-diffusers.safetensors
Downloads last month
-
Inference Providers NEW

This task can take several minutes

Model tree for masra2/MiniMax-H3-Megan-Fox-LoRA

Adapter
(158)
this model