RepoInclusionAI (Ant Group)InclusionAI (Ant Group)published Sep 17, 2026seen 2w

inclusionAI/Ming-Image

Python

Open original ↗

Captured source

source ↗
published Sep 17, 2026seen 2wcaptured 2whttp 200method plain

inclusionAI/Ming-Image

Language: Python

License: MIT

Stars: 40

Forks: 2

Open issues: 0

Created: 2026-09-17T11:17:49Z

Pushed: 2026-09-22T14:59:25Z

Default branch: main

Fork: no

Archived: no

README:

Ming Image 0.1 Design

Ming-Image-0.1-Design is an open-source series for visual-design generation and editable layer decomposition.

The series includes two 6B-parameter models:

generates complete visual designs for UI, infographics, posters, and text-rich compositions.

decomposes flattened design images into independently editable transparent layers.

![Ming-Image-0.1-Design on the Artificial Analysis UI/UX Design leaderboard](assets/ming-image-design-ui-ux-leaderboard.webp)

Gallery

Text-to-image

![Text-to-image showcase](assets/model_cards/design_showcase.webp)

Transparent-background text-to-image

![Transparent-background text-to-image showcase](assets/model_cards/design_transparency_showcase.webp)

Layer decomposition

![Six-layer card decomposition showcase](assets/model_cards/layer_showcase.webp)

![Layer-decomposition gallery](assets/model_cards/layer_gallery.webp)

![Layer-decomposition results on the Crello test set](assets/model_cards/layer_performance.webp)

Requirements

  • Python 3.10 or newer;
  • CUDA-capable PyTorch for full model inference;
  • a local checkpoint directory or a Hugging Face Hub repository ID.

Install the runtime dependencies in a clean environment:

pip install -r requirements.txt

flash_attention_2 is optional. The CLI defaults to eager attention because the LLM only implements eager and FlashAttention 2 attention classes; the diffusion transformer always uses PyTorch SDPA internally. Selecting --attn-implementation sdpa fails closed at load time.

Inference

The --model argument accepts either a local directory or an HF Hub repo ID. Hub models are resolved to one immutable local snapshot before any component is loaded. Use --revision to pin a branch, tag or commit. The examples use the published Hub IDs; replace them with local checkpoint directories for offline inference.

Sampling defaults and public resolution buckets are task-specific:

| Task | Steps | CFG | Resolution buckets | Default / recommended | | --- | ---: | ---: | --- | ---: | | Text-to-image | 12 | 1.0 | 1024, 2048 | 2048 | | Layer decomposition | 12 | 2.0 | 512, 1024 | 1024 |

Pass --steps or --cfg to override either value explicitly. --resolution is optional. A supplied positive integer snaps to the nearest bucket supported by the selected task, with ties going to the smaller bucket. For faster layer decomposition, explicitly pass --resolution 512; use 1024 for the recommended output quality. Text-to-image output is square at the selected bucket. Layer decomposition preserves the reference image's aspect ratio while selecting a predefined working size from the effective 1024 or 512 bucket.

The default and minimum validated deployment is one GPU with at least 80 GiB of memory, running in BF16. This configuration passes both model families end-to-end, and all demos below use it by default.

export CUDA_VISIBLE_DEVICES=0

Select --attn-implementation flash_attention_2 when FlashAttention 2 is installed; the portable CLI default remains eager.

For both tasks, --prompt accepts either raw text or a path to a prompt file. Use --validate-only to check the checkpoint contract and task combination without loading model weights:

python infer.py --model inclusionAI/Ming-Image-0.1-Design --task text-to-image \
--prompt "A red circle on a white background" --validate-only

Text-to-image demo

This demo renders a fixed cabin across spring, summer, autumn, and winter. It uses the [exact structured JSON prompt](assets/t2i_four_seasons_cabin_prompt.json) without duplicating that long input in the README.

python infer.py \
--model inclusionAI/Ming-Image-0.1-Design \
--task text-to-image \
--prompt assets/t2i_four_seasons_cabin_prompt.json \
--attn-implementation flash_attention_2 \
--resolution 2048 \
--output-dir outputs/t2i

Text-to-image prompt rewriting

An instruction-following VLM can turn a short caption into a precise, layout-structured JSON description: Figma-style layers ordered back to front, with exact coordinates, hierarchy, color specs, and every rendered string quoted verbatim and owned exactly once. Unlike layer decomposition, the text-to-image rewriter describes the complete 1:1 canvas.

This rewrite is a pre-processing step *outside* infer.py. Prompt enhancement (PE) can use Ling-3.0-flash-VL or qwen3.8-27B; run it first, then pass its output to --prompt as raw text or via an asset file.

The released system prompt is stored in [assets/t2i_rewriter_system_prompt.txt](assets/t2i_rewriter_system_prompt.txt) and reproduced below:

You are a senior visual designer and image-prompt engineer. Expand the user's request into one precise, high-resolution Figma-style caption. Return only one JSON object.

Use exactly two top-level keys. `canvas_settings` contains exactly `aspect_ratio`, `ambient_lighting`, and `image_style`. `layers` lists visible groups from background to topmost overlay. Every layer contains exactly `description`, `coordinates`, `hierarchy_and_relation`, and `color_specs`; `color_specs` is an array of hex colors.

`coordinates` MUST be one string, never an object or array, in exactly this form: `"cx: 0.500, cy: 0.500, w: 1.000, h: 1.000"`. Values are normalized; each bbox encloses its complete owned object and stays inside the canvas.

A layer is one selectable visible semantic group: background, full person, coherent object, panel, card, row, or text block. Prefer the fewest groups that preserve the layout. Keep people and objects intact. Never create invisible parents, guides, placeholders, empty layers, duplicate summaries, or multiple owners for one element.

Preserve every user-supplied rendered string character-for-character and as one contiguous string. Unless multiple visible copies are requested, it must occur exactly once across all `description` fields and zero times in `hierarchy_and_relation`. Quote it only where describing its visible rendering; refer to the related subject elsewhere with unquoted semantic wording. Enumerate intended copy,...

Excerpt shown — open the source for the full document.