Skip to content

Commit 557322b

Browse files
authored
feat(diffusers/pipelines): add hidream (#1360)
* add hidream * fix hidream * add docs, fix fast test * fix precommit and typo
1 parent 8aad776 commit 557322b

File tree

14 files changed

+2314
-0
lines changed

14 files changed

+2314
-0
lines changed

docs/diffusers/_toctree.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@
233233
title: ControlNetUnionModel
234234
- local: api/models/controlnet_flux
235235
title: FluxControlNetModel
236+
- local: api/models/hidream_image_transformer
237+
title: HiDreamImageTransformer2DModel
236238
- local: api/models/controlnet_hunyuandit
237239
title: HunyuanDiT2DControlNetModel
238240
- local: api/models/controlnet_sana
@@ -419,6 +421,8 @@
419421
title: Flux
420422
- local: api/pipelines/control_flux_inpaint
421423
title: FluxControlInpaint
424+
- local: api/pipelines/hidream
425+
title: HiDream-I1
422426
- local: api/pipelines/framepack
423427
title: Framepack
424428
- local: api/pipelines/hunyuandit
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!-- Copyright 2024 The HuggingFace Team. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4+
the License. You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
9+
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10+
specific language governing permissions and limitations under the License. -->
11+
12+
# HiDreamImageTransformer2DModel
13+
14+
A Transformer model for image-like data from [HiDream-I1](https://huggingface.co/HiDream-ai).
15+
16+
The model can be loaded with the following code snippet.
17+
18+
```python
19+
import mindspore
20+
from mindone.diffusers import HiDreamImageTransformer2DModel
21+
22+
transformer = HiDreamImageTransformer2DModel.from_pretrained("HiDream-ai/HiDream-I1-Full", subfolder="transformer", mindspore_dtype=mindspore.bfloat16)
23+
```
24+
25+
::: mindone.diffusers.HiDreamImageTransformer2DModel
26+
27+
::: mindone.diffusers.models.modeling_outputs.Transformer2DModelOutput
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!-- Copyright 2024 The HuggingFace Team. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License. -->
14+
15+
# HiDreamImage
16+
17+
[HiDream-I1](https://huggingface.co/HiDream-ai) by HiDream.ai
18+
19+
!!! tip
20+
21+
Make sure to check out the Schedulers [guide](../../using-diffusers/schedulers) to learn how to explore the tradeoff between scheduler speed and quality, and see the [reuse components across pipelines](../../using-diffusers/loading#reuse-a-pipeline) section to learn how to efficiently load the same components into multiple pipelines.
22+
23+
24+
## Available models
25+
26+
The following models are available for the [`HiDreamImagePipeline`](text-to-image) pipeline:
27+
28+
| Model name | Description |
29+
|:---|:---|
30+
| [`HiDream-ai/HiDream-I1-Full`](https://huggingface.co/HiDream-ai/HiDream-I1-Full) | - |
31+
| [`HiDream-ai/HiDream-I1-Dev`](https://huggingface.co/HiDream-ai/HiDream-I1-Dev) | - |
32+
| [`HiDream-ai/HiDream-I1-Fast`](https://huggingface.co/HiDream-ai/HiDream-I1-Fast) | - |
33+
34+
35+
::: mindone.diffusers.HiDreamImagePipeline
36+
37+
::: mindone.diffusers.pipelines.hidream_image.pipeline_output.HiDreamImagePipelineOutput

mindone/diffusers/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
"FluxControlNetModel",
8686
"FluxMultiControlNetModel",
8787
"FluxTransformer2DModel",
88+
"HiDreamImageTransformer2DModel",
8889
"HunyuanDiT2DControlNetModel",
8990
"HunyuanDiT2DModel",
9091
"HunyuanDiT2DMultiControlNetModel",
@@ -197,6 +198,7 @@
197198
"FluxKontextInpaintPipeline",
198199
"FluxPipeline",
199200
"FluxPriorReduxPipeline",
201+
"HiDreamImagePipeline",
200202
"HunyuanDiTControlNetPipeline",
201203
"HunyuanDiTPAGPipeline",
202204
"HunyuanDiTPipeline",
@@ -457,6 +459,7 @@
457459
FluxControlNetModel,
458460
FluxMultiControlNetModel,
459461
FluxTransformer2DModel,
462+
HiDreamImageTransformer2DModel,
460463
HunyuanDiT2DControlNetModel,
461464
HunyuanDiT2DModel,
462465
HunyuanDiT2DMultiControlNetModel,
@@ -580,6 +583,7 @@
580583
FluxKontextPipeline,
581584
FluxPipeline,
582585
FluxPriorReduxPipeline,
586+
HiDreamImagePipeline,
583587
HunyuanDiTControlNetPipeline,
584588
HunyuanDiTPAGPipeline,
585589
HunyuanDiTPipeline,

mindone/diffusers/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"transformers.transformer_cosmos": ["CosmosTransformer3DModel"],
7676
"transformers.transformer_easyanimate": ["EasyAnimateTransformer3DModel"],
7777
"transformers.transformer_flux": ["FluxTransformer2DModel"],
78+
"transformers.transformer_hidream_image": ["HiDreamImageTransformer2DModel"],
7879
"transformers.transformer_hunyuan_video": ["HunyuanVideoTransformer3DModel"],
7980
"transformers.transformer_hunyuan_video_framepack": ["HunyuanVideoFramepackTransformer3DModel"],
8081
"transformers.transformer_ltx": ["LTXVideoTransformer3DModel"],
@@ -151,6 +152,7 @@
151152
DualTransformer2DModel,
152153
EasyAnimateTransformer3DModel,
153154
FluxTransformer2DModel,
155+
HiDreamImageTransformer2DModel,
154156
HunyuanDiT2DModel,
155157
HunyuanVideoFramepackTransformer3DModel,
156158
HunyuanVideoTransformer3DModel,

mindone/diffusers/models/transformers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from .transformer_cosmos import CosmosTransformer3DModel
2222
from .transformer_easyanimate import EasyAnimateTransformer3DModel
2323
from .transformer_flux import FluxTransformer2DModel
24+
from .transformer_hidream_image import HiDreamImageTransformer2DModel
2425
from .transformer_hunyuan_video import HunyuanVideoTransformer3DModel
2526
from .transformer_hunyuan_video_framepack import HunyuanVideoFramepackTransformer3DModel
2627
from .transformer_ltx import LTXVideoTransformer3DModel

0 commit comments

Comments
 (0)