蚂蚁 inclusionAI 开源 Ming-Image-0.1-Design 系列:两个 6B 视觉设计生成模型
GitHub - inclusionAI/Ming-Image · GitHub
蚂蚁 inclusionAI 在 GitHub 开源 Ming-Image-0.1-Design 系列,包含两个 6B 参数模型:Ming-Image-0.1-Design 生成 UI、信息图、海报等完整视觉设计,Ming-Image-0.1-Design-Layer 将扁平化设计图拆解为可独立编辑的透明图层。默认最低部署为单张 80 GiB 显存 GPU、BF16 精度,文本生图默认输出 2048 × 2048,图层拆解工作尺寸可选 512 或 1024。
正文
当前显示原文,中文全文译文尚未就绪。
inclusionAI; Ming-Image
Repository navigation
NotificationsYou must be signed in to change notification settings; Fork15 (15); Star193 (193)You must be signed in to star a repository
Repository files navigation
README; MIT license
📄 Blog · 🎨 Design Skill · 📊 PPT Skill
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:
Ming-Image-0.1-Design generates complete visual designs for UI, infographics, posters, and text-rich compositions; Ming-Image-0.1-Design-Layer decomposes flattened design images into independently editable transparent layers
Gallery
Text-to-image
Transparent-background text-to-image
Layer decomposition
Use with skills
Ling UI Design uses generated visual references and layer decomposition to help an agent build and visually check UI code from a prompt or screenshot; Image to Editable PPT helps an agent recreate one generated page or slide image as an editable PowerPoint slide, with text and simple shapes converted to native elements
These are separate agent workflows; follow each skill's setup instructions for its dependencies and compatible model service.
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:
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 size inputs are task-specific:
Pass --steps or --cfg to override either value explicitly. For text-to-image, pass --width and --height together (width × height). The pairs above use existing 2048-level aspect-ratio buckets. Other positive size pairs within a 1:4–4:1 ratio are accepted: inference uses the nearest 1024- or 2048-level internal size/aspect bucket and resizes the final image to the requested dimensions if needed. Omitting both gives 2048 × 2048. Legacy square text-to-image calls may still use --resolution; do not combine it with --width/--height. For layer decomposition, --resolution remains a working-size selector (512 or 1024), while the output preserves the input image's aspect ratio.
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.
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:
Text-to-image demo
Natural-language example (DeepInfra):
For better results, we recommend a Figma-style structured prompt and the corresponding prompt enhancer. The established example below renders one cabin across four seasons using the exact JSON prompt; the long prompt stays in its file.
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 requested canvas; set its aspect_ratio to match the chosen width and height.
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 and reproduced below:
Transparent-background generation tip
To generate an image with an alpha channel, choose exactly one of the following fixed phrases and place it at the beginning of the prompt. Do not combine multiple prefixes.
带透明通道,4通道RGBA图像; 透明背景,alpha通道,无底图; 抠图素材,背景alpha=0; 孤立主体,透明PNG图层; 不要白底,不要棋盘格,只要透明通道; RGBA, 4-channel, transparent background; isolated subject, alpha matte, no background; cutout PNG, alpha=0 outside the object; transparent canvas, not white, not checkerboard; production RGBA layer for compositing
Layer-decomposition demo
This example separates the flattened card design into six transparent RGBA layers. See the source input and the exact six-layer specification.
The layer count is parsed from a "Decompose this image into N layers" or "Number of layers: N" specification in the prompt. When --prompt is omitted, --num-layers N generates the default request Decompose this image into N layers.
The layer model returns the requested layers plus one leading composite/full-canvas image. The CLI skips that first image and saves the standalone layers as layer_01.png, layer_02.png, and so on.
Layer-decomposition prompt rewriting
Layer decomposition is driven by an explicit per-layer specification, not a free-form caption. The reference pipeline first runs a prompt enhancer: an instruction-following VLM rewrites the user's rough layer plan into a precise decomposition — concrete colors/positions/shapes per layer, real text quoted verbatim on its own front layer, a text-supporting card/panel/badge/banner as its own layer directly behind the text, the main subject as its own layer, and the background last absorbing the remaining supports and surfaces.
This rewrite is a pre-processing step outside infer.py: run the enhancer first, then pass its output to --prompt (as raw text or via an asset file). The enhancer's output is exactly the format this CLI parses — it regenerates the "Decompose this image into N layers" / "Number of layers: N" spec, so the layer count flows through the same --prompt parsing path described above.
Prompt enhancement (PE) can use Ling-3.0-flash-VL or qwen3.8-27B as the instruction-following VLM. The guided prompt below is part of the released pipeline and is kept here for reproducibility:
Deployment
We recommend the following inference frameworks to serve the model:
vLLM-Omni: see the recipes and installation guide
Verification
Fast contract tests do not require model weights:
Full inference is a GPU smoke test and requires both checkpoint families. At a minimum, validate the four-seasons-cabin text-to-image case and the six-layer card-making decomposition case with fixed seeds. The smoke test defaults to the single-GPU placement and FlashAttention 2 configuration shown above:
Checkpoint contract
Each checkpoint declares its runtime capability in transformer/config.json:
Both fields must be present together, and the VAE component must be the 4-channel AutoencoderKLQwenImage (argmax reference encoding). Missing, partial, or unknown values are errors; the loader never infers padding behavior from a directory name or silently falls back to another mode.
Legacy packages that predate the component metadata are loaded strictly from a root inference_profile.json during the compatibility window; when both exist, the component configs are authoritative and any disagreement with the legacy file is an error.