Instructions to use diffusers/consistency_models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use diffusers/consistency_models with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("diffusers/consistency_models", 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
Download diffusers_cd_imagenet64_l2/config.json from diffusers/consistency_models: direct link, hf CLI and curl.
- Browser
- Download file 957 Bytes
-
https://huggingface.co/diffusers/consistency_models/resolve/refs%2Fpr%2F1/diffusers_cd_imagenet64_l2/config.json
- Command line
-
hf download hf://diffusers/consistency_models@refs/pr/1/diffusers_cd_imagenet64_l2/config.json
-
curl -L -o config.json https://huggingface.co/diffusers/consistency_models/resolve/refs%2Fpr%2F1/diffusers_cd_imagenet64_l2/config.json
957 Bytes
| { | |
| "_class_name": "UNet2DModel", | |
| "_diffusers_version": "0.21.0.dev0", | |
| "act_fn": "silu", | |
| "add_attention": true, | |
| "attention_head_dim": 64, | |
| "attn_norm_num_groups": 32, | |
| "block_out_channels": [ | |
| 192, | |
| 384, | |
| 576, | |
| 768 | |
| ], | |
| "center_input_sample": false, | |
| "class_embed_type": null, | |
| "down_block_types": [ | |
| "ResnetDownsampleBlock2D", | |
| "AttnDownBlock2D", | |
| "AttnDownBlock2D", | |
| "AttnDownBlock2D" | |
| ], | |
| "downsample_padding": 1, | |
| "downsample_type": "resnet", | |
| "flip_sin_to_cos": true, | |
| "freq_shift": 0, | |
| "in_channels": 3, | |
| "layers_per_block": 3, | |
| "mid_block_scale_factor": 1, | |
| "norm_eps": 1e-05, | |
| "norm_num_groups": 32, | |
| "num_class_embeds": 1000, | |
| "out_channels": 3, | |
| "resnet_time_scale_shift": "scale_shift", | |
| "sample_size": 64, | |
| "time_embedding_type": "positional", | |
| "up_block_types": [ | |
| "AttnUpBlock2D", | |
| "AttnUpBlock2D", | |
| "AttnUpBlock2D", | |
| "ResnetUpsampleBlock2D" | |
| ], | |
| "upsample_type": "resnet" | |
| } | |