Text-to-Image
Diffusers
Safetensors
MiniMax H3
VideoX Fun
controlnet
controlnet-union
image-to-image
ml-intern
Instructions to use akhaliq/MiniMax-H3-Image-Fun-Controlnet-Union-2.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use akhaliq/MiniMax-H3-Image-Fun-Controlnet-Union-2.0 with Diffusers:
pip install -U diffusers transformers accelerate
from diffusers import ControlNetModel, StableDiffusionControlNetPipeline controlnet = ControlNetModel.from_pretrained("akhaliq/MiniMax-H3-Image-Fun-Controlnet-Union-2.0") pipe = StableDiffusionControlNetPipeline.from_pretrained( "MiniMaxAI/MiniMax-H3-Image", controlnet=controlnet ) - VideoX Fun
How to use akhaliq/MiniMax-H3-Image-Fun-Controlnet-Union-2.0 with VideoX Fun:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Model card v2: validation verdict — branch attaches but does not steer; evidence + repro
Browse files
README.md
CHANGED
|
@@ -3,6 +3,10 @@ license: other
|
|
| 3 |
license_name: minimax-h3-community-license-agreement
|
| 4 |
license_link: LICENSE
|
| 5 |
library_name: diffusers
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
tags:
|
| 7 |
- minimax-h3
|
| 8 |
- videox_fun
|
|
@@ -10,64 +14,102 @@ tags:
|
|
| 10 |
- controlnet-union
|
| 11 |
- text-to-image
|
| 12 |
- image-to-image
|
| 13 |
-
- image-editing
|
| 14 |
- ml-intern
|
| 15 |
---
|
| 16 |
|
| 17 |
-
<div style="display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 2em"><a href="https://hf.co/chat?mode=ml-intern"><img src="https://hf.co/datasets/huggingface/badges/resolve/main/built-with-ml-intern-lg.svg" alt="Built with ML Intern" style="margin:0"></a><a href="https://hf.co/chat?mode=ml-intern&prompt=
|
| 18 |
-
|
| 19 |
-
# MiniMax-H3-Image + Fun ControlNet-Union 2.0 (
|
| 20 |
-
|
| 21 |
-
This repo packages
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
## Repo layout
|
| 37 |
|
| 38 |
```
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
```
|
| 50 |
|
| 51 |
-
|
| 52 |
|
| 53 |
```python
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
)
|
| 60 |
-
# Load the control branch on top of the transformer via VideoX-Fun's
|
| 61 |
-
# minimax_h3_control_inpaint_post_norm.yaml, then run with a control image
|
| 62 |
-
# treated as a single-frame control video.
|
| 63 |
```
|
| 64 |
|
| 65 |
-
|
| 66 |
|
| 67 |
-
-
|
| 68 |
-
|
| 69 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
-
##
|
| 72 |
|
| 73 |
-
|
|
|
|
|
|
| 3 |
license_name: minimax-h3-community-license-agreement
|
| 4 |
license_link: LICENSE
|
| 5 |
library_name: diffusers
|
| 6 |
+
base_model:
|
| 7 |
+
- MiniMaxAI/MiniMax-H3-Image
|
| 8 |
+
- alibaba-pai/MiniMax-H3-Fun-Controlnet-Union-2.0
|
| 9 |
+
base_model_relation: merge
|
| 10 |
tags:
|
| 11 |
- minimax-h3
|
| 12 |
- videox_fun
|
|
|
|
| 14 |
- controlnet-union
|
| 15 |
- text-to-image
|
| 16 |
- image-to-image
|
|
|
|
| 17 |
- ml-intern
|
| 18 |
---
|
| 19 |
|
| 20 |
+
<div style="display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 2em"><a href="https://hf.co/chat?mode=ml-intern"><img src="https://hf.co/datasets/huggingface/badges/resolve/main/built-with-ml-intern-lg.svg" alt="Built with ML Intern" style="margin:0"></a><a href="https://hf.co/chat?mode=ml-intern&prompt=Fine-tune%20the%20control%20branch%20in%20akhaliq%2FMiniMax-H3-Image-Fun-Controlnet-Union-2.0%20so%20it%20steers%20H3-Image" style="display:inline-flex;align-items:center;gap:5px;padding:4px 12px;border:1.5px solid #eee;border-radius:16px;background:#f9fbfc;color:#c2410c;font-weight:600;font-size:14px;text-decoration:none">Adapt the control branch<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M13.5 6H5a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-8.5m-10.5 6L21 3m0 0h-5m5 0v5"/></svg></a><a href="https://hf.co/chat?mode=ml-intern&prompt=Test%20the%20control%20branch%20from%20akhaliq%2FMiniMax-H3-Image-Fun-Controlnet-Union-2.0%20on%20the%20native%20(non-distilled)%20H3-Image%20DiT%20at%2040%20steps" style="display:inline-flex;align-items:center;gap:5px;padding:4px 12px;border:1.5px solid #eee;border-radius:16px;background:#f9fbfc;color:#c2410c;font-weight:600;font-size:14px;text-decoration:none">Try the native DiT<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M13.5 6H5a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-8.5m-10.5 6L21 3m0 0h-5m5 0v5"/></svg></a></div>
|
| 21 |
+
|
| 22 |
+
# MiniMax-H3-Image + Fun ControlNet-Union 2.0 (wired, not yet steering)
|
| 23 |
+
|
| 24 |
+
**Status: honest negative.** This repo packages [MiniMaxAI/MiniMax-H3-Image](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image)
|
| 25 |
+
(diffusers variant) with the [alibaba-pai/MiniMax-H3-Fun-Controlnet-Union-2.0](https://huggingface.co/alibaba-pai/MiniMax-H3-Fun-Controlnet-Union-2.0)
|
| 26 |
+
control branch, plus a **verified-correct runtime wiring** to attach the branch to the image DiT.
|
| 27 |
+
The verdict from validation: the branch attaches and runs, but **does not transfer usable spatial
|
| 28 |
+
control to the image model out of the box** — it perturbs the output instead of steering it.
|
| 29 |
+
It needs adaptation fine-tuning on the image model (the same kind of port that worked for the
|
| 30 |
+
[character-swap LoRA](https://huggingface.co/akhaliq/MiniMax-H3-Image-Character-Swap), but this
|
| 31 |
+
time it's 10 transformer blocks, not a weight delta — see "Why this merge is different" below).
|
| 32 |
+
|
| 33 |
+
Everything needed to reproduce, extend, or fine-tune from this point is in the repo.
|
| 34 |
+
|
| 35 |
+
## What was verified (H200, diffusers 0.43, seed 904231, 1024×1024)
|
| 36 |
+
|
| 37 |
+
| Check | Result | Meaning |
|
| 38 |
+
|---|---|---|
|
| 39 |
+
| Control weights load | 144 tensors, `missing=0 unexpected=0` | Block architecture matches the image DiT exactly |
|
| 40 |
+
| `control_context_scale=0.0` | **PSNR = ∞** vs base (bit-identical) | Wiring is inert when gated off — math is right |
|
| 41 |
+
| Canny control @ 0.5 / 1.0 / 1.5 / 2.0 | PSNR vs base 16.2 / 13.8 / 12.8 / 12.1 dB | Output changes monotonically with scale… |
|
| 42 |
+
| …but structure follows edges? | **No** — output ignores the edge map at every scale | Branch perturbs, doesn't steer |
|
| 43 |
+
| Circle-left vs circle-right control | Output edge-density L/R ratio 1.012 vs 1.008 | No spatial routing reaches the pixels |
|
| 44 |
+
| `control_proj_in` output norms | L/R 1.031 → 0.970 when circle flips side | Control **input** is spatially correct |
|
| 45 |
+
| Hint norms after control blocks | L/R ≈ 0.97–1.00, nearly identical for both circles | Control **blocks** collapse the spatial signal on image-model activations |
|
| 46 |
+
|
| 47 |
+
Images: [`assets/validation/`](assets/validation) (canny sweep), [`assets/diag/`](assets/diag) (circle test),
|
| 48 |
+
[`assets/diag2/`](assets/diag2) (hint heatmaps).
|
| 49 |
+
|
| 50 |
+
**Mechanism of the failure:** the control rows (image VAE latents of the control image, patchified
|
| 51 |
+
(1,2,2), zero-padded to the 196-col no-inpaint layout) carry the spatial pattern correctly into
|
| 52 |
+
`control_proj_in`. But the 10 control blocks — trained against the MiniMax-H3 **video** model's
|
| 53 |
+
activations at ~40 flow-matching steps — wash that pattern into a global offset when they run over
|
| 54 |
+
the image DiT's packed sequence (6-step PDD-distilled grid). The zero-gated `after_proj` skips they
|
| 55 |
+
emit are spatially near-uniform, so the main branch receives a per-position nudge that carries no
|
| 56 |
+
structure.
|
| 57 |
+
|
| 58 |
+
## Why this merge is different from a LoRA merge
|
| 59 |
+
|
| 60 |
+
A LoRA is a weight delta (`W + B·A`) — it fuses offline and the forward pass never changes, which
|
| 61 |
+
is why the video-trained character-swap LoRA ported cleanly. A ControlNet is a **parallel runtime
|
| 62 |
+
branch**: 10 full transformer blocks whose zero-gated outputs are added to the main branch's
|
| 63 |
+
activations at layers 0,5,…,45 on every denoising step. It cannot be folded into the weights, and
|
| 64 |
+
its behavior depends on the activation statistics and denoising trajectory it was trained with —
|
| 65 |
+
both of which differ between the video model and the PDD-distilled image model.
|
| 66 |
|
| 67 |
## Repo layout
|
| 68 |
|
| 69 |
```
|
| 70 |
+
transformer_diffusers/ # H3-Image DiT (PDD, 6-step) — unmodified
|
| 71 |
+
vae_diffusers/, tokenizer/, processor/, scheduler/
|
| 72 |
+
modular_model_index.json # components referenced from MiniMaxAI/MiniMax-H3-Image
|
| 73 |
+
controlnet/
|
| 74 |
+
MiniMax-H3-Fun-Controlnet-Union-2.0.safetensors # the video-trained branch (13.6 GB)
|
| 75 |
+
configuration.json
|
| 76 |
+
merge/
|
| 77 |
+
validate_controlnet.py # attach + wrap + canny sweep (the wiring, working)
|
| 78 |
+
diag_spatial.py # circle left/right spatial-routing test
|
| 79 |
+
diag_hints.py # offline control-branch replay, hint heatmaps
|
| 80 |
+
assets/validation*/ , assets/diag*/
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
## Using the wiring (reproduce / build on it)
|
| 84 |
+
|
| 85 |
+
```bash
|
| 86 |
+
pip install "diffusers>=0.43" torch transformers accelerate safetensors gradio_client \
|
| 87 |
+
opencv-python-headless hf_xet
|
| 88 |
+
python merge/validate_controlnet.py # needs an H200-class GPU (~77 GiB peak)
|
| 89 |
```
|
| 90 |
|
| 91 |
+
The attach API (from `merge/validate_controlnet.py`):
|
| 92 |
|
| 93 |
```python
|
| 94 |
+
attach_control_branch(model, "controlnet/MiniMax-H3-Fun-Controlnet-Union-2.0.safetensors")
|
| 95 |
+
wrap_forward_with_control(model) # forward gains control_rows / control_context_scale
|
| 96 |
+
control_rows = build_control_rows(pipe, control_image_rgb, latent_h, latent_w)
|
| 97 |
+
# pass through the modular pipeline:
|
| 98 |
+
pipe(..., denoiser_input_fields={"control_rows": control_rows, "control_context_scale": 1.0})
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
```
|
| 100 |
|
| 101 |
+
## Paths forward (not done here)
|
| 102 |
|
| 103 |
+
1. **Fine-tune the branch on the image model** — freeze the DiT, train the 10 control blocks +
|
| 104 |
+
`control_proj_in` on image/edge pairs. The zero-gated init means training starts from exact
|
| 105 |
+
base-model behavior. This is the route most likely to work well.
|
| 106 |
+
2. **Native (non-distilled) DiT at 30–40 steps** — the native `transformer/` checkpoint in
|
| 107 |
+
MiniMaxAI/MiniMax-H3-Image is closer to the branch's training trajectory, but its VideoX-Fun
|
| 108 |
+
key layout needs a remap before diffusers can load it.
|
| 109 |
+
3. **Video-VAE control latents** — the branch was trained on the 3D VAE's latents; feeding image
|
| 110 |
+
VAE latents may itself be off-distribution.
|
| 111 |
|
| 112 |
+
## Sources & license
|
| 113 |
|
| 114 |
+
- Base: https://huggingface.co/MiniMaxAI/MiniMax-H3-Image · ControlNet: https://huggingface.co/alibaba-pai/MiniMax-H3-Fun-Controlnet-Union-2.0 · Code: https://github.com/aigc-apps/VideoX-Fun
|
| 115 |
+
- Both under the MiniMax-H3 Community License (`LICENSE`, `LICENSE.controlnet`); the same terms apply to this unofficial community repackaging. Not endorsed by MiniMax or the VideoX-Fun authors.
|