Instructions to use 6chan/Ming-Image-0.1-Design-Layer-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use 6chan/Ming-Image-0.1-Design-Layer-FP8 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("6chan/Ming-Image-0.1-Design-Layer-FP8", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
docs: standardize model card with compliant frontmatter and lowercase headings
Browse files
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:
|
| 20 |
pipeline_tag: image-text-to-image
|
| 21 |
-
|
| 22 |
tags:
|
| 23 |
- image-text-to-image
|
| 24 |
- layer-decomposition
|
| 25 |
- rgba
|
| 26 |
- graphic-design
|
|
|
|
|
|
|
| 27 |
---
|
| 28 |
|
| 29 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
|
| 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 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
##
|
| 38 |
|
| 39 |
-
|
| 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
|
| 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 |
-
|
| 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 |
-
|
| 108 |
-
set; lower RGB L1 and higher Alpha soft IoU are better.
|
| 109 |
|
| 110 |
-
##
|
| 111 |
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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)
|