---
title: HidreamO1-i2L-v2
canonical_url: "https://www.modelscope.cn/models/DiffSynth-Studio/HidreamO1-i2L-v2"
md_url: "https://www.modelscope.cn/models/DiffSynth-Studio/HidreamO1-i2L-v2.md"
repository: DiffSynth-Studio/HidreamO1-i2L-v2
chinese_name: "HidreamO1-i2L-v2 (Image to LoRA)"
last_updated: 2026-07-09
license: "Apache License 2.0"
pipeline_tag: text-to-image-synthesis
tasks:
  - text-to-image-synthesis
base_model:
  - HiDream-ai/HiDream-O1-Image
base_model_relation: adapter
parameters: 2.3B
tensor_type:
  - BF16
library_name:
  - pytorch
  - safetensors
frameworks:
  - Pytorch
downloads: 176
stars: 2
---

# HidreamO1-i2L-v2

> HidreamO1-i2L-v2 - DiffSynth-Studio 在 ModelScope 开源的模型。i2L (Image to LoRA) 模型是我们设计的特殊模型结构。模型的输入为若干张图片，输出为这些图片训练出的 LoRA 模型。

DiffSynth-Studio/HidreamO1-i2L-v2 是 ModelScope 魔搭社区上的 2.3B 参数text-to-image-synthesis模型，采用 Apache License 2.0 许可，基于 HiDream-ai/HiDream-O1-Image 构建。

- **Repository**: DiffSynth-Studio/HidreamO1-i2L-v2
- **License**: Apache License 2.0
- **Tasks**: text-to-image-synthesis
- **Parameters**: 2.3B
- **Base model**: HiDream-ai/HiDream-O1-Image
- **Downloads**: 176
- **Stars**: 2
- **Last updated**: 2026-07-09

Source: https://www.modelscope.cn/models/DiffSynth-Studio/HidreamO1-i2L-v2

---

## 模型介绍

i2L (Image to LoRA) 模型是我们设计的特殊模型结构。模型的输入为若干张图片，输出为这些图片训练出的 LoRA 模型。

本模型专门增强了风格提取能力，模型能力与上一版本相比有了较大的提升，支持输入任意多张图，能够快速从这些图像中抽取风格信息，并用于生成新的图像。

* 技术报告：[arXiv](https://arxiv.org/abs/2606.13809)
* 基础模型：[Hidream-O1-Image](https://www.modelscope.cn/models/HiDream-ai/HiDream-O1-Image)
* 数据集：[MegaStyle-1.4M](https://modelscope.cn/datasets/Tencent-Hunyuan/MegaStyle-1.4M)
* 训练代码：[DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio)

## 效果展示

提示词：A cat is sitting on a stone.

|输入|输出|输入|输出|
|-|-|-|-|
|![](./assets/7_input.jpg)|![](./assets/7_output.jpg)|![](./assets/4_input.jpg)|![](./assets/4_output.jpg)|
|![](./assets/6_input.jpg)|![](./assets/6_output.jpg)|![](./assets/1_input.jpg)|![](./assets/1_output.jpg)|
|![](./assets/3_input.jpg)|![](./assets/3_output.jpg)|![](./assets/2_input.jpg)|![](./assets/2_output.jpg)|
|![](./assets/8_input.jpg)|![](./assets/8_output.jpg)|![](./assets/5_input.jpg)|![](./assets/5_output.jpg)|

模型支持任意多张输入图：

|输入图1|输入图2|输入图3|输入图4|输入图5|输入图6|输入图7|输入图8|
|-|-|-|-|-|-|-|-|
|![](./assets/multi_input_0.jpg)|![](./assets/multi_input_1.jpg)|![](./assets/multi_input_2.jpg)|![](./assets/multi_input_3.jpg)|![](./assets/multi_input_4.jpg)|![](./assets/multi_input_5.jpg)|![](./assets/multi_input_6.jpg)|![](./assets/multi_input_7.jpg)|

|输入1张图产生的输出图|输入2张图产生的输出图|输入3张图产生的输出图|输入4张图产生的输出图|
|-|-|-|-|
|![](./assets/multi_output_1.jpg)|![](./assets/multi_output_2.jpg)|![](./assets/multi_output_3.jpg)|![](./assets/multi_output_4.jpg)|

|输入5张图产生的输出图|输入6张图产生的输出图|输入7张图产生的输出图|输入8张图产生的输出图|
|-|-|-|-|
|![](./assets/multi_output_5.jpg)|![](./assets/multi_output_6.jpg)|![](./assets/multi_output_7.jpg)|![](./assets/multi_output_8.jpg)|

## 推理代码

安装 [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio)：

```shell
git clone https://github.com/modelscope/DiffSynth-Studio.git  
cd DiffSynth-Studio
pip install -e .
```

模型推理（以 Diffusion Templates 推理，开启 CFG 增强以提升效果）：

```python
from diffsynth.diffusion.template import TemplatePipeline
from diffsynth.pipelines.hidream_o1_image import HiDreamO1ImagePipeline, ModelConfig
from modelscope import snapshot_download
from PIL import Image
import numpy as np
import torch

pipe = HiDreamO1ImagePipeline.from_pretrained(
    torch_dtype=torch.bfloat16,
    device="cuda",
    model_configs=[ModelConfig(model_id="HiDream-ai/HiDream-O1-Image", origin_file_pattern="model-*.safetensors")],
    processor_config=ModelConfig(model_id="HiDream-ai/HiDream-O1-Image", origin_file_pattern="./"),
)
pipe.enable_lora_hot_loading(pipe.dit)
template = TemplatePipeline.from_pretrained(
    torch_dtype=torch.bfloat16,
    device="cuda",
    model_configs=[ModelConfig(model_id="DiffSynth-Studio/HidreamO1-i2L-v2")],
)
snapshot_download("DiffSynth-Studio/HidreamO1-i2L-v2", allow_file_pattern="assets/*", local_dir="data")
images = [Image.open(f"data/assets/multi_input_{i}.jpg") for i in range(4)]
image = template(
    pipe,
    prompt="A cat is sitting on a stone",
    seed=0, cfg_scale=4, num_inference_steps=50,
    template_inputs = [{"image": images}],
    negative_template_inputs = [{"image": [Image.fromarray(np.zeros_like(np.array(i)) + 128) for i in images]}],
)
image.save("image_output.jpg")
```

模型推理（导出 LoRA 模型文件，可[上传到魔搭社区](https://modelscope.cn/models/create?template=text-to-image-lora&from=aigc)并作为预加载 LoRA [继续训练](https://modelscope.cn/aigc/modelTraining)）：

```python
from diffsynth.diffusion.template import TemplatePipeline, ModelConfig
from modelscope import snapshot_download
from safetensors.torch import save_file
from PIL import Image
import torch

template = TemplatePipeline.from_pretrained(
    torch_dtype=torch.bfloat16,
    device="cuda",
    model_configs=[ModelConfig(model_id="DiffSynth-Studio/HidreamO1-i2L-v2")],
)
snapshot_download("DiffSynth-Studio/HidreamO1-i2L-v2", allow_file_pattern="assets/*", local_dir="data")
images = [Image.open(f"data/assets/multi_input_{i}.jpg") for i in range(4)]
lora = template.call_single_side(inputs=[{"image": images}])["lora"]
save_file(lora, "lora.safetensors")
```
