Upload README.md
Browse files
README.md
CHANGED
|
@@ -2,4 +2,120 @@
|
|
| 2 |
license: other
|
| 3 |
license_name: minimax-h3-image-community-license-agreement
|
| 4 |
license_link: https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/LICENSE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: other
|
| 3 |
license_name: minimax-h3-image-community-license-agreement
|
| 4 |
license_link: https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/LICENSE
|
| 5 |
+
pipeline_tag: text-to-image
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
base_model:
|
| 9 |
+
- MiniMaxAI/MiniMax-H3-Image
|
| 10 |
+
- MiniMaxAI/MiniMax-H3
|
| 11 |
+
- Comfy-Org/MiniMax-H3-Image
|
| 12 |
+
base_model_relation: quantized
|
| 13 |
+
tags:
|
| 14 |
+
- comfyui
|
| 15 |
+
- minimax-h3
|
| 16 |
+
- minimax-h3-image
|
| 17 |
+
- text-encoder
|
| 18 |
+
- qwen3-vl
|
| 19 |
+
- qwen3.5
|
| 20 |
+
- quantized
|
| 21 |
+
- int4
|
| 22 |
+
- convrot
|
| 23 |
+
- 4-bit
|
| 24 |
+
- comfy-kitchen
|
| 25 |
+
- text-to-image
|
| 26 |
+
- image-editing
|
| 27 |
---
|
| 28 |
+
|
| 29 |
+
<div align="center">
|
| 30 |
+
<img width="100%" src="cover.jpg" alt="MiniMax H3 image - Text Encoder Β· INT4 ConvRot">
|
| 31 |
+
</div>
|
| 32 |
+
|
| 33 |
+
<h1 align="center">MiniMax-H3-Image β Text Encoder (INT4 ConvRot)</h1>
|
| 34 |
+
|
| 35 |
+
<p align="center">
|
| 36 |
+
<strong>Ultra-compact 4-bit ConvRot text encoder & prompt enhancer weights for ComfyUI</strong>
|
| 37 |
+
</p>
|
| 38 |
+
|
| 39 |
+
<p align="center">
|
| 40 |
+
<a href="https://huggingface.co/MiniMaxAI/MiniMax-H3-Image"><img src="https://img.shields.io/badge/Base%20Model-MiniMax--H3--Image-FF6C37" alt="Base Model"></a>
|
| 41 |
+
<a href="https://github.com/Comfy-Org/ComfyUI"><img src="https://img.shields.io/badge/ComfyUI-Single%20File-007ACC" alt="ComfyUI"></a>
|
| 42 |
+
<img src="https://img.shields.io/badge/Quantization-INT4%20ConvRot%20(W4A4)-6F42C1" alt="Quantization">
|
| 43 |
+
<img src="https://img.shields.io/badge/VRAM%20Peak-13.25%20GiB-2EA44F" alt="VRAM Peak">
|
| 44 |
+
<a href="https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MiniMax%20H3%20Community-4CAF50" alt="License"></a>
|
| 45 |
+
</p>
|
| 46 |
+
|
| 47 |
+
---
|
| 48 |
+
|
| 49 |
+
## Overview
|
| 50 |
+
|
| 51 |
+
Ultra-compact **INT4 ConvRot** single-file `.safetensors` weights for **[MiniMax-H3-Image](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image)** in **ComfyUI**. Built to minimize download size and GPU memory footprint while keeping native **`comfy_kitchen`** compatibility β shrinking the 32B text encoder to **13.30 GB** (`-51.0%` vs `int8_convrot`, `-15.2%` vs `nvfp4_awq`, and `-80%` vs the 66.7 GB BF16 original).
|
| 52 |
+
|
| 53 |
+
---
|
| 54 |
+
|
| 55 |
+
## Files & Comparison
|
| 56 |
+
|
| 57 |
+
| File | Role | Precision / Format | Size | vs Comfy-Org Baseline |
|
| 58 |
+
| :--- | :--- | :--- | :---: | :--- |
|
| 59 |
+
| **`qwen3vl_32b_minimax_h3_int4_convrot.safetensors`** | **Main Text Encoder** (`Qwen3-VL-32B`, 50 layers) | `convrot_w4a4` + `nvfp4` / `int8` / `bf16` | **13.30 GB** (`12.39 GiB`) | **`-51.0%`** vs `int8_convrot` (`27.14 GB`)<br>**`-15.2%`** vs `nvfp4_awq` (`15.69 GB`) |
|
| 60 |
+
| **`qwen3.5_9b_int4_convrot.safetensors`** | **Prompt Enhancer** (`Qwen3.5-9B`, optional) | `convrot_w4a4` + `int8` / `bf16` | **5.42 GB** (`5.05 GiB`) | **`-26.2%`** vs `qwen3.5_9b_w4a8_gptq` (`7.34 GB`) |
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
## ComfyUI Usage
|
| 65 |
+
|
| 66 |
+
### 1. Installation
|
| 67 |
+
|
| 68 |
+
Download the desired `.safetensors` file(s) and place them inside `ComfyUI/models/text_encoders/`:
|
| 69 |
+
|
| 70 |
+
```text
|
| 71 |
+
π ComfyUI/
|
| 72 |
+
βββ π models/
|
| 73 |
+
βββ π text_encoders/
|
| 74 |
+
βββ qwen3vl_32b_minimax_h3_int4_convrot.safetensors # Main Text Encoder (required)
|
| 75 |
+
βββ qwen3.5_9b_int4_convrot.safetensors # Prompt Enhancer (optional)
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
### 2. Workflow Setup
|
| 79 |
+
|
| 80 |
+
1. **Text Encoder:** In **CLIPLoader**, select `qwen3vl_32b_minimax_h3_int4_convrot.safetensors` with **`type = minimax`** and connect it to **MiniMaxH3ImageConditioning**.
|
| 81 |
+
2. **Prompt Enhancer *(optional)*:** In **CLIPLoader**, select `qwen3.5_9b_int4_convrot.safetensors` with **`type = minimax`** and connect it to **Generate Text** (`TextGenerateV2`).
|
| 82 |
+
3. **Templates:** Works as a direct drop-in replacement inside ComfyUI's official MiniMax-H3-Image [Text-to-Image](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/image_minimax_h3_image_t2i.json) and [Image Edit](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/image_minimax_h3_image_edit.json) workflows.
|
| 83 |
+
|
| 84 |
+
> **Requirements:** Up-to-date **ComfyUI** with **`comfy_kitchen`** kernels supporting `convrot_w4a4` and `nvfp4` on CUDA GPUs.
|
| 85 |
+
|
| 86 |
+
---
|
| 87 |
+
|
| 88 |
+
## Quantization Details & Benchmarks
|
| 89 |
+
|
| 90 |
+
### `qwen3vl_32b_minimax_h3_int4_convrot.safetensors` (`727` tensors)
|
| 91 |
+
|
| 92 |
+
Formatted to MiniMax-H3-Image's exact 50-layer extraction spec (`minimax_h3_te: {"num_hidden_layers": 50, "output": "unnormalized_hidden_after_layer_50"}`):
|
| 93 |
+
|
| 94 |
+
- **LM & Merger Linears (`358` layers):** `convrot_w4a4` (`convrot_groupsize=256`, `quant_group_size=64`).
|
| 95 |
+
- **Vision Projections (`81` layers):** `convrot_w4a4` (`convrot_groupsize=64`).
|
| 96 |
+
- **Vision MLP Down (`fc2`, `27` layers):** `nvfp4` fallback (`K = 4304` is not divisible by `64` for `convrot_w4a4`).
|
| 97 |
+
- **Embeddings & Sensitive Layers:** `embed_tokens` in ConvRot `int8_tensorwise` (`gs=256`); RMSNorms, vision biases, `patch_embed`, and `pos_embed` preserved in `BF16`.
|
| 98 |
+
|
| 99 |
+
> **Why viewers show `I8` on 4-bit layers:** Safetensors has no native `int4` tensor dtype, so two 4-bit weights are packed per byte in `I8` (`int8`) containers. ComfyUI reads actual 4-bit precision and scales from each layer's `.comfy_quant` and `.weight_scale` tensors.
|
| 100 |
+
|
| 101 |
+
### Verified Benchmark (vs `int8_convrot` on RTX 4060 Ti 16 GB)
|
| 102 |
+
|
| 103 |
+
| Metric | `int8_convrot` (`27.14 GB`) | `int4_convrot` (`13.30 GB`) |
|
| 104 |
+
| :--- | :---: | :---: |
|
| 105 |
+
| **VRAM Peak (Multimodal)** | `14.04 GiB` | **`13.25 GiB`** (`13.20 GiB` text-only) |
|
| 106 |
+
| **Encode Latency (Text / MM)** | `23.74 s` / `2.89 s` | **`15.82 s` / `2.14 s`** |
|
| 107 |
+
| **50L Text-Only Cosine Sim** | `1.000` (baseline) | **`0.9981`** (`rel_err = 0.0641`) |
|
| 108 |
+
| **50L Multimodal Cosine Sim** | `1.000` (baseline) | `0.3600` |
|
| 109 |
+
|
| 110 |
+
> *Usage note:* **Text-to-Image** prompts track the INT8 baseline closely (`0.9981` cosine similarity) at under half the disk size. For **multi-reference Image Editing** requiring maximum vision-encoder accuracy, consider a higher-precision variant (`nvfp4_awq` / `w4a8` / `int8_convrot`).
|
| 111 |
+
|
| 112 |
+
### `qwen3.5_9b_int4_convrot.safetensors` (`1,511` tensors)
|
| 113 |
+
|
| 114 |
+
Quantized 32-layer **Qwen3.5-9B** multimodal prompt enhancer (`5.42 GB`) using `convrot_w4a4` across language-model, `lm_head`, and compatible vision projections (`gs=256` / `gs=64`), ConvRot `int8_tensorwise` on `embed_tokens` and ViT `mlp.linear_fc2`, and `BF16` norms/biases.
|
| 115 |
+
|
| 116 |
+
---
|
| 117 |
+
|
| 118 |
+
## License & Credits
|
| 119 |
+
|
| 120 |
+
- **License:** Governed by the **[MiniMax H3 Image Community License Agreement](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/LICENSE)**. Commercial use exceeding 1 Million USD in annualized revenue or providing hosted services to third parties requires separate written authorization via [platform.minimax.io/license](https://platform.minimax.io/license).
|
| 121 |
+
- **Upstream Repositories:** [MiniMaxAI/MiniMax-H3-Image](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image) Β· [MiniMaxAI/MiniMax-H3](https://huggingface.co/MiniMaxAI/MiniMax-H3) Β· [Comfy-Org/MiniMax-H3-Image](https://huggingface.co/Comfy-Org/MiniMax-H3-Image)
|