celik-muhammed patrickvonplaten commited on
Commit
3ddd840
·
0 Parent(s):

Duplicate from openai/consistency-decoder

Browse files

Co-authored-by: Patrick von Platen <patrickvonplaten@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: diffusers
3
+ tags:
4
+ - stable-diffusion
5
+ license: mit
6
+ ---
7
+
8
+ ## Consistency Decoder
9
+
10
+ This is a decoder that can be used to improve decoding for Stable Diffusion VAEs. To know more, refer to the [DALL-E 3 technical report](https://cdn.openai.com/papers/dall-e-3.pdf).
11
+
12
+ To original code repository can be found [here](https://github.com/openai/consistencydecoder).
13
+
14
+ ## Usage in 🧨 diffusers
15
+
16
+ ```python
17
+ import torch
18
+ from diffusers import DiffusionPipeline, ConsistencyDecoderVAE
19
+
20
+ vae = ConsistencyDecoderVAE.from_pretrained("openai/consistency-decoder", torch_dtype=pipe.torch_dtype)
21
+ pipe = StableDiffusionPipeline.from_pretrained(
22
+ "runwayml/stable-diffusion-v1-5", vae=vae, torch_dtype=torch.float16
23
+ ).to("cuda")
24
+
25
+ pipe("horse", generator=torch.manual_seed(0)).images
26
+ ```
27
+
28
+ ## Results
29
+
30
+ _(Taken from the original [code repository](https://github.com/openai/consistencydecoder))_
31
+
32
+ ## Examples
33
+ Original Image | GAN Decoder | Consistency Decoder |
34
+ :---:|:---:|:---:|
35
+ ![Original Image](https://github.com/openai/consistencydecoder/blob/main/assets/gt1.png?raw=true) | ![GAN Image](https://github.com/openai/consistencydecoder/blob/main/assets/gan1.png?raw=true) | ![VAE Image](https://github.com/openai/consistencydecoder/blob/main/assets/con1.png?raw=true) |
36
+ ![Original Image](https://github.com/openai/consistencydecoder/blob/main/assets/gt2.png?raw=true) | ![GAN Image](https://github.com/openai/consistencydecoder/blob/main/assets/gan2.png?raw=true) | ![VAE Image](https://github.com/openai/consistencydecoder/blob/main/assets/con2.png?raw=true) |
37
+ ![Original Image](https://github.com/openai/consistencydecoder/blob/main/assets/gt3.png?raw=true) | ![GAN Image](https://github.com/openai/consistencydecoder/blob/main/assets/gan3.png?raw=true) | ![VAE Image](https://github.com/openai/consistencydecoder/blob/main/assets/con3.png?raw=true) |
config.json ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "ConsistencyDecoderVAE",
3
+ "_diffusers_version": "0.23.0.dev0",
4
+ "_name_or_path": "openai/consistency-decoder",
5
+ "decoder_add_attention": false,
6
+ "decoder_block_out_channels": [
7
+ 320,
8
+ 640,
9
+ 1024,
10
+ 1024
11
+ ],
12
+ "decoder_down_block_types": [
13
+ "ResnetDownsampleBlock2D",
14
+ "ResnetDownsampleBlock2D",
15
+ "ResnetDownsampleBlock2D",
16
+ "ResnetDownsampleBlock2D"
17
+ ],
18
+ "decoder_downsample_padding": 1,
19
+ "decoder_in_channels": 7,
20
+ "decoder_layers_per_block": 3,
21
+ "decoder_norm_eps": 1e-05,
22
+ "decoder_norm_num_groups": 32,
23
+ "decoder_num_train_timesteps": 1024,
24
+ "decoder_out_channels": 6,
25
+ "decoder_resnet_time_scale_shift": "scale_shift",
26
+ "decoder_time_embedding_type": "learned",
27
+ "decoder_up_block_types": [
28
+ "ResnetUpsampleBlock2D",
29
+ "ResnetUpsampleBlock2D",
30
+ "ResnetUpsampleBlock2D",
31
+ "ResnetUpsampleBlock2D"
32
+ ],
33
+ "encoder_act_fn": "silu",
34
+ "encoder_block_out_channels": [
35
+ 128,
36
+ 256,
37
+ 512,
38
+ 512
39
+ ],
40
+ "encoder_double_z": true,
41
+ "encoder_down_block_types": [
42
+ "DownEncoderBlock2D",
43
+ "DownEncoderBlock2D",
44
+ "DownEncoderBlock2D",
45
+ "DownEncoderBlock2D"
46
+ ],
47
+ "encoder_in_channels": 3,
48
+ "encoder_layers_per_block": 2,
49
+ "encoder_norm_num_groups": 32,
50
+ "encoder_out_channels": 4,
51
+ "latent_channels": 4,
52
+ "scaling_factor": 0.18215
53
+ }
diffusion_pytorch_model.fp16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df6386a06f741c7dfaaa4709b6db39aca345a406d8413dc2c4dbd48a0dce1cfb
3
+ size 1310944884
diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df6386a06f741c7dfaaa4709b6db39aca345a406d8413dc2c4dbd48a0dce1cfb
3
+ size 1310944884