nif0 commited on
Commit
61af691
Β·
verified Β·
1 Parent(s): 2358b9c

Fix size table

Browse files
Files changed (1) hide show
  1. README.md +108 -108
README.md CHANGED
@@ -1,108 +1,108 @@
1
- ---
2
- license: apache-2.0
3
- base_model: OpenMOSS-Team/MOSS-Image-SFT
4
- base_model_relation: quantized
5
- language:
6
- - en
7
- - zh
8
- pipeline_tag: text-to-image
9
- library_name: comfyui
10
- tags:
11
- - moss-image
12
- - comfyui
13
- - text-to-image
14
- - quantized
15
- - int8
16
- - w4a8
17
- - gptq
18
- - convrot
19
- ---
20
-
21
- # MOSS-Image-SFT β€” INT8 / W4A8 ConvRot (ComfyUI)
22
-
23
- Single-file, ComfyUI-ready quantization of
24
- [**OpenMOSS-Team/MOSS-Image-SFT**](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT)
25
- (code and docs: [OpenMOSS/MOSS-Image](https://github.com/OpenMOSS/MOSS-Image)).
26
- All credit for the model goes to OpenMOSS; this repo only re-packages the weights.
27
-
28
- | Component | Format | Size | vs. original |
29
- |---|---|---|---|
30
- | Diffusion model (DiT, 42 blocks) | **INT8 ConvRot** | 5.41 GB | bf16 β‰ˆ 2.7Γ— larger |
31
- | Text encoder (Qwen3.5-9B) | **W4A8 GPTQ ConvRot** | 5.43 GB | bf16 β‰ˆ 3Γ— larger |
32
- | VAE (`AutoencoderKLFlux2`) | **bf16** | 125 MB | fp32 β†’ half |
33
-
34
- ## File layout
35
-
36
- ```
37
- MOSS-Image-SFT-INT8-W4A8-ConvRot/
38
- β”œβ”€β”€ diffusion_models/
39
- β”‚ └── moss_image_sft_int8_convrot.safetensors # 5.41 GB
40
- β”œβ”€β”€ text_encoders/
41
- β”‚ └── qwen3.5_9b_moss_image_sft_w4a8_gptq.safetensors # 5.43 GB
42
- β”œβ”€β”€ vae/
43
- β”‚ └── moss_image_vae_bf16.safetensors # 125 MB
44
- └── assets/ # comparison images
45
- ```
46
-
47
- Drop each file into the matching folder of your ComfyUI `models/` directory.
48
-
49
- ## Usage (ComfyUI)
50
-
51
- 1. Install the official node pack from the
52
- [MOSS-Image ComfyUI guide](https://github.com/OpenMOSS/MOSS-Image/blob/main/comfyui/README.md)
53
- (copy `comfyui/moss-image` into `custom_nodes/`). ComfyUI needs
54
- [comfy-kitchen](https://github.com/Comfy-Org/comfy-kitchen) quantized-op support; the
55
- quantization type is auto-detected from the files.
56
- 2. Load with the plugin's single-file loaders:
57
- - **MOSSImageUNETLoader** β†’ `moss_image_sft_int8_convrot.safetensors`
58
- - **MOSSImageCLIPLoader** β†’ `qwen3.5_9b_moss_image_sft_w4a8_gptq.safetensors`
59
- - **VAELoader** β†’ `moss_image_vae_bf16.safetensors`
60
- 3. Use the official SFT sampling settings: **Euler**, 50 steps, **CFG 3**, `ModelSamplingSD3` shift **5**,
61
- uncond skip-layer **22**.
62
-
63
- Tested end-to-end in stock ComfyUI on an 8 GB RTX 3060 Ti (β‰ˆ210 s for 1024Γ—1536, 50 steps).
64
-
65
- ## How it was made
66
-
67
- - **DiT:** all 252 block linears (`layers.N.proj.{q,k,v,o,ffn_up_gate,ffn_down}`) quantized to INT8 with a
68
- group-Hadamard (size 256) ConvRot rotation and per-output-channel scales. Embedders, modulation,
69
- final layers and norms are kept in original precision.
70
- - **Text encoder:** the 200 body linears (attention / linear-attention / MLP) quantized to 4-bit weights
71
- (group 16, fp8 relative scales) with 8-bit activations, using GPTQ run in the rotated basis. Calibration used
72
- the model's real chat template on the official example prompts and negatives plus public prompt datasets.
73
- Embeddings and the vision tower are INT8 ConvRot; everything else is unchanged.
74
- - **VAE:** plain fp32 β†’ bf16 cast.
75
-
76
- ## Quality check
77
-
78
- 50 steps, official sizes, same seed, cfg 3. Left β†’ right in each strip: original bf16 pipeline Β·
79
- bf16 VAE Β· INT8 DiT Β· everything quantized (INT8 DiT + W4A8 text encoder + bf16 VAE).
80
-
81
- ![anime](assets/compare_anime.jpg)
82
- ![pop-up book](assets/compare_popup_book.jpg)
83
- ![noir photo](assets/compare_noir_photo.jpg)
84
-
85
- - bf16 VAE vs. fp32 decode: **~54 dB PSNR** (visually identical).
86
- - Quantized DiT / full stack diverge in fine detail over the 50-step trajectory (PSNR 19–27 dB vs. the
87
- original output), but composition, identity, style, lighting and rendered text are preserved.
88
- - Text-encoder `last_hidden_state` cosine vs. bf16: β‰ˆ 0.996 (mean over tokens, first example prompt).
89
-
90
- Limitations: only three prompts were compared visually; the original model card recommends an fp32 VAE, which
91
- is the safest choice if you see banding. Results in ComfyUI's sampler will not match the diffusers pipeline
92
- pixel for pixel.
93
-
94
- ## Checksums (SHA-256)
95
-
96
- ```
97
- ffd98820ac8f0f57c48386bd98852720de50c3acb502f73fd641d0cd9df6d0af moss_image_sft_int8_convrot.safetensors
98
- b5f31a430e4912decb152f3a0761350f52282176823b597edd43b2e3f6403da4 qwen3.5_9b_moss_image_sft_w4a8_gptq.safetensors
99
- 81a27c7135775f149648fa35a58eec6d78a3e6a9bb9273885b51895cbc212d5d moss_image_vae_bf16.safetensors
100
- ```
101
-
102
- ## License & attribution
103
-
104
- Apache-2.0, same as the original. Original model, architecture and pipeline Β© OpenMOSS-Team
105
- ([MOSS-Image-Base](https://huggingface.co/OpenMOSS-Team/MOSS-Image-Base),
106
- [MOSS-Image-SFT](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT),
107
- [technical report](https://github.com/OpenMOSS/MOSS-Image/blob/main/paper/MOSS_Image_Technical_Report.pdf)).
108
- This repo is an unofficial community quantization and is not affiliated with OpenMOSS.
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: OpenMOSS-Team/MOSS-Image-SFT
4
+ base_model_relation: quantized
5
+ language:
6
+ - en
7
+ - zh
8
+ pipeline_tag: text-to-image
9
+ library_name: comfyui
10
+ tags:
11
+ - moss-image
12
+ - comfyui
13
+ - text-to-image
14
+ - quantized
15
+ - int8
16
+ - w4a8
17
+ - gptq
18
+ - convrot
19
+ ---
20
+
21
+ # MOSS-Image-SFT β€” INT8 / W4A8 ConvRot (ComfyUI)
22
+
23
+ Single-file, ComfyUI-ready quantization of
24
+ [**OpenMOSS-Team/MOSS-Image-SFT**](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT)
25
+ (code and docs: [OpenMOSS/MOSS-Image](https://github.com/OpenMOSS/MOSS-Image)).
26
+ All credit for the model goes to OpenMOSS; this repo only re-packages the weights.
27
+
28
+ | Component | Format | Size | Original |
29
+ |---|---|---|---|
30
+ | Diffusion model (DiT, 42 blocks) | **INT8 ConvRot** | 5.41 GB | 10.16 GB (bf16) |
31
+ | Text encoder (Qwen3.5-9B) | **W4A8 GPTQ ConvRot** | 5.43 GB | 16.79 GB (bf16) |
32
+ | VAE (`AutoencoderKLFlux2`) | **bf16** | 125 MB | 250 MB (fp32) |
33
+
34
+ ## File layout
35
+
36
+ ```
37
+ MOSS-Image-SFT-INT8-W4A8-ConvRot/
38
+ β”œβ”€β”€ diffusion_models/
39
+ β”‚ └── moss_image_sft_int8_convrot.safetensors # 5.41 GB
40
+ β”œβ”€β”€ text_encoders/
41
+ β”‚ └── qwen3.5_9b_moss_image_sft_w4a8_gptq.safetensors # 5.43 GB
42
+ β”œβ”€β”€ vae/
43
+ β”‚ └── moss_image_vae_bf16.safetensors # 125 MB
44
+ └── assets/ # comparison images
45
+ ```
46
+
47
+ Drop each file into the matching folder of your ComfyUI `models/` directory.
48
+
49
+ ## Usage (ComfyUI)
50
+
51
+ 1. Install the official node pack from the
52
+ [MOSS-Image ComfyUI guide](https://github.com/OpenMOSS/MOSS-Image/blob/main/comfyui/README.md)
53
+ (copy `comfyui/moss-image` into `custom_nodes/`). ComfyUI needs
54
+ [comfy-kitchen](https://github.com/Comfy-Org/comfy-kitchen) quantized-op support; the
55
+ quantization type is auto-detected from the files.
56
+ 2. Load with the plugin's single-file loaders:
57
+ - **MOSSImageUNETLoader** β†’ `moss_image_sft_int8_convrot.safetensors`
58
+ - **MOSSImageCLIPLoader** β†’ `qwen3.5_9b_moss_image_sft_w4a8_gptq.safetensors`
59
+ - **VAELoader** β†’ `moss_image_vae_bf16.safetensors`
60
+ 3. Use the official SFT sampling settings: **Euler**, 50 steps, **CFG 3**, `ModelSamplingSD3` shift **5**,
61
+ uncond skip-layer **22**.
62
+
63
+ Tested end-to-end in stock ComfyUI on an 8 GB RTX 3060 Ti (β‰ˆ210 s for 1024Γ—1536, 50 steps).
64
+
65
+ ## How it was made
66
+
67
+ - **DiT:** all 252 block linears (`layers.N.proj.{q,k,v,o,ffn_up_gate,ffn_down}`) quantized to INT8 with a
68
+ group-Hadamard (size 256) ConvRot rotation and per-output-channel scales. Embedders, modulation,
69
+ final layers and norms are kept in original precision.
70
+ - **Text encoder:** the 200 body linears (attention / linear-attention / MLP) quantized to 4-bit weights
71
+ (group 16, fp8 relative scales) with 8-bit activations, using GPTQ run in the rotated basis. Calibration used
72
+ the model's real chat template on the official example prompts and negatives plus public prompt datasets.
73
+ Embeddings and the vision tower are INT8 ConvRot; everything else is unchanged.
74
+ - **VAE:** plain fp32 β†’ bf16 cast.
75
+
76
+ ## Quality check
77
+
78
+ 50 steps, official sizes, same seed, cfg 3. Left β†’ right in each strip: original bf16 pipeline Β·
79
+ bf16 VAE Β· INT8 DiT Β· everything quantized (INT8 DiT + W4A8 text encoder + bf16 VAE).
80
+
81
+ ![anime](assets/compare_anime.jpg)
82
+ ![pop-up book](assets/compare_popup_book.jpg)
83
+ ![noir photo](assets/compare_noir_photo.jpg)
84
+
85
+ - bf16 VAE vs. fp32 decode: **~54 dB PSNR** (visually identical).
86
+ - Quantized DiT / full stack diverge in fine detail over the 50-step trajectory (PSNR 19–27 dB vs. the
87
+ original output), but composition, identity, style, lighting and rendered text are preserved.
88
+ - Text-encoder `last_hidden_state` cosine vs. bf16: β‰ˆ 0.996 (mean over tokens, first example prompt).
89
+
90
+ Limitations: only three prompts were compared visually; the original model card recommends an fp32 VAE, which
91
+ is the safest choice if you see banding. Results in ComfyUI's sampler will not match the diffusers pipeline
92
+ pixel for pixel.
93
+
94
+ ## Checksums (SHA-256)
95
+
96
+ ```
97
+ ffd98820ac8f0f57c48386bd98852720de50c3acb502f73fd641d0cd9df6d0af moss_image_sft_int8_convrot.safetensors
98
+ b5f31a430e4912decb152f3a0761350f52282176823b597edd43b2e3f6403da4 qwen3.5_9b_moss_image_sft_w4a8_gptq.safetensors
99
+ 81a27c7135775f149648fa35a58eec6d78a3e6a9bb9273885b51895cbc212d5d moss_image_vae_bf16.safetensors
100
+ ```
101
+
102
+ ## License & attribution
103
+
104
+ Apache-2.0, same as the original. Original model, architecture and pipeline Β© OpenMOSS-Team
105
+ ([MOSS-Image-Base](https://huggingface.co/OpenMOSS-Team/MOSS-Image-Base),
106
+ [MOSS-Image-SFT](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT),
107
+ [technical report](https://github.com/OpenMOSS/MOSS-Image/blob/main/paper/MOSS_Image_Technical_Report.pdf)).
108
+ This repo is an unofficial community quantization and is not affiliated with OpenMOSS.