Skip to content

Commit 9717944

Browse files
committed
update
1 parent 4436f54 commit 9717944

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ from diffusers import HiDreamImageTransformer2DModel
2121
transformer = HiDreamImageTransformer2DModel.from_pretrained("HiDream-ai/HiDream-I1-Full", subfolder="transformer", torch_dtype=torch.bfloat16)
2222
```
2323

24-
## Loading GGUF quantized checkpoints
24+
## Loading GGUF quantized checkpoints for HiDream-I1
2525

26-
GGUF checkpoints for the `HiDreamImageTransformer2DModel` can we be loaded using `~FromOriginalModelMixin.from_single_file`
26+
GGUF checkpoints for the `HiDreamImageTransformer2DModel` can be loaded using `~FromOriginalModelMixin.from_single_file`
2727

2828
```python
29+
import torch
2930
from diffusers import GGUFQuantizationConfig, HiDreamImageTransformer2DModel
3031

3132
ckpt_path = "https://huggingface.co/city96/HiDream-I1-Dev-gguf/blob/main/hidream-i1-dev-Q2_K.gguf"
@@ -39,6 +40,7 @@ transformer = HiDreamImageTransformer2DModel.from_single_file(
3940
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.
4041

4142
```python
43+
import torch
4244
from diffusers import GGUFQuantizationConfig, HiDreamImageTransformer2DModel
4345

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

tests/quantization/gguf/test_gguf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
FluxPipeline,
1313
FluxTransformer2DModel,
1414
GGUFQuantizationConfig,
15+
HiDreamImageTransformer2DModel,
1516
SD3Transformer2DModel,
1617
StableDiffusion3Pipeline,
1718
)
@@ -549,3 +550,10 @@ def test_lora_loading(self):
549550

550551
max_diff = numpy_cosine_similarity_distance(expected_slice, out_slice)
551552
self.assertTrue(max_diff < 1e-3)
553+
554+
555+
class HiDreamGGUFSingleFileTests(GGUFSingleFileTesterMixin, unittest.TestCase):
556+
ckpt_path = "https://huggingface.co/city96/HiDream-I1-Dev-gguf/blob/main/hidream-i1-dev-Q2_K.gguf"
557+
torch_dtype = torch.bfloat16
558+
model_cls = HiDreamImageTransformer2DModel
559+
expected_memory_use_in_gb = 8

0 commit comments

Comments
 (0)