---
title: MiniMax-H3-Image-TrainingAdapter
canonical_url: "https://www.modelscope.cn/models/DiffSynth-Studio/MiniMax-H3-Image-TrainingAdapter"
md_url: "https://www.modelscope.cn/models/DiffSynth-Studio/MiniMax-H3-Image-TrainingAdapter.md"
repository: DiffSynth-Studio/MiniMax-H3-Image-TrainingAdapter
chinese_name: MiniMax-H3-Image-TrainingAdapter
last_updated: 2026-11-19
pipeline_tag: text-to-image-synthesis
tasks:
  - text-to-image-synthesis
base_model:
  - MiniMax/MiniMax-H3-Image
base_model_relation: adapter
parameters: 620.2M
tensor_type:
  - BF16
library_name:
  - safetensors
  - pytorch
frameworks:
  - PyTorch
downloads: 72
stars: 1
---

# MiniMax-H3-Image-TrainingAdapter

> MiniMax-H3-Image-TrainingAdapter - DiffSynth-Studio 在 ModelScope 开源的模型。MiniMax-H3-Image DeCFG Training Adapter

DiffSynth-Studio/MiniMax-H3-Image-TrainingAdapter 是 ModelScope 魔搭社区上的 620.2M 参数text-to-image-synthesis模型，基于 MiniMax/MiniMax-H3-Image 构建。

- **Repository**: DiffSynth-Studio/MiniMax-H3-Image-TrainingAdapter
- **Tasks**: text-to-image-synthesis
- **Parameters**: 620.2M
- **Base model**: MiniMax/MiniMax-H3-Image
- **Downloads**: 72
- **Stars**: 1
- **Last updated**: 2026-11-19

Source: https://www.modelscope.cn/models/DiffSynth-Studio/MiniMax-H3-Image-TrainingAdapter

---

# MiniMax-H3-Image DeCFG Training Adapter

## Introduction

