> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/jp/moderu/minimax-h3-image.md).

# MiniMax-H3-Image：ローカル環境での実行方法

Unsloth FP8とGGUF量子化モデルを使って、MiniMax-H3-Imageによるテキストから画像への生成と画像編集を6ステップでローカル実行します。

**MiniMax-H3-Image** は、テキストからの画像生成と最大16枚の参照画像を使った編集に対応する、MiniMaxのオープンな33Bモデルです。長く、完成度の高いプロンプトを好みます。蒸留により **6ステップ、CFGなし**となっており、 **2048 × 2048** のキャンバスでは、FP8リポジトリを使うと画像1枚あたり約 **5秒** 、40 GBのA100でUD-Q4\_K\_XLを使うと画像1枚あたり **18秒** です。

{% columns %}
{% column width="50%" %}
量子化版では [Unsloth Dynamic](https://unsloth.ai/docs/basics/dynamic-3.0-ggufs)を使用し、重要なレイヤーを高精度に保ちます。これらは [Unsloth](https://unsloth.ai/docs/jp/desktop.md)、stable-diffusion.cppなどで実行できます。

* MiniMax-H3-Image： [GGUF](https://huggingface.co/unsloth/MiniMax-H3-Image-GGUF) • [FP8](https://huggingface.co/unsloth/MiniMax-H3-Image-FP8)
* オリジナルモデル： [MiniMaxAI/MiniMax-H3-Image](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image)

NVIDIA A100（40 GB）およびRTX PRO 6000（96 GB）上で、Unslothの開発ビルド（2026.11.4より新しいバージョン）を使ってテスト済みです。
{% endcolumn %}

{% column width="50%" %}

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FN17t739HDhs4Bs9VVAEL%2Fminimax-h3-image-out-bookshop.webp?alt=media" alt="Rainy bookshop window with an UNSLOTH BOOKS chalkboard and a sleeping cat"><figcaption><p>FP8リポジトリ（INT8）、2048 × 2048、A100で約5秒</p></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

<div><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FdhaLehHOWudDk9TmHJfW%2Fminimax-h3-image-out-valley.webp?alt=media" alt="Misty autumn valley with a wooden footbridge"><figcaption><p>FP8リポジトリ（INT8）</p></figcaption></figure> <figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FE5iZZZi5oMaVw4Jo3ViS%2Fminimax-h3-image-out-island.webp?alt=media" alt="Isometric floating island city"><figcaption><p>FP8リポジトリ（INT8）</p></figcaption></figure> <figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FQ8V3wLPL9YacqR4YD5LK%2Fminimax-h3-image-out-ramen.webp?alt=media" alt="Overhead photo of ramen"><figcaption><p>GGUF UD-Q4_K_XL</p></figcaption></figure></div>

### 必要なメモリ <a href="#memory-requirements" id="memory-requirements"></a>

32BのQwen3-VLテキストエンコーダー（MiniMax-H3由来）を使うため、大容量のGPUまたは十分なシステムRAMが必要です。

| 構成                           | 画像モデル                   | テキストエンコーダー                    | VAE    | 合計ダウンロード容量 |
| ---------------------------- | ----------------------- | ----------------------------- | ------ | ---------- |
| **FP8リポジトリ** （Unslothのデフォルト） | INT8-ConvRot、20.3 GB    | INT8 Qwen3-VL 32B、27.1 GB     | 2.3 GB | **約50 GB** |
| **GGUF UD-Q4\_K\_XL**        | 13.6 GB                 | Q4\_K\_M Qwen3-VL 32B、18.2 GB | 2.3 GB | **約34 GB** |
| **GGUF Q8\_0**               | 22.0 GB                 | Q4\_K\_M Qwen3-VL 32B、18.2 GB | 2.3 GB | **約43 GB** |
| プロンプト拡張（任意）                  | Qwen3.5-9B UD-Q4\_K\_XL |                               |        | **6.9 GB** |

| お使いのハードウェア                  | まずは                                                          |
| --------------------------- | ------------------------------------------------------------ |
| **80 GB以上のNVIDIA GPU**      | FP8リポジトリ。すべてGPU上で動作します。96 GBのRTX PRO 6000でテスト済み：ピーク使用量54 GB。 |
| **40 GBのNVIDIA GPU**        | FP8リポジトリ。RAM 83 GB搭載の40 GB A100でテスト済み：一部はRAMからストリーミングされます。   |
| **24 GBのNVIDIA GPU**        | GGUF **UD-Q4\_K\_XL**、またはシステムRAMが48 GB以上のFP8リポジトリ            |
| **16 GBのGPU**               | GGUF **UD-Q4\_K\_XL** または、それ以下でシステムRAMが48 GB以上               |
| **MacまたはCPUのみ、RAM 64 GB以上** | GGUF **UD-Q4\_K\_XL** （低速）                                   |

テスト済みなのは96 GBと40 GBの行のみで、それ以外は推定値です。24 GBでは、RAMに退避するQ8\_0よりUD-Q4\_K\_XLのほうが優れています。MacとCPUではGGUFのみ使用できます。

#### FP8、INT8、GGUF <a href="#fp8-int8-and-gguf" id="fp8-int8-and-gguf"></a>

FP8リポジトリには、INT8-ConvRotとFP8の20.3 GBのファイルが2つ含まれています。 **UnslothはデフォルトでINT8-ConvRotを読み込みます** （INT8テキストエンコーダー使用時）。これはbf16により近いためです（2048 × 2048でLPIPSは0.140。FP8は0.255）。選択メニューでは引き続き **Fast FP8**と表示されます。十分なメモリを搭載したGPUでは、GGUFより約3倍高速です。

GGUF量子化版： **Q8\_0** 22.03 GB（bf16に最も近い）、 **UD-Q6\_K\_XL** 17.58 GB、 **UD-Q4\_K\_XL** 13.61 GB（**推奨**), **UD-Q2\_K\_XL** 8.68 GB（メモリに余裕がない場合）。

#### ハードウェアに関する注意事項 <a href="#hardware-notes" id="hardware-notes"></a>

Unsloth 2026.11.5以降が必要です。

* **T4など、bf16に対応していないGPU：** FP8リポジトリ（INT8画像モデルとテキストエンコーダー）は、レンダリングと編集をfp16で行います。RAM 51 GBの15 GB Colab T4でテスト済み：ブロックはシステムRAMからストリーミングされ（使用量は約43～47 GB）、GPUメモリ使用量は最大約14 GBです。

  | タスク、6ステップ               | 画像あたりの時間 |
  | ----------------------- | -------- |
  | テキストから画像を生成、1024 x 1024 | 約28秒     |
  | テキストから画像を生成、2048 x 2048 | 約83秒     |
  | 編集、参照画像1枚、1024          | 2.5～3分   |

  LoRAは読み込み・レンダリングできますが、読み込み時にはモデル全体（66 GB）がストリーミングされます（T4では約12分）。 **順次** 配置には、空きシステムRAMが約52.4 GB必要です。それより少ない場合、Unslothは処理を拒否し、必要量と空き容量の両方を表示します。
* **Linux上のAMD** （Radeon 8060S、gfx1151）：LoRAトレーニングは **bf16** ベースモデル、再読み込み、LoRAを使った生成、エクスポートはすべて正常に動作します。

### クイックスタート <a href="#quickstart" id="quickstart"></a>

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FUySaKhMrEM4BEdibJvbp%2Fminimax-h3-image-flow.webp?alt=media" alt="Animation: pick MiniMax-H3-Image (Fast FP8), type a prompt, click Generate and get an alpine valley at sunrise" width="375"><figcaption><p>Unslothのワークフローを高速化</p></figcaption></figure>

{% stepper %}
{% step %}

#### Unslothをインストール <a href="#install-unsloth" id="install-unsloth"></a>

以下を入手： [Unsloth Desktopアプリ](https://unsloth.ai/docs/jp/desktop.md) （対応OS： [macOS](https://unsloth.ai/docs/jp/meru/install/mac.md), [Windows](https://unsloth.ai/docs/jp/meru/install/windows-installation.md) または [Linux](https://unsloth.ai/docs/jp/meru/install/linux.md).

<a href="https://unsloth.ai/download" class="button primary" data-icon="down-to-bracket">Unslothをダウンロード</a>

またはターミナルからインストールします。macOS、Linux、WSLの場合：

{% code collapsedlinecount="10" %}

```bash
curl -fsSL https://unsloth.ai/install.sh | sh
```

{% endcode %}

Windows PowerShellの場合：

{% code collapsedlinecount="10" %}

```powershell
irm https://unsloth.ai/install.ps1 | iex
```

{% endcode %}

次にUnslothを起動し、 `http://localhost:8888`:

{% code collapsedlinecount="10" %}

```bash
unsloth studio -H 0.0.0.0 -p 8888
```

{% endcode %}
{% endstep %}

{% step %}

#### 画像を開く <a href="#open-images" id="open-images"></a>

サイドバーで **Images** を選択します。 **Create** がデフォルトで開きます。

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FlQtHN8moCQiBVRksvUtk%2Fminimax-h3-image-images-page.png?alt=media" alt="The Unsloth Images page with the Create workflow open and no model loaded"><figcaption><p>Imagesページ</p></figcaption></figure>
{% endstep %}

{% step %}

#### MiniMax-H3-Imageを選択 <a href="#pick-minimax-h3-image" id="pick-minimax-h3-image"></a>

「 **画像モデルを選択**」をクリックし、 `MiniMax-H3-Image` を検索して、次のいずれかを選択します。

* **MiniMax-H3-Image (Fast FP8)**：FP8リポジトリ。24 GB以上のNVIDIA GPU向け。
* **MiniMax-H3-Image-GGUF (Slow)**：量子化版を選択します。 **UD-Q4\_K\_XL** がおすすめです。

<div><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FHhCLEoV6z1L4Db8ily2v%2Fminimax-h3-image-picker-search.png?alt=media" alt="Model picker search results for MiniMax-H3-Image with the Fast FP8 and GGUF entries"><figcaption><p>検索結果</p></figcaption></figure> <figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F3ZuWCPvHggmFB2WbdphS%2Fminimax-h3-image-gguf-quants.png?alt=media" alt="The GGUF entry expanded to show its quants, with UD-Q4_K_XL marked recommended"><figcaption><p>GGUF量子化版</p></figcaption></figure></div>

初回の読み込み時に、モデル、テキストエンコーダー、VAEがダウンロードされます。

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FqfYd6Ju8MCpA2vWphkeV%2Fminimax-h3-image-download.png?alt=media" alt="Download panel with the 27 GB INT8 text encoder" width="400"><figcaption><p>FP8リポジトリの初回ダウンロード</p></figcaption></figure>
{% endstep %}

{% step %}

#### プロンプトを入力 <a href="#write-your-prompt" id="write-your-prompt"></a>

画像全体を説明します。Unslothでは **6ステップ** （固定：モデルは6ステップ専用に蒸留されています）、 **ガイダンス1** 、 **2048 × 2048**.

**プロンプトを強化** （デフォルトでオン。MiniMaxのリファレンスワークフロー）では、Qwen3.5-9Bモデルがプロンプトを書き換えます。これは独立した **6.9 GB** ダウンロードが必要で、時間もかかります。約 **3.5分** A100では画像1枚あたり追加でかかります。手早く試す場合はオフにしてください。

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FBJhHYOSYImp8McKcvGjM%2Fminimax-h3-image-enhancer.png?alt=media" alt="Enhance prompt switch with its 6.9 GB download button" width="350"><figcaption><p>ダウンロード前にプロンプトを強化</p></figcaption></figure>
{% endstep %}

{% step %}

#### 生成 <a href="#generate" id="generate"></a>

クリックして **生成**. **レシピ** すべての設定、精度、強化後のプロンプトが表示されます。

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fmqa9vZ88KIaOFN27Gl5n%2Fminimax-h3-image-result-lossless.webp?alt=media" alt="Ginger cat asleep on books in a rainy bookshop window"><figcaption><p>FP8リポジトリ（INT8）、短いプロンプト、エンハンサーオン、シード42</p></figcaption></figure>

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FwwUefNK5OGmbIuwl2tfE%2Fminimax-h3-image-recipe-lossless.webp?alt=media" alt="Recipe card with the enhanced prompt, INT8 precision, 6 steps and seed 42"><figcaption><p>レシピカード</p></figcaption></figure>
{% endstep %}
{% endstepper %}

### 画像編集 <a href="#image-editing" id="image-editing"></a>

選択 **編集**、アップロード **画像1**、さらに **画像を追加** （最大16枚）します。名前は `<Picture 1>`, `<Picture 2>` のように付け、何を残して何を変更するかを指示します。出力は2048キャンバス上で画像1の形状に従います。以下の例では **出力サイズ** **カスタム** `1024 × 1024`を使用し、シードは7、エンハンサーはオフです。FP8リポジトリではRTX PRO 6000で1枚あたり3～4秒です。エンハンサーを使うと、A100での編集には約9分かかりました。

{% hint style="info" %}
生成時と同じシードとサイズで画像を編集しないでください。編集がその画像自体のノイズから始まり、指示を無視して過度にシャープな出力になります。シードを変更するか、ランダムのままにしてください。
{% endhint %}

**画像1枚：** 「\<Picture 1>を編集。場面を雪の降る冬の朝に変えてください。橋、川、山はそのままにしてください。」

<div><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FdYqwblQlu0tXyHWZR02d%2Fminimax-h3-image-edit1.png?alt=media" alt="Edit with the autumn valley as Picture 1 and the snowy result"><figcaption><p>画像1枚</p></figcaption></figure> <figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FCG9GfRXXtmBhCMLt7ko6%2Fminimax-h3-image-edit-winter.webp?alt=media" alt="The same valley, bridge and river on a snowy winter morning"><figcaption><p>結果</p></figcaption></figure></div>

**画像2枚：** 「\<Picture 1>の谷の上空に、\<Picture 2>の熱気球を配置してください。橋、木々、川、光の具合はそのままにしてください。」

<div><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FJ0iVCIJ1aDg9ibKSM9nY%2Fminimax-h3-image-edit2.png?alt=media" alt="Edit with the valley and a balloon as Pictures 1 and 2"><figcaption><p>画像2枚</p></figcaption></figure> <figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FnyY7SUigpABhfJK6q40y%2Fminimax-h3-image-edit-balloon.webp?alt=media" alt="The valley from Picture 1 with the hot-air balloon from Picture 2 in the sky"><figcaption><p>結果</p></figcaption></figure></div>

### LoRAを学習する <a href="#train-a-lora" id="train-a-lora"></a>

参照： [MiniMax-H3-Imageをファインチューニングする](https://unsloth.ai/docs/jp/moderu/minimax-h3-image/fine-tune-minimax-h3-image.md)

#### 変更前と変更後 <a href="#before-and-after" id="before-and-after"></a>

シード42、1024 × 1024、エンハンサーオフ： `a trtcrd of a cat sitting on a throne holding a golden cup, "queen of cats"` および `a trtcrd of an astronaut standing on the moon holding a lantern, "the explorer"`.

<div><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fkg53StPeOhBWosYeBEkn%2Fminimax-h3-image-lora-cat-before.webp?alt=media" alt="Without the LoRA: photo-like cat on a throne"><figcaption><p>LoRAなし</p></figcaption></figure> <figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F5idj4QIy1DMxo4QWxs88%2Fminimax-h3-image-lora-cat-w06.webp?alt=media" alt="LoRA weight 0.6: illustrated cat"><figcaption><p>重み0.6</p></figcaption></figure> <figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FoD4Irr8nLFeWdVOvHUMT%2Fminimax-h3-image-lora-cat-after.webp?alt=media" alt="LoRA weight 1.0: tarot card style cat"><figcaption><p>重み1.0</p></figcaption></figure></div>

<div><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FjEaC0aZLy24V1JEzLzdH%2Fminimax-h3-image-lora-astronaut-before.webp?alt=media" alt="Without the LoRA: astronaut photo"><figcaption><p>LoRAなし</p></figcaption></figure> <figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F7KTnboVty4ipiJY5X4OH%2Fminimax-h3-image-lora-astronaut-after.webp?alt=media" alt="LoRA weight 1.0: tarot card style astronaut"><figcaption><p>重み1.0</p></figcaption></figure></div>

* 重み **1.0** でスタイルが最大限に反映されます。 **0.6～0.8** では、より控えめになります。
* トリガーワードがなくても、LoRAによってプロンプトがわずかに変化します。ほかの作業では、重みを下げるか、LoRAを読み込まずに使用してください。
* スタイルは1024 × 1024（学習時のサイズ）で最も強く表れ、2048 × 2048では弱まります。

[ファインチューニングガイドに進む](https://unsloth.ai/docs/jp/moderu/minimax-h3-image/fine-tune-minimax-h3-image.md#before-and-after)

### コードから実行する <a href="#run-from-code" id="run-from-code"></a>

#### Unsloth API <a href="#unsloth-api" id="unsloth-api"></a>

Imagesページでモデルを読み込んでから、OpenAI互換の `POST /v1/images/generations` エンドポイントを呼び出します（ `model` で読み込む場合は、代わりに **リクエストごとに画像モデルと動画モデルを切り替える** を **Settings → API**でオンにします）。ここでAPIキーを作成し（[Unsloth API](https://unsloth.ai/docs/jp/ji-chu/api.md)）、サンプルでは次の値を読み込みます `UNSLOTH_API_KEY`.

を `openai` (`pip install openai`):

{% code collapsedlinecount="10" %}

```python
import base64
import os

from openai import OpenAI

client = OpenAI(base_url="http://localhost:8888/v1", api_key=os.environ["UNSLOTH_API_KEY"])

result = client.images.generate(
    model="unsloth/MiniMax-H3-Image-FP8",
    prompt="A misty mountain valley at sunrise with a wooden footbridge over a calm river, autumn trees in red, orange and gold on both banks, and soft golden light breaking through the mist. Detailed landscape photograph.",
    size="2048x2048",
    response_format="b64_json",
    extra_body={"steps": 6, "guidance": 1.0, "seed": 42},
)

with open("valley.png", "wb") as f:
    f.write(base64.b64decode(result.data[0].b64_json))
```

{% endcode %}

を `curl`:

{% code collapsedlinecount="10" %}

```bash
curl -s http://localhost:8888/v1/images/generations \
  -H "Authorization: Bearer $UNSLOTH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "unsloth/MiniMax-H3-Image-FP8",
    "prompt": "Isometric 3D illustration of a tiny floating island city with pastel houses and terracotta roofs, a waterfall pouring off the edge into soft clouds, and small hot-air balloons drifting around it. Clean lines, soft shadows, calm pastel palette.",
    "size": "2048x2048",
    "response_format": "b64_json",
    "seed": 7
  }' \
  | python3 -c "import sys, json, base64; open('island.png', 'wb').write(base64.b64decode(json.load(sys.stdin)['data'][0]['b64_json']))"
```

{% endcode %}

`size` は `WIDTHxHEIGHT` （16の倍数）で指定します。 `steps` および `guidance` デフォルト値はそれぞれ6と1です。APIはエンハンサーを実行しません。画像1枚あたり、RTX PRO 6000では約3秒、A100では約5秒です。

**API経由でLoRAを使用する** （Unsloth 2026.11.5以降）：リクエストでは、読み込み時にマージされたLoRAが使用されます。たとえば、次の操作を行った後です。 **Createにデプロイ**。異なる `loras` リストを指定したリクエストは拒否されます。変更するには再読み込みしてください。

#### stable-diffusion.cppでGGUFを実行する <a href="#gguf-with-stable-diffusion.cpp" id="gguf-with-stable-diffusion.cpp"></a>

GGUFは `sd-cli` を使って、 [stable-diffusion.cpp](https://github.com/unslothai/stable-diffusion.cpp) （Unslothが固定したリリース）から実行します。

**1.  `sd-cli`** （Linux、CUDA 13）を入手します。 [リリースページ](https://github.com/unslothai/stable-diffusion.cpp/releases/tag/master-982-0518b34-u27b9ddc) には、CUDA 12、Vulkan、CPU、macOS、Windows向けのビルドもあります。

{% code collapsedlinecount="10" %}

```bash
curl -L -o sd.zip https://github.com/unslothai/stable-diffusion.cpp/releases/download/master-982-0518b34-u27b9ddc/sd-master-982-0518b34-u27b9ddc-bin-Linux-Ubuntu-22.04-x86_64-cuda13.zip
unzip -o sd.zip
mv sd-master-982-0518b34-u27b9ddc-bin-Linux-Ubuntu-22.04-x86_64-cuda13 sd
./sd/sd-cli --version
```

{% endcode %}

**2. モデル、テキストエンコーダー、VAEをダウンロードします** （約34 GB）：

{% code collapsedlinecount="10" %}

```bash
pip install -U huggingface_hub
hf download unsloth/MiniMax-H3-Image-GGUF minimax_h3_image_pruned-UD-Q4_K_XL.gguf --local-dir models
hf download unsloth/MiniMax-H3-GGUF qwen3vl_32b_minimax_h3-Q4_K_M.gguf --local-dir models
hf download MiniMaxAI/MiniMax-H3-Image vae/diffusion_pytorch_model.safetensors --local-dir models
```

{% endcode %}

**3. 画像を生成します。** `--offload-to-cpu` を指定すると、重みはRAMに保持され、必要に応じて各部分がGPUに移されます（VRAM使用量のピークは19.4 GB、RAM使用量は39 GB）。

{% code collapsedlinecount="10" %}

```bash
./sd/sd-cli \
  --diffusion-model models/minimax_h3_image_pruned-UD-Q4_K_XL.gguf \
  --llm models/qwen3vl_32b_minimax_h3-Q4_K_M.gguf \
  --vae models/vae/diffusion_pytorch_model.safetensors \
  -p "A misty mountain valley at sunrise with a wooden footbridge over a calm river, autumn trees in red, orange and gold on both banks, and soft golden light breaking through the mist. Detailed landscape photograph." \
  --steps 6 --cfg-scale 1.0 --sampling-method euler --sigmas minimax-h3-image --rng cpu \
  --offload-to-cpu \
  -W 2048 -H 2048 --seed 42 \
  -o valley-sdcpp.png
```

{% endcode %}

40 GBのA100では103秒、RTX PRO 6000では12秒です。

**4. 画像を編集します。** 各 `-r` は、次の `<Picture N>`; `sd-cli` それらを次のサイズに切り抜きます `-W` × `-H`。Picture 1 と同じ形にするための指定です。ビジョンファイルは不要です。RTX PRO 6000 で16秒と20秒です。

{% code collapsedlinecount="10" %}

```bash
./sd/sd-cli \
  --diffusion-model models/minimax_h3_image_pruned-UD-Q4_K_XL.gguf \
  --llm models/qwen3vl_32b_minimax_h3-Q4_K_M.gguf \
  --vae models/vae/diffusion_pytorch_model.safetensors \
  -r valley-sdcpp.png \
  -p "<Picture 1> を編集します。シーンを雪の降る冬の朝に変えてください。橋、川、山はそのままにしてください。" \
  --steps 6 --cfg-scale 1.0 --sampling-method euler --sigmas minimax-h3-image --rng cpu \
  --offload-to-cpu \
  -W 1024 -H 1024 --seed 42 \
  -o valley-sdcpp-winter.png
```

{% endcode %}

2枚の画像（`balloon.png` は気球の写真です）：

{% code collapsedlinecount="10" %}

```bash
./sd/sd-cli \
  --diffusion-model models/minimax_h3_image_pruned-UD-Q4_K_XL.gguf \
  --llm models/qwen3vl_32b_minimax_h3-Q4_K_M.gguf \
  --vae models/vae/diffusion_pytorch_model.safetensors \
  -r valley-sdcpp.png -r balloon.png \
  -p "<Picture 2> の熱気球を、<Picture 1> の谷の上空に配置してください。橋、木々、川、光の具合はそのままにしてください。" \
  --steps 6 --cfg-scale 1.0 --sampling-method euler --sigmas minimax-h3-image --rng cpu \
  --offload-to-cpu \
  -W 1024 -H 1024 --seed 42 \
  -o valley-sdcpp-balloon.png
```

{% endcode %}

Mac または CPU では、アプリ内の GGUF、または `Darwin-macOS-arm64` / CPU `sd-cli` ビルドを使用してください。画像モデルに加えて、18.2 GB のテキストエンコーダーを格納できる RAM が必要です（こちらではテストしていません）。

### 推奨設定 <a href="#recommended-settings" id="recommended-settings"></a>

| 設定項目               | Unsloth（FP8 または GGUF）                                | stable-diffusion.cpp                                          |
| ------------------ | ---------------------------------------------------- | ------------------------------------------------------------- |
| **ステップ数**          | **6** （固定）                                           | `--steps 6`                                                   |
| **ガイダンス / CFG**    | **1**                                                | `--cfg-scale 1.0`                                             |
| **サンプラー / スケジュール** | Unsloth によって設定                                       | `--sampling-method euler --sigmas minimax-h3-image --rng cpu` |
| **ネガティブプロンプト**     | 空欄のままにする                                             | 空欄のままにする                                                      |
| **サイズ**            | `2048×2048` から始めます（ **モデルサイズ** 一覧には、ほかのサイズも記載されています） | `-W 2048 -H 2048`                                             |
| **シード**            | 結果を再現するには、任意の数値を指定                                   | `--seed 42`                                                   |

約4 MP以上で最良の結果が得られます。 **モデルサイズ** 一覧には、次のようなネイティブサイズが記載されています： `2368×1760` （4:3）や `2720×1536` （16:9）のほか、次のような16 MPサイズもあります： `4096×4096` （メモリと時間が約4倍）。

### トラブルシューティング <a href="#troubleshooting" id="troubleshooting"></a>

<details>

<summary>モデル選択リストにMiniMax-H3-Imageが表示されない</summary>

[Unslothを更新して](https://unsloth.ai/docs/get-started/install/updating) 再起動してください。モデルが読み込まれている場合、選択リストは **On Device**で開きます。 **Recommended**。MacとCPUではGGUFのみが表示されます。

</details>

<details>

<summary>生成に数分かかる</summary>

「 **プロンプトを強化** 」をオフにしてください。GGUFはNVIDIAではFP8リポジトリより約3倍遅くなります。

</details>

<details>

<summary>APIで指定したモデルが無視される</summary>

ImagesページでMiniMax-H3-Imageを読み込むか、 **リクエストに応じて画像モデルと動画モデルを切り替える** を **Settings → API**.

</details>

<details>

<summary>sd-cliでlibcudart.so.12またはlibcudart.so.13が見つからないというエラーが表示される</summary>

CUDA 13対応の `cuda13` ZIP、CUDA 12対応の `cuda12` ZIP、またはVulkanビルドを使用してください。

</details>

関連項目 [画像拡散モデルをローカルで実行する方法](https://unsloth.ai/docs/jp/ji-chu/diffusion-image.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://unsloth.ai/docs/jp/moderu/minimax-h3-image.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
