RepoInclusionAI (Ant Group)InclusionAI (Ant Group)published Oct 29, 2026seen 9h

inclusionAI/IDM

Python

Open original ↗

Captured source

source ↗
published Oct 29, 2026seen 9hcaptured 9hhttp 200method plain

inclusionAI/IDM

Description: Official inference code for Intrinsic Distribution Matching (IDM). Model weights: coming soon.

Language: Python

License: Apache-2.0

Stars: 2

Forks: 0

Open issues: 0

Created: 2026-10-29T11:13:43Z

Pushed: 2026-10-30T06:01:37Z

Default branch: main

Fork: no

Archived: no

README: IDM

Intrinsic Distribution Matching

Deyuan Liu† · Yansen Han† · Kaiwen Zheng† · Jun Xie · Jiacheng Liu

Zhenglin Cheng · Peng Sun · Jintao Zhang* · Jianguo Li* · Tao Lin*

Inclusion AI · Westlake University · Tsinghua University

Zhejiang University · Shanghai Innovation Institute · MBZUAI

† Equal contribution * Corresponding authors

Results · Method · Inference · Checkpoints

IDM improves one-step and few-step text-to-image generation by combining internal distribution matching distillation (DMD) with moment matching in the generator's own EMA feature space. No external feature encoder is required. The same trained checkpoint supports both 1-NFE and 2-NFE sampling.

IDM (Z-Image), 2 NFE. Samples from the paper.

Core results

  • Long-text rendering: 94.25% on LongText-CN and 90.20% on LongText-EN at 2 NFE, the highest scores among the methods compared at this budget.
  • Fast generation: full-parameter IDM (Z-Image) takes 0.25 s at 1 NFE and 0.30 s at 2 NFE; IDM (Qwen-Image) takes 0.35 s and 0.44 s, respectively, on a single A100 in BF16.
  • Useful internal features: adding EMA feature-moment matching improves all five reported aggregate metrics over the shared internal DMD control. Its results are close to those obtained with DINOv2 features.

All values below are reported in the paper. They are not measurements from running this repository.

Long-text rendering and general quality

Z-Image comparisons at 2 NFE. All scores are percentages; higher is better.

| Method | NFE | OneIG | GenEval | DPG-Bench | LongText-CN | LongText-EN | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | Z-Image-Turbo | 2 | 50.94 | 76.53 | 85.78 | 78.48 | 72.89 | | DMD2 | 2 | 50.70 | 76.12 | 85.40 | 85.30 | 80.99 | | TwinFlow | 2 | 51.38 | 72.41 | 85.98 | 78.65 | 71.99 | | APEX | 2 | 52.60 | 77.23 | 88.64 | 90.38 | 88.76 | | Z-Image-Turbo++ | 2 | 52.50 | 75.70 | 85.86 | 91.62 | 89.88 | | IDM | 2 | 53.06 | 77.81 | 86.82 | 94.25 | 90.20 | | Z-Image-Turbo (higher-NFE reference) | 8 | 52.84 | 75.01 | 84.86 | 92.56 | 91.74 |

At 2 NFE, IDM improves LongText-CN/EN over Z-Image-Turbo++ by 2.63 / 0.32 percentage points, and over APEX by 3.87 / 1.44 points. The 8-NFE reference retains a higher LongText-EN score. Published reference models have different training settings and data; APEX also scores higher on DPG-Bench. The controlled ablations below measure the contribution of IDM's individual components within a shared setting.

Quality and efficiency across both backbones

Selected results from the paper's system-level comparison. Throughput uses batch size 10; latency uses batch size 1, both on a single A100 in BF16. LoRA weights are merged before timing. FID is lower-is-better; CLIP and GenEval are higher-is-better. GenEval here uses the paper's 0–1 scale.

| Backbone | Tuning | NFE | FID ↓ | CLIP ↑ | GenEval ↑ | Latency (s) ↓ | Throughput (images/s) ↑ | | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | | Z-Image-Turbo 6B | Full | 1 | 7.13 | 28.37 | 0.77 | 0.25 | 5.41 | | Z-Image-Turbo 6B | Full | 2 | 6.71 | 28.22 | 0.78 | 0.30 | 5.18 | | Z-Image-Turbo 6B | LoRA r=64 | 2 | 6.79 | 28.13 | 0.77 | 0.30 | 5.18 | | Qwen-Image 20B | Full | 1 | 6.77 | 28.71 | 0.90 | 0.35 | 3.44 | | Qwen-Image 20B | Full | 2 | 6.34 | 28.56 | 0.91 | 0.44 | 3.28 | | Qwen-Image 20B | LoRA r=64 | 2 | 6.41 | 28.47 | 0.90 | 0.44 | 3.28 |

The full Qwen-Image model also reaches 87.16% DPG-Bench and 0.56 WISE at 2 NFE. Rank-64 LoRA updates 0.4B parameters and retains most of the full model's GenEval performance.

What does the added moment loss contribute?

Controlled ablations use full-parameter IDM (Z-Image) at 2 NFE, with the same data and training configuration. All values are percentages.

| Configuration | OneIG | GenEval | DPG-Bench | LongText-CN | LongText-EN | | --- | ---: | ---: | ---: | ---: | ---: | | Without DMD or feature-moment loss | 52.25 | 76.24 | 85.68 | 92.70 | 88.88 | | Without DMD loss | 52.58 | 76.90 | 86.15 | 93.33 | 89.62 | | Internal DMD, without feature-moment loss | 52.87 | 77.46 | 86.54 | 93.87 | 89.79 | | DMD + moment loss with DINOv2 features | 53.00 | 77.75 | 86.71 | 94.13 | 90.09 | | IDM: DMD + moment loss with generator EMA features | 53.06 | 77.81 | 86.82 | 94.25 | 90.20 |

Adding the EMA feature-moment loss to the internal DMD control gives +0.19 OneIG, +0.35 GenEval, +0.28 DPG-Bench, +0.38 LongText-CN, and +0.41 LongText-EN. DINOv2 features also improve the control; the small differences support the use of the generator's own representation without requiring an external encoder.

Why combine velocity and endpoint regression?

The choice is empirical. With feature-moment matching retained in every row, equal-weight velocity + endpoint regression leads on all five aggregate metrics.

| DMD regression | OneIG | GenEval | DPG-Bench | LongText-CN | LongText-EN | | --- | ---: | ---: | ---: | ---: | ---: | | Velocity only | 52.43 | 76.64 | 85.93 | 93.03 | 89.17 | | Endpoint only | 52.78 | 77.26 | 86.42 | 93.71 | 89.74 | | 2 × endpoint + velocity | 53.01 | 77.71 | 86.75 | 94.17 | 90.13 | | Endpoint + 2 × velocity | 52.95 | 77.59 | 86.66 | 94.05 | 90.04 | | Endpoint + velocity | 53.06 | 77.81 | 86.82 | 94.25 | 90.20 |

These regressions apply different time weightings to the same detached DMD correction. They do not provide two independent sources of distributional information.

Method

DMD uses a score difference between generated and reference distributions to supervise a fast generator. Following APEX, IDM obtains this difference from internal velocity branches, avoiding a separate fake-score network.

A Gaussian-plus-residual decomposition of the reverse-KL field motivates an explicit constraint on moments. IDM keeps the full DMD correction and adds a loss matching the means and per-coordinate standard deviations of features from the generator's EMA copy. Moment matching complements the score correction; it does not replace the residual part of the distributional signal.

At inference, only the learned conditional generator, text...

Excerpt shown — open the source for the full document.