WaveCut commited on
Commit
4602b3c
·
verified ·
1 Parent(s): d9f42ee

Add model-specific OrbitQuant usage examples

Browse files
Files changed (2) hide show
  1. README.md +11 -8
  2. SHA256SUMS +1 -1
README.md CHANGED
@@ -20,7 +20,7 @@ Install the package from this repository, then load the base pipeline and patch
20
 
21
  ```python
22
  import torch
23
- from diffusers import DiffusionPipeline
24
  from huggingface_hub import snapshot_download
25
  from orbitquant import load_quantized_pipeline_component
26
 
@@ -28,7 +28,7 @@ base_model = "Tongyi-MAI/Z-Image-Turbo"
28
  artifact_id = "WaveCut/Z-Image-Turbo-OrbitQuant-W2A4"
29
 
30
  artifact_dir = snapshot_download(artifact_id, repo_type="model")
31
- pipe = DiffusionPipeline.from_pretrained(
32
  base_model,
33
  torch_dtype=torch.bfloat16,
34
  )
@@ -40,13 +40,16 @@ load_quantized_pipeline_component(
40
  )
41
  pipe.to("cuda")
42
 
43
- result = pipe(
44
  prompt="A precise product photo of a red ceramic mug on a wooden desk",
45
- )
 
 
 
 
 
46
  ```
47
 
48
- For model-specific pipelines, you may replace `DiffusionPipeline` with the matching Diffusers class, such as `FluxPipeline`, `Flux2KleinPipeline`, `ZImagePipeline`, or `WanPipeline` when your Diffusers version provides it.
49
-
50
  ## Quantization
51
 
52
  - Method: `orbitquant`
@@ -73,14 +76,14 @@ For model-specific pipelines, you may replace `DiffusionPipeline` with the match
73
 
74
  The following assets are stored in this artifact and compare the BF16 base generation against the OrbitQuant generation with the same prompt and seed.
75
 
 
 
76
  ![assets/original_vs_orbitquant_z-image-native_seed0_W2A4_color-binding.webp](assets/original_vs_orbitquant_z-image-native_seed0_W2A4_color-binding.webp)
77
 
78
  ![assets/original_vs_orbitquant_z-image-native_seed0_W2A4_counting.webp](assets/original_vs_orbitquant_z-image-native_seed0_W2A4_counting.webp)
79
 
80
  ![assets/original_vs_orbitquant_z-image-native_seed0_W2A4_cyrillic-text-rendering.webp](assets/original_vs_orbitquant_z-image-native_seed0_W2A4_cyrillic-text-rendering.webp)
81
 
82
- ![assets/original_vs_orbitquant_z-image-native_seed0_W2A4_english-text-rendering.webp](assets/original_vs_orbitquant_z-image-native_seed0_W2A4_english-text-rendering.webp)
83
-
84
  ## Source
85
 
86
  - Model: `Tongyi-MAI/Z-Image-Turbo`
 
20
 
21
  ```python
22
  import torch
23
+ from diffusers import ZImagePipeline
24
  from huggingface_hub import snapshot_download
25
  from orbitquant import load_quantized_pipeline_component
26
 
 
28
  artifact_id = "WaveCut/Z-Image-Turbo-OrbitQuant-W2A4"
29
 
30
  artifact_dir = snapshot_download(artifact_id, repo_type="model")
31
+ pipe = ZImagePipeline.from_pretrained(
32
  base_model,
33
  torch_dtype=torch.bfloat16,
34
  )
 
40
  )
41
  pipe.to("cuda")
42
 
43
+ image = pipe(
44
  prompt="A precise product photo of a red ceramic mug on a wooden desk",
45
+ height=1024,
46
+ width=1024,
47
+ num_inference_steps=10,
48
+ guidance_scale=0.0,
49
+ ).images[0]
50
+ image.save("z-image-orbitquant.png")
51
  ```
52
 
 
 
53
  ## Quantization
54
 
55
  - Method: `orbitquant`
 
76
 
77
  The following assets are stored in this artifact and compare the BF16 base generation against the OrbitQuant generation with the same prompt and seed.
78
 
79
+ ![reports/native/z-image-w2a4-1348cb6/assets/image_generation_comparison_matrix.webp](reports/native/z-image-w2a4-1348cb6/assets/image_generation_comparison_matrix.webp)
80
+
81
  ![assets/original_vs_orbitquant_z-image-native_seed0_W2A4_color-binding.webp](assets/original_vs_orbitquant_z-image-native_seed0_W2A4_color-binding.webp)
82
 
83
  ![assets/original_vs_orbitquant_z-image-native_seed0_W2A4_counting.webp](assets/original_vs_orbitquant_z-image-native_seed0_W2A4_counting.webp)
84
 
85
  ![assets/original_vs_orbitquant_z-image-native_seed0_W2A4_cyrillic-text-rendering.webp](assets/original_vs_orbitquant_z-image-native_seed0_W2A4_cyrillic-text-rendering.webp)
86
 
 
 
87
  ## Source
88
 
89
  - Model: `Tongyi-MAI/Z-Image-Turbo`
SHA256SUMS CHANGED
@@ -1,4 +1,4 @@
1
- 7b22614723a9322935b2c9af7bab35bbef5c24489b06dfdba2101ee78ecb4de9 README.md
2
  e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 assets/.gitkeep
3
  8c8731e445b7cefae4b0fb1aa5c716bc01b2c91f67e34d46bf6afc40a02aec0f assets/original_vs_orbitquant_z-image-native_seed0_W2A4_color-binding.webp
4
  4a58042eadc55289dd18b1c0841e95dbd9a3f7ba4fa63178af43bfe4918ed8db assets/original_vs_orbitquant_z-image-native_seed0_W2A4_counting.webp
 
1
+ 2a530f5e53e1f01a91d11263bcd7659a4016a14f3d14acaee1263ccb6da86749 README.md
2
  e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 assets/.gitkeep
3
  8c8731e445b7cefae4b0fb1aa5c716bc01b2c91f67e34d46bf6afc40a02aec0f assets/original_vs_orbitquant_z-image-native_seed0_W2A4_color-binding.webp
4
  4a58042eadc55289dd18b1c0841e95dbd9a3f7ba4fa63178af43bfe4918ed8db assets/original_vs_orbitquant_z-image-native_seed0_W2A4_counting.webp