Instructions to use WaveCut/MiniMax-H3-Image-Pruned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use WaveCut/MiniMax-H3-Image-Pruned with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("WaveCut/MiniMax-H3-Image-Pruned", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Card: measured one-model-at-a-time offload (72.2 s, 50.4 GiB peak) and memory modes
Browse files- README.md +27 -7
- assets/speed_memory_size.png +2 -2
README.md
CHANGED
|
@@ -61,6 +61,21 @@ name. Editing: pass `image=reference` (or a list) and refer to the images as `<P
|
|
| 61 |
prompt. The prompting guidance of the original card applies unchanged: long, complete English descriptions;
|
| 62 |
recommended sizes from 4096×4096 (1:1) to 6272×2688 (21:9).
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
The components also load alone with the stock classes: `MiniMaxH3ImageTransformer2DModel.from_pretrained(repo,
|
| 65 |
subfolder="transformer")` and `Qwen3VLForConditionalGeneration.from_pretrained(repo, subfolder="text_encoder")`.
|
| 66 |
|
|
@@ -95,15 +110,20 @@ warm-up image. Time includes prompt encoding, six steps and VAE decoding.
|
|
| 95 |
|
| 96 |
| Run | 2048×2048 | Edit, 2048×2048 | 4736×3552 | GPU memory peak, 4736×3552 |
|
| 97 |
|---|---|---|---|---|
|
| 98 |
-
| Original, model offload | 97.6 s | 101.6 s | 120.8 s | 68.2 GiB |
|
| 99 |
-
| Pruned, model
|
| 100 |
| Pruned, all on the GPU (`pipe.to("cuda")`) | 5.6 s | 9.3 s | 26.7 s | 92.7 GiB |
|
| 101 |
|
| 102 |
-
The
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
|
| 108 |
## Verification
|
| 109 |
|
|
|
|
| 61 |
prompt. The prompting guidance of the original card applies unchanged: long, complete English descriptions;
|
| 62 |
recommended sizes from 4096×4096 (1:1) to 6272×2688 (21:9).
|
| 63 |
|
| 64 |
+
### Memory modes
|
| 65 |
+
|
| 66 |
+
`enable_auto_cpu_offload` moves a model off the GPU only when the next one does not fit. On a 96 GB card the pruned
|
| 67 |
+
models fit together, so after the first image nothing moves and the run is as fast as with everything on the GPU
|
| 68 |
+
(peak 92.7 GiB). For the lowest peak, keep one model on the GPU at a time; set the strategy after loading, because
|
| 69 |
+
adding the components resets it to the default:
|
| 70 |
+
|
| 71 |
+
```python
|
| 72 |
+
pipe.load_components(dtype=torch.bfloat16)
|
| 73 |
+
manager.set_offload_strategy(lambda hooks, **kwargs: hooks) # move every other model off the GPU first
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
The peak is then 50-52 GiB, set by the text encoder (48.9 GiB of weights), and each image moves both models over
|
| 77 |
+
PCIe: about 72 s at 2048×2048 instead of 5.6 s (see Profiles).
|
| 78 |
+
|
| 79 |
The components also load alone with the stock classes: `MiniMaxH3ImageTransformer2DModel.from_pretrained(repo,
|
| 80 |
subfolder="transformer")` and `Qwen3VLForConditionalGeneration.from_pretrained(repo, subfolder="text_encoder")`.
|
| 81 |
|
|
|
|
| 110 |
|
| 111 |
| Run | 2048×2048 | Edit, 2048×2048 | 4736×3552 | GPU memory peak, 4736×3552 |
|
| 112 |
|---|---|---|---|---|
|
| 113 |
+
| Original, model offload (code of the original card) | 97.6 s | 101.6 s | 120.8 s | 68.2 GiB |
|
| 114 |
+
| Pruned, one model on the GPU at a time | 72.2 s | 76.0 s | 92.8 s | 50.4 GiB (edit: 51.7 GiB) |
|
| 115 |
| Pruned, all on the GPU (`pipe.to("cuda")`) | 5.6 s | 9.3 s | 26.7 s | 92.7 GiB |
|
| 116 |
|
| 117 |
+
The original does not fit a 96 GB card (124 GiB of transformer and text encoder), so the offload manager moves the
|
| 118 |
+
transformer and the text encoder for every image. With one model on the GPU at a time the pruned checkpoint does the
|
| 119 |
+
same, with 30 % less data to move. With everything on the GPU nothing moves; the stock auto offload (the code above)
|
| 120 |
+
measured the same on this card, 5.6 s / 9.4 s / 26.4 s with a 92.7 GiB peak. The sampling steps themselves cost the
|
| 121 |
+
same in all rows. GPUs with 80 GB or with 141 GB or more were not measured.
|
| 122 |
+
|
| 123 |
+
All rows ran on the same machine. With every model on the GPU (auto offload on this card included), the edit took
|
| 124 |
+
14-22 s instead of 9.3 s in three of five runs: the text encoder's pass over the reference image took 5-9 s instead of
|
| 125 |
+
under 1 s. The cause is not identified; the table shows the fast runs.
|
| 126 |
+
With one model on the GPU at a time the images are bit-identical to the all-on-GPU ones.
|
| 127 |
|
| 128 |
## Verification
|
| 129 |
|
assets/speed_memory_size.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|