Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

consistency_models

> 编程语言
Open source

Official repo for consistency models.

6.5K stars0 likes1 views
WebsiteGitHub

About

Official repo for consistency models.

Consistency Models

This repository contains the codebase for Consistency Models, implemented using PyTorch for conducting large-scale experiments on ImageNet-64, LSUN Bedroom-256, and LSUN Cat-256. We have based our repository on openai/guided-diffusion, which was initially released under the MIT license. Our modifications have enabled support for consistency distillation, consistency training, as well as several sampling and editing algorithms discussed in the paper.

The repository for CIFAR-10 experiments is in JAX and can be found at openai/consistency_models_cifar10.

Pre-trained models

We have released checkpoints for the main models in the paper. Before using these models, please review the corresponding model card to understand the intended use and limitations of these models.

Here are the download links for each model checkpoint:

  • EDM on ImageNet-64: edm_imagenet64_ema.pt
  • CD on ImageNet-64 with l2 metric: cd_imagenet64_l2.pt
  • CD on ImageNet-64 with LPIPS metric: cd_imagenet64_lpips.pt
  • CT on ImageNet-64: ct_imagenet64.pt
  • EDM on LSUN Bedroom-256: edm_bedroom256_ema.pt
  • CD on LSUN Bedroom-256 with l2 metric: cd_bedroom256_l2.pt
  • CD on LSUN Bedroom-256 with LPIPS metric: cd_bedroom256_lpips.pt
  • CT on LSUN Bedroom-256: ct_bedroom256.pt
  • EDM on LSUN Cat-256: edm_cat256_ema.pt
  • CD on LSUN Cat-256 with l2 metric: cd_cat256_l2.pt
  • CD on LSUN Cat-256 with LPIPS metric: cd_cat256_lpips.pt
  • CT on LSUN Cat-256: ct_cat256.pt

Dependencies

To install all packages in this codebase along with their dependencies, run

bash
pip install -e .

To install with Docker, run the following commands:

bash
cd docker && make build && make run

Model training and sampling

We provide examples of EDM training, consistency distillation, consistency training, single-step generation, and multistep generation in scripts/launch.sh.

Evaluations

To compare different generative models, we use FID, Precision, Recall, and Inception Score. These metrics can all be calculated using batches of samples stored in .npz (numpy) files. One can evaluate samples with cm/evaluations/evaluator.py in the same way as described in openai/guided-diffusion, with reference dataset batches provided therein.

Use in diffusers

Consistency models are supported in diffusers via the ConsistencyModelPipeline class. Below we provide an example:

…

You can further speed up the inference process by using torch.compile() on pipe.unet (only supported from PyTorch 2.0). For more details, please check out the official documentation. This support was contributed to diffusers by dg845 and ayushtues.

Citation

If you find this method and/or code useful, please consider citing

bibtex
@article{song2023consistency,
  title={Consistency Models},
  author={Song, Yang and Dhariwal, Prafulla and Chen, Mark and Sutskever, Ilya},
  journal={arXiv preprint arXiv:2303.01469},
  year={2023},
}

Issues· 51 open

View all issuesOpen on GitHub
  • #55

    Is there a non-stochastic sampling method?

    Updated Nov 10, 2025
  • #70

    run imagenet 64x64 with lpips and get the same results ?

    Updated Mar 23, 2025
  • #10

    Evaluation: Reference Batches for CIFAR10

    Updated Feb 24, 2025
  • #69

    error during Getting requirements to build wheel

    Updated Feb 14, 2025
  • #66

    What is the difference between Latent Consistency Models and Consistency Models?

    Updated Dec 19, 2024
  • #12

    Inconsistent loss term with paper

    Updated Dec 17, 2024
  • #65

    the parameter "ts" and "step" in EDM Sample and CD sample

    Updated Nov 6, 2024
  • #7

    Multistep sampling in Algorithm 1

    Updated Nov 5, 2024
  • #51

    Why does the training not stop?

    Updated Sep 24, 2024
  • #64

    from flash_attn.flash_attention import FlashAttention . Where is FlashAttention?Why can't I import it?

    Updated Jun 17, 2024

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 24, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言