Skip to content

Commit 2a19302

Browse files
committed
update
1 parent 721375b commit 2a19302

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

docs/source/en/api/models/hidream_image_transformer.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,33 @@ transformer = HiDreamImageTransformer2DModel.from_pretrained("HiDream-ai/HiDream
2626
GGUF checkpoints for the `HiDreamImageTransformer2DModel` can we be loaded using `~FromOriginalModelMixin.from_single_file`
2727

2828
```python
29-
from diffusers import HiDreamImageTransformer2DModel
29+
from diffusers import GGUFQuantizationConfig, HiDreamImageTransformer2DModel
3030

3131
ckpt_path = "https://huggingface.co/city96/HiDream-I1-Dev-gguf/blob/main/hidream-i1-dev-Q2_K.gguf"
32-
transformer = HiDreamImageTransformer2DModel.from_single_file(ckpt_path, torch_dtype=torch.bfloat16)
32+
transformer = HiDreamImageTransformer2DModel.from_single_file(
33+
ckpt_path,
34+
quantization_config=GGUFQuantizationConfig(compute_dtype=torch.bfloat16),
35+
torch_dtype=torch.bfloat16
36+
)
3337
```
3438

3539
If you are trying to use a GGUF checkpoint for the `HiDream-ai/HiDream-E1-Full` model, you will have to pass in a `config` argument to properly configure the model. This is because the HiDream I1 and E1 models share the same state dict keys, so it is currently not possible to automatically infer the model type from the checkpoint itself.
3640

3741
```python
38-
from diffusers import HiDreamImageTransformer2DModel
42+
from diffusers import GGUFQuantizationConfig, HiDreamImageTransformer2DModel
3943

4044
ckpt_path = "https://huggingface.co/ND911/HiDream_e1_full_bf16-ggufs/blob/main/hidream_e1_full_bf16-Q2_K.gguf"
4145

42-
transformer = HiDreamImageTransformer2DModel.from_single_file(ckpt_path, config="HiDream-ai/HiDream-E1-Full", subfolder="transformer", torch_dtype=torch.bfloat16)
46+
transformer = HiDreamImageTransformer2DModel.from_single_file(
47+
ckpt_path,
48+
quantization_config=GGUFQuantizationConfig(compute_dtype=torch.bfloat16),
49+
config="HiDream-ai/HiDream-E1-Full",
50+
subfolder="transformer",
51+
torch_dtype=torch.bfloat16
52+
)
4353
```
4454

4555

46-
4756
## HiDreamImageTransformer2DModel
4857

4958
[[autodoc]] HiDreamImageTransformer2DModel

0 commit comments

Comments
 (0)