6chan commited on
Commit
7d3538b
·
verified ·
1 Parent(s): 203763a

docs: standardize model card with compliant frontmatter and lowercase headings

Browse files
Files changed (1) hide show
  1. README.md +48 -80
README.md CHANGED
@@ -1,43 +1,57 @@
1
- # Ming-Image-0.1-Design-Layer-FP8 (community quant, unofficial)
2
-
3
- Static selective FP8 quant of `inclusionAI/Ming-Image-0.1-Design-Layer` (MIT).
4
- 61 GB bf16/fp32 -> 25 GB mixed BF16 + F8_E4M3 safetensors. Layout mirrors upstream.
5
-
6
- Recipe: 2-D linear weights -> F8_E4M3 (torch saturating cast); kept at full
7
- precision: norms, embeddings, MoE routers/gates, biases, VAE, mlp/ heads
8
- (same keep-list as the mlx-community 8-bit tier). 15,365 tensors cast,
9
- 0 saturated (max|w| <= 448 everywhere). Deterministic, no calibration.
10
- Built with `src/tools/ming_quant/quantize_fp8.py` from
11
- workflow-aware-layer-decomposition.
12
-
13
- Loading: dequantize F8_E4M3 -> bf16 on load (e.g. accelerate auto offload);
14
- F8 compute needs torchao. No ComfyUI loader for the Layer checkpoint exists yet.
15
-
16
- ---
17
  ---
18
  license: mit
19
- library_name: custom
20
  pipeline_tag: image-text-to-image
21
- inference: false
22
  tags:
23
  - image-text-to-image
24
  - layer-decomposition
25
  - rgba
26
  - graphic-design
 
 
27
  ---
28
 
29
- # Ming-Image-0.1-Design-Layer
 
 
 
 
 
 
 
 
30
 
