add diffusers compatible parameters

#1
by sayakpaul HF staff - opened
README.md CHANGED
@@ -9,4 +9,21 @@ TAESD is useful for [real-time previewing](https://twitter.com/madebyollin/statu
9
 
10
  This repo contains `.safetensors` versions of the TAESD weights.
11
 
12
- For SDXL, use [TAESDXL](https://huggingface.co/madebyollin/taesdxl/) instead (the SD and SDXL VAEs are [incompatible](https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/discussions/6#64b8a9c13707b7d603c6ac16)).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  This repo contains `.safetensors` versions of the TAESD weights.
11
 
12
+ For SDXL, use [TAESDXL](https://huggingface.co/madebyollin/taesdxl/) instead (the SD and SDXL VAEs are [incompatible](https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/discussions/6#64b8a9c13707b7d603c6ac16)).
13
+
14
+ ## Using in 🧨 diffusers
15
+
16
+ ```python
17
+ import torch
18
+ from diffusers import DiffusionPipeline, AutoencoderTiny
19
+
20
+ pipe = DiffusionPipeline.from_pretrained(
21
+ "stabilityai/stable-diffusion-2-1-base", torch_dtype=torch.float16
22
+ )
23
+ pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taesd", torch_dtype=torch.float16)
24
+ pipe = pipe.to("cuda")
25
+
26
+ prompt = "slice of delicious New York-style berry cheesecake"
27
+ image = pipe(prompt, num_inference_steps=25).images[0]
28
+ image.save("cheesecake.png")
29
+ ```
config.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "AutoencoderTiny",
3
+ "_diffusers_version": "0.20.0.dev0",
4
+ "act_fn": "relu",
5
+ "decoder_block_out_channels": [
6
+ 64,
7
+ 64,
8
+ 64,
9
+ 64
10
+ ],
11
+ "encoder_block_out_channels": [
12
+ 64,
13
+ 64,
14
+ 64,
15
+ 64
16
+ ],
17
+ "force_upcast": false,
18
+ "in_channels": 3,
19
+ "latent_channels": 4,
20
+ "latent_magnitude": 3,
21
+ "latent_shift": 0.5,
22
+ "num_decoder_blocks": [
23
+ 3,
24
+ 3,
25
+ 3,
26
+ 1
27
+ ],
28
+ "num_encoder_blocks": [
29
+ 1,
30
+ 3,
31
+ 3,
32
+ 3
33
+ ],
34
+ "out_channels": 3,
35
+ "scaling_factor": 1.0,
36
+ "upsampling_scaling_factor": 2
37
+ }
diffusion_pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6cf564d324a6dd7f66b9fa2daeb5cdeea479b67502aacd13f71c05abfd8e3737
3
+ size 9832437
diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:afc4dc0f168f575a92d6a5115dd8dd05bb7b30c393793d67a47250716a1d9478
3
+ size 9793292