This repository provides a LoRA training adapter for [MiniMax-H3-Image](https://www.modelscope.cn/models/MiniMax/MiniMax-H3-Image). The base MiniMax-H3-Image model is guidance-distilled: it samples in six steps without classifier-free guidance, which can make direct LoRA fine-tuning unstable or degrade the distilled CFG-free behavior. This adapter temporarily pulls the distilled DiT back toward its pre-distillation behavior during training, providing a better optimization landscape for new LoRAs.

## Model File

- `model.safetensors`: adapter weights, for the official MiniMax-H3-Image DiT.
- `model_for_comfy_dit.safetensors`: format converted adapter weights, for the ComfyUI-layout DiT (e.g. the `Comfy-Org/MiniMax-H3-Image` checkpoints).
- `step-3000.safetensors`: the step-3000 checkpoint of the same training run, in the same native layout as `model.safetensors`.

The `*_for_comfy_dit` file differs from its counterpart only in the row order of the `qkv_proj` `lora_B` tensors: the official attention reads qkv as `[head][role][dim]` while the ComfyUI layout reads it as `[role][head][dim]`. Every other tensor is byte-identical. Load the variant that matches your DiT layout.

## Usage

### How to Load

1. Download the adapter from ModelScope:

```bash
modelscope download --model DiffSynth-Studio/MiniMax-H3-Image-TrainingAdapter --local_dir ./models/DiffSynth-Studio/MiniMax-H3-Image-TrainingAdapter
```

2. Add the following arguments to the second stage (`--task "sft:train"`) of your MiniMax-H3-Image LoRA training command in DiffSynth-Studio:

```bash
--preset_lora_path ./models/DiffSynth-Studio/MiniMax-H3-Image-TrainingAdapter/model.safetensors \
--preset_lora_model dit
```

For a ComfyUI-layout DiT, use the converted variant instead:

```bash
--preset_lora_path ./models/DiffSynth-Studio/MiniMax-H3-Image-TrainingAdapter/model_for_comfy_dit.safetensors \
--preset_lora_model dit
```

This injects the adapter into the DiT during training. After your new LoRA is trained, **discard this adapter and keep only the newly trained LoRA** for inference. A complete training script is shown below.

### Complete Training Script Example

```bash
# 1. Download this adapter
modelscope download --model DiffSynth-Studio/MiniMax-H3-Image-TrainingAdapter --local_dir ./models/DiffSynth-Studio/MiniMax-H3-Image-TrainingAdapter

# 2. Stage 1: cache the prompt embeddings and VAE latents
accelerate launch examples/minimax_h3_image/model_training/train.py \
  --dataset_base_path "" \
  --dataset_metadata_path <path_to_your_dataset>.jsonl \
  --data_file_keys "image" \
  --max_pixels 16777216 \
  --min_pixels 4194304 \
  --dataset_repeat 1 \
  --model_id_with_origin_paths "MiniMax/MiniMax-H3:FL2VA/text_encoder/model*.safetensors,MiniMax/MiniMax-H3-Image:transformer/model*.safetensors,MiniMax/MiniMax-H3-Image:pdd_fused_heads.safetensors,MiniMax/MiniMax-H3-Image:vae/diffusion_pytorch_model.safetensors" \
  --learning_rate 1e-4 \
  --num_epochs 1 \
  --remove_prefix_in_ckpt "pipe.dit." \
  --output_path "./models/train/my_lora_cache" \
  --lora_base_model "dit" \
  --lora_target_modules "attn.qkv_proj,attn.out_proj,mlp.fc1,mlp.fc2" \
  --lora_rank 32 \
  --use_gradient_checkpointing \
  --task "sft:data_process" \
  --offload_models "MiniMax/MiniMax-H3-Image:transformer/model*.safetensors,MiniMax/MiniMax-H3-Image:pdd_fused_heads.safetensors"

# 3. Stage 2: train your LoRA (with the adapter loaded)
accelerate launch examples/minimax_h3_image/model_training/train.py \
  --dataset_base_path "./models/train/my_lora_cache" \
  --data_file_keys "image" \
  --max_pixels 16777216 \
  --min_pixels 4194304 \
  --dataset_repeat 50 \
  --model_id_with_origin_paths "MiniMax/MiniMax-H3:FL2VA/text_encoder/model*.safetensors,MiniMax/MiniMax-H3-Image:transformer/model*.safetensors,MiniMax/MiniMax-H3-Image:pdd_fused_heads.safetensors,MiniMax/MiniMax-H3-Image:vae/diffusion_pytorch_model.safetensors" \
  --learning_rate 1e-4 \
  --num_epochs 20 \
  --remove_prefix_in_ckpt "pipe.dit." \
  --output_path "./models/train/my_lora" \
  --lora_base_model "dit" \
  --lora_target_modules "attn.qkv_proj,attn.out_proj,mlp.fc1,mlp.fc2" \
  --lora_rank 32 \
  --use_gradient_checkpointing \
  --task "sft:train" \
  --offload_models "MiniMax/MiniMax-H3:FL2VA/text_encoder/model*.safetensors,MiniMax/MiniMax-H3-Image:vae/diffusion_pytorch_model.safetensors" \
  --preset_lora_path "./models/DiffSynth-Studio/MiniMax-H3-Image-TrainingAdapter/model.safetensors" \
  --preset_lora_model "dit"
```

### Inference

This adapter is for training only and should not be loaded during inference.

## Training Adapter Details

- Resolution: up to about 4 megapixels per sample (`--max_pixels 4194304`)
- LoRA rank: `128`, injected into all 50 DiT blocks and the 2 token-refiner blocks (`attn.qkv_proj,attn.out_proj,mlp.fc1,mlp.fc2`)
- Learning rate: `1e-4`
- Training data: about **40,000 self-generated samples** from [MiniMax-H3-Image-Self-Generated-Dataset](https://www.modelscope.cn/datasets/DiffSynth-Studio/MiniMax-H3-Image-Self-Generated-Dataset)
- Released checkpoint: **step-5000** (`model.safetensors`); `step-3000.safetensors` is the step-3000 version of the same run

Training command example (two-stage):

```bash
# Stage 1: cache the prompt embeddings and VAE latents
accelerate launch examples/minimax_h3_image/model_training/train.py \
  --dataset_base_path "" \
  --dataset_metadata_path <path_to_your_dataset>.jsonl \
  --data_file_keys "image" \
  --max_pixels 4194304 \
  --dataset_repeat 1 \
  --model_id_with_origin_paths "MiniMax/MiniMax-H3:FL2VA/text_encoder/model*.safetensors,MiniMax/MiniMax-H3-Image:transformer/model*.safetensors,MiniMax/MiniMax-H3-Image:pdd_fused_heads.safetensors,MiniMax/MiniMax-H3-Image:vae/diffusion_pytorch_model.safetensors" \
  --learning_rate 1e-4 \
  --num_epochs 1 \
  --remove_prefix_in_ckpt "pipe.dit." \
  --output_path "./decfg-split-cache" \
  --lora_base_model "dit" \
  --lora_target_modules "attn.qkv_proj,attn.out_proj,mlp.fc1,mlp.fc2" \
  --lora_rank 128 \
  --use_gradient_checkpointing \
  --task "sft:data_process" \
  --offload_models "MiniMax/MiniMax-H3-Image:transformer/model*.safetensors,MiniMax/MiniMax-H3-Image:pdd_fused_heads.safetensors"

# Stage 2: train the adapter
accelerate launch examples/minimax_h3_image/model_training/train.py \
  --dataset_base_path "./decfg-split-cache" \
  --data_file_keys "image" \
  --max_pixels 4194304 \
  --dataset_repeat 50 \
  --model_id_with_origin_paths "MiniMax/MiniMax-H3:FL2VA/text_encoder/model*.safetensors,MiniMax/MiniMax-H3-Image:transformer/model*.safetensors,MiniMax/MiniMax-H3-Image:pdd_fused_heads.safetensors,MiniMax/MiniMax-H3-Image:vae/diffusion_pytorch_model.safetensors" \
  --learning_rate 1e-4 \
  --num_epochs 5 \
  --remove_prefix_in_ckpt "pipe.dit." \
  --output_path "./output" \
  --lora_base_model "dit" \
  --lora_target_modules "attn.qkv_proj,attn.out_proj,mlp.fc1,mlp.fc2" \
  --lora_rank 128 \
  --use_gradient_checkpointing \
  --task "sft:train" \
  --offload_models "MiniMax/MiniMax-H3:FL2VA/text_encoder/model*.safetensors,MiniMax/MiniMax-H3-Image:vae/diffusion_pytorch_model.safetensors" \
  --save_steps 100
```