31
- [🧩 ModelScope](https://www.modelscope.cn/models/inclusionAI/Ming-Image-0.1-Design-Layer) · [🤗 Hugging Face](https://huggingface.co/inclusionAI/Ming-Image-0.1-Design-Layer) · [📄 Blog](https://mp.weixin.qq.com/s/VGdtxfM8kbHIQJw50VD_Sw) · [🖥️ Demo](https://huggingface.co/spaces/Xiaolong-Wang/Ming-Image-0.1-Design-Layer)<br>
32
- [🎨 Design Skill](https://github.com/inclusionAI/ling-cookbook/tree/main/resources/recommended-skills/ling-ui-design) · [📊 PPT Skill](https://github.com/inclusionAI/ling-cookbook/tree/main/resources/recommended-skills/image-to-editable-ppt)
33
 
34
- Ming-Image-0.1-Design-Layer decomposes a flattened design image into a
35
- requested number of RGBA layers using an image and a layer plan.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
- ## Quick Start
38
 
39
- Use the companion [Ming-Image repository](https://github.com/inclusionAI/Ming-Image)
40
- for installation and inference:
41
 
42
  ```bash
43
  git clone https://github.com/inclusionAI/Ming-Image
@@ -45,7 +59,7 @@ cd Ming-Image
45
  pip install -r requirements.txt
46
 
47
  python infer.py \
48
- --model inclusionAI/Ming-Image-0.1-Design-Layer \
49
  --task layer-decompose \
50
  --input-image assets/layer_samples/card_making_input.png \
51
  --prompt assets/layer_samples/card_making_prompt.txt \
@@ -54,59 +68,13 @@ python infer.py \
54
  --output-dir outputs/layers
55
  ```
56
 
57
- This runs the released six-layer card-making example. See the full
58
- [layer-decomposition demo](https://github.com/inclusionAI/Ming-Image#layer-decomposition-demo)
59
- for the output structure and layer-count behavior.
60
-
61
- Prompt enhancement (PE) can use `Ling-3.0-flash-VL` or `qwen3.8-27B`; see
62
- [layer-decomposition prompt rewriting](https://github.com/inclusionAI/Ming-Image#layer-decomposition-prompt-rewriting).
63
-
64
- ## Deployment
65
-
66
- We recommend the following inference frameworks to serve the model:
67
-
68
- - vLLM-Omni: see the [recipes](https://github.com/vllm-project/vllm-omni/blob/main/recipes/inclusionAI/Ming-Image.md)
69
- and [installation guide](https://docs.vllm.ai/projects/vllm-omni/en/latest/getting_started/quickstart/).
70
-
71
- ## Recommended settings
72
-
73
- - Working-resolution bucket: **1024** (recommended), or **512** for faster
74
- layer decomposition. The output preserves the input image's aspect ratio.
75
- - Sampling steps: **12**.
76
- - CFG scale: **2.0**.
77
- - Precision: **BF16**.
78
- - Hardware: **one CUDA GPU with 80 GiB VRAM** (validated configuration).
79
-
80
- Provide `--input-image` plus either a detailed layer specification through
81
- `--prompt`, or omit `--prompt` and set `--num-layers N` to create the default
82
- request. When `--prompt` is supplied, the layer count declared in that prompt
83
- controls the output count. The standalone outputs are saved as RGBA PNG files.
84
-
85
- ## Gallery
86
-
87
- <p align="center">
88
- <img src="./assets/showcase.webp" width="100%" alt="Ming-Image-0.1-Design-Layer decomposition example">
89
- </p>
90
-
91
- The example shows the input design, six decomposed layers, and the recomposed
92
- result.
93
-
94
- <p align="center">
95
- <img src="./assets/gallery.webp" width="100%" alt="Ming-Image-0.1-Design-Layer gallery">
96
- </p>
97
-
98
- The gallery shows additional flattened designs, their transparent layers, and
99
- the corresponding recomposed results.
100
-
101
- ## Performance
102
-
103
- <p align="center">
104
- <img src="./assets/performance.webp" width="100%" alt="Layer-decomposition results on the Crello test set">
105
- </p>
106
 
107
- The table reports quantitative layer-decomposition results on the Crello test
108
- set; lower RGB L1 and higher Alpha soft IoU are better.
109
 
110
- ## License
111
 
112
- This model is released under the [MIT License](./LICENSE).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ library_name: diffusers
4
  pipeline_tag: image-text-to-image
5
+ base_model: inclusionAI/Ming-Image-0.1-Design-Layer
6
  tags:
7
  - image-text-to-image
8
  - layer-decomposition
9
  - rgba
10
  - graphic-design
11
+ - fp8
12
+ - quantized
13
  ---
14
 
15
+ # ming-image-0.1-design-layer-fp8 (community quant, unofficial)
16
+
17
+ static selective fp8 quantization of [`inclusionAI/Ming-Image-0.1-Design-Layer`](https://huggingface.co/inclusionAI/Ming-Image-0.1-Design-Layer) (mit license).
18
+
19
+ | metric | upstream (bf16/fp32) | this quant (fp8 e4m3) | reduction |
20
+ |---|---|---|---|
21
+ | total size | ~61 GB | **~25 GB** | **-59%** |
22
+ | scheme | mixed bf16/fp32 | selective f8_e4m3 + bf16 | 0 / 15,365 saturated |
23
+ | linears | 2d linear weights | f8_e4m3 | norms/embeds/moe/vae kept |
24
 
25
+ ## quantization details
 
26
 
27
+ - **linear layers**: converted to `torch.float8_e4m3fn` with saturating cast.
28
+ - **preserved precision**: rmsnorm, token embeddings, moe routing gates, biases, vae, and mlp prediction heads remain in native precision (bf16/fp32).
29
+ - **quality**: verified zero saturation across all 15,365 cast tensors (`max|w| <= 448`). deterministic, calibration-free.
30
+ - **audit**: see [`quant_report.json`](./quant_report.json) for per-file layer statistics.
31
+
32
+ ## how to load & run
33
+
34
+ layout mirrors upstream (`connector/`, `mllm/`, `transformer/`, `vae/`).
35
+
36
+ ### 1. dequantize on load (in-memory)
37
+
38
+ load fp8 safetensors and cast to bf16 in memory to reduce disk footprint and transfer bandwidth:
39
+
40
+ ```python
41
+ import torch
42
+ from safetensors.torch import load_file
43
+
44
+ def load_fp8_state_dict(safetensors_path: str, target_dtype=torch.bfloat16):
45
+ state_dict = load_file(safetensors_path)
46
+ for k, v in state_dict.items():
47
+ if v.dtype == torch.float8_e4m3fn:
48
+ state_dict[k] = v.to(target_dtype)
49
+ return state_dict
50
+ ```
51
 
52
+ ### 2. upstream inference
53
 
54
+ use the official [Ming-Image](https://github.com/inclusionAI/Ming-Image) repository:
 
55
 
56
  ```bash
57
  git clone https://github.com/inclusionAI/Ming-Image
 
59
  pip install -r requirements.txt
60
 
61
  python infer.py \
62
+ --model 6chan/Ming-Image-0.1-Design-Layer-FP8 \
63
  --task layer-decompose \
64
  --input-image assets/layer_samples/card_making_input.png \
65
  --prompt assets/layer_samples/card_making_prompt.txt \
 
68
  --output-dir outputs/layers
69
  ```
70
 
71
+ ## comfyui status
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
 
73
+ no official loader exists for the layer checkpoint yet. comfyui support will be developed as a standalone custom node wrapper handling bailingmm2 conditioning and multi-frame rgba latents.
 
74
 
75
+ ## acknowledgements & links
76
 
77
+ - original model: [inclusionAI/Ming-Image-0.1-Design-Layer](https://huggingface.co/inclusionAI/Ming-Image-0.1-Design-Layer)
78
+ - demo space: [Xiaolong-Wang/Ming-Image-0.1-Design-Layer](https://huggingface.co/spaces/Xiaolong-Wang/Ming-Image-0.1-Design-Layer)
79
+ - source repo: [inclusionAI/Ming-Image](https://github.com/inclusionAI/Ming-Image)
80
+ - license: [MIT](./LICENSE)