cam
#139
by
CamRule
- opened
- .gitattributes +0 -1
- README.md +31 -29
- model_index.json +1 -1
- safety_checker/model.fp16.safetensors +0 -3
- safety_checker/model.safetensors +0 -3
- safety_checker/pytorch_model.fp16.bin +0 -3
- text_encoder/model.fp16.safetensors +0 -3
- text_encoder/model.safetensors +0 -3
- text_encoder/pytorch_model.fp16.bin +0 -3
- unet/diffusion_pytorch_model.fp16.bin +0 -3
- unet/diffusion_pytorch_model.fp16.safetensors +0 -3
- unet/diffusion_pytorch_model.non_ema.bin +0 -3
- unet/diffusion_pytorch_model.non_ema.safetensors +0 -3
- unet/diffusion_pytorch_model.safetensors +0 -3
- vae/config.json +0 -1
- vae/diffusion_pytorch_model.fp16.bin +0 -3
- vae/diffusion_pytorch_model.fp16.safetensors +0 -3
- vae/diffusion_pytorch_model.safetensors +0 -3
.gitattributes
CHANGED
@@ -29,4 +29,3 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
29 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
30 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
31 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
32 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
|
|
29 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
30 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
31 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
README.md
CHANGED
@@ -4,27 +4,21 @@ tags:
|
|
4 |
- stable-diffusion
|
5 |
- stable-diffusion-diffusers
|
6 |
- text-to-image
|
7 |
-
|
8 |
-
- text: "A high tech solarpunk utopia in the Amazon rainforest"
|
9 |
-
example_title: Amazon rainforest
|
10 |
-
- text: "A pikachu fine dining with a view to the Eiffel Tower"
|
11 |
-
example_title: Pikachu in Paris
|
12 |
-
- text: "A mecha robot in a favela in expressionist style"
|
13 |
-
example_title: Expressionist robot
|
14 |
-
- text: "an insect robot preparing a delicious meal"
|
15 |
-
example_title: Insect robot
|
16 |
-
- text: "A small cabin on top of a snowy mountain in the style of Disney, artstation"
|
17 |
-
example_title: Snowy disney cabin
|
18 |
extra_gated_prompt: |-
|
|
|
19 |
This model is open access and available to all, with a CreativeML OpenRAIL-M license further specifying rights and usage.
|
20 |
The CreativeML OpenRAIL License specifies:
|
21 |
|
22 |
1. You can't use the model to deliberately produce nor share illegal or harmful outputs or content
|
23 |
-
2.
|
24 |
3. You may re-distribute the weights and use the model commercially and/or as a service. If you do, please be aware you have to include the same use restrictions as the ones in the license and share a copy of the CreativeML OpenRAIL-M to all your users (please read the license entirely and carefully)
|
25 |
-
Please read the full license
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
28 |
---
|
29 |
|
30 |
# Stable Diffusion v1-4 Model Card
|
@@ -65,38 +59,46 @@ We recommend using [🤗's Diffusers library](https://github.com/huggingface/dif
|
|
65 |
pip install --upgrade diffusers transformers scipy
|
66 |
```
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
Running the pipeline with the default PNDM scheduler:
|
69 |
|
70 |
```python
|
71 |
import torch
|
|
|
72 |
from diffusers import StableDiffusionPipeline
|
73 |
|
74 |
model_id = "CompVis/stable-diffusion-v1-4"
|
75 |
device = "cuda"
|
76 |
|
77 |
|
78 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id,
|
79 |
pipe = pipe.to(device)
|
80 |
|
81 |
prompt = "a photo of an astronaut riding a horse on mars"
|
82 |
-
|
|
|
83 |
|
84 |
image.save("astronaut_rides_horse.png")
|
85 |
```
|
86 |
|
87 |
**Note**:
|
88 |
-
If you are limited by GPU memory and have less than
|
89 |
|
90 |
|
91 |
```py
|
92 |
import torch
|
93 |
|
94 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
95 |
pipe = pipe.to(device)
|
96 |
-
pipe.enable_attention_slicing()
|
97 |
|
98 |
prompt = "a photo of an astronaut riding a horse on mars"
|
99 |
-
|
|
|
100 |
|
101 |
image.save("astronaut_rides_horse.png")
|
102 |
```
|
@@ -104,17 +106,17 @@ image.save("astronaut_rides_horse.png")
|
|
104 |
To swap out the noise scheduler, pass it to `from_pretrained`:
|
105 |
|
106 |
```python
|
107 |
-
from diffusers import StableDiffusionPipeline,
|
108 |
|
109 |
model_id = "CompVis/stable-diffusion-v1-4"
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, torch_dtype=torch.float16)
|
114 |
pipe = pipe.to("cuda")
|
115 |
|
116 |
prompt = "a photo of an astronaut riding a horse on mars"
|
117 |
-
|
|
|
118 |
|
119 |
image.save("astronaut_rides_horse.png")
|
120 |
```
|
@@ -148,7 +150,7 @@ prompt_ids = pipeline.prepare_inputs(prompt)
|
|
148 |
|
149 |
# shard inputs and rng
|
150 |
params = replicate(params)
|
151 |
-
prng_seed = jax.random.split(prng_seed,
|
152 |
prompt_ids = shard(prompt_ids)
|
153 |
|
154 |
images = pipeline(prompt_ids, params, prng_seed, num_inference_steps, jit=True).images
|
@@ -181,7 +183,7 @@ prompt_ids = pipeline.prepare_inputs(prompt)
|
|
181 |
|
182 |
# shard inputs and rng
|
183 |
params = replicate(params)
|
184 |
-
prng_seed = jax.random.split(prng_seed,
|
185 |
prompt_ids = shard(prompt_ids)
|
186 |
|
187 |
images = pipeline(prompt_ids, params, prng_seed, num_inference_steps, jit=True).images
|
|
|
4 |
- stable-diffusion
|
5 |
- stable-diffusion-diffusers
|
6 |
- text-to-image
|
7 |
+
inference: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
extra_gated_prompt: |-
|
9 |
+
One more step before getting this model.
|
10 |
This model is open access and available to all, with a CreativeML OpenRAIL-M license further specifying rights and usage.
|
11 |
The CreativeML OpenRAIL License specifies:
|
12 |
|
13 |
1. You can't use the model to deliberately produce nor share illegal or harmful outputs or content
|
14 |
+
2. CompVis claims no rights on the outputs you generate, you are free to use them and are accountable for their use which must not go against the provisions set in the license
|
15 |
3. You may re-distribute the weights and use the model commercially and/or as a service. If you do, please be aware you have to include the same use restrictions as the ones in the license and share a copy of the CreativeML OpenRAIL-M to all your users (please read the license entirely and carefully)
|
16 |
+
Please read the full license here: https://huggingface.co/spaces/CompVis/stable-diffusion-license
|
17 |
+
|
18 |
+
By clicking on "Access repository" below, you accept that your *contact information* (email address and username) can be shared with the model authors as well.
|
19 |
+
|
20 |
+
extra_gated_fields:
|
21 |
+
I have read the License and agree with its terms: checkbox
|
22 |
---
|
23 |
|
24 |
# Stable Diffusion v1-4 Model Card
|
|
|
59 |
pip install --upgrade diffusers transformers scipy
|
60 |
```
|
61 |
|
62 |
+
Run this command to log in with your HF Hub token if you haven't before:
|
63 |
+
|
64 |
+
```bash
|
65 |
+
huggingface-cli login
|
66 |
+
```
|
67 |
+
|
68 |
Running the pipeline with the default PNDM scheduler:
|
69 |
|
70 |
```python
|
71 |
import torch
|
72 |
+
from torch import autocast
|
73 |
from diffusers import StableDiffusionPipeline
|
74 |
|
75 |
model_id = "CompVis/stable-diffusion-v1-4"
|
76 |
device = "cuda"
|
77 |
|
78 |
|
79 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=True)
|
80 |
pipe = pipe.to(device)
|
81 |
|
82 |
prompt = "a photo of an astronaut riding a horse on mars"
|
83 |
+
with autocast("cuda"):
|
84 |
+
image = pipe(prompt, guidance_scale=7.5).images[0]
|
85 |
|
86 |
image.save("astronaut_rides_horse.png")
|
87 |
```
|
88 |
|
89 |
**Note**:
|
90 |
+
If you are limited by GPU memory and have less than 10GB of GPU RAM available, please make sure to load the StableDiffusionPipeline in float16 precision instead of the default float32 precision as done above. You can do so by telling diffusers to expect the weights to be in float16 precision:
|
91 |
|
92 |
|
93 |
```py
|
94 |
import torch
|
95 |
|
96 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, revision="fp16", use_auth_token=True)
|
97 |
pipe = pipe.to(device)
|
|
|
98 |
|
99 |
prompt = "a photo of an astronaut riding a horse on mars"
|
100 |
+
with autocast("cuda"):
|
101 |
+
image = pipe(prompt, guidance_scale=7.5).images[0]
|
102 |
|
103 |
image.save("astronaut_rides_horse.png")
|
104 |
```
|
|
|
106 |
To swap out the noise scheduler, pass it to `from_pretrained`:
|
107 |
|
108 |
```python
|
109 |
+
from diffusers import StableDiffusionPipeline, LMSDiscreteScheduler
|
110 |
|
111 |
model_id = "CompVis/stable-diffusion-v1-4"
|
112 |
+
# Use the K-LMS scheduler here instead
|
113 |
+
scheduler = LMSDiscreteScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear", num_train_timesteps=1000)
|
114 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, use_auth_token=True)
|
|
|
115 |
pipe = pipe.to("cuda")
|
116 |
|
117 |
prompt = "a photo of an astronaut riding a horse on mars"
|
118 |
+
with autocast("cuda"):
|
119 |
+
image = pipe(prompt, guidance_scale=7.5).images[0]
|
120 |
|
121 |
image.save("astronaut_rides_horse.png")
|
122 |
```
|
|
|
150 |
|
151 |
# shard inputs and rng
|
152 |
params = replicate(params)
|
153 |
+
prng_seed = jax.random.split(prng_seed, 8)
|
154 |
prompt_ids = shard(prompt_ids)
|
155 |
|
156 |
images = pipeline(prompt_ids, params, prng_seed, num_inference_steps, jit=True).images
|
|
|
183 |
|
184 |
# shard inputs and rng
|
185 |
params = replicate(params)
|
186 |
+
prng_seed = jax.random.split(prng_seed, 8)
|
187 |
prompt_ids = shard(prompt_ids)
|
188 |
|
189 |
images = pipeline(prompt_ids, params, prng_seed, num_inference_steps, jit=True).images
|
model_index.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
"_diffusers_version": "0.2.2",
|
4 |
"feature_extractor": [
|
5 |
"transformers",
|
6 |
-
"
|
7 |
],
|
8 |
"safety_checker": [
|
9 |
"stable_diffusion",
|
|
|
3 |
"_diffusers_version": "0.2.2",
|
4 |
"feature_extractor": [
|
5 |
"transformers",
|
6 |
+
"CLIPFeatureExtractor"
|
7 |
],
|
8 |
"safety_checker": [
|
9 |
"stable_diffusion",
|
safety_checker/model.fp16.safetensors
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:08902f19b1cfebd7c989f152fc0507bef6898c706a91d666509383122324b511
|
3 |
-
size 608018440
|
|
|
|
|
|
|
|
safety_checker/model.safetensors
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:9d6a233ff6fd5ccb9f76fd99618d73369c52dd3d8222376384d0e601911089e8
|
3 |
-
size 1215981830
|
|
|
|
|
|
|
|
safety_checker/pytorch_model.fp16.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:22ba87205445ad5def13e54919b038dcfb7321ec1c3f4b12487d4fba6036125f
|
3 |
-
size 608103564
|
|
|
|
|
|
|
|
text_encoder/model.fp16.safetensors
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:77795e2023adcf39bc29a884661950380bd093cf0750a966d473d1718dc9ef4e
|
3 |
-
size 246144864
|
|
|
|
|
|
|
|
text_encoder/model.safetensors
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:7b3a12df205cb3c74dd4eae4354d93f606ae6b3bc29d5d06fd97921cb9ad8a81
|
3 |
-
size 492265879
|
|
|
|
|
|
|
|
text_encoder/pytorch_model.fp16.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:05eee911f195625deeab86f0b22b115d7d8bc3adbfc1404f03557f7e4e6a8fd7
|
3 |
-
size 246187076
|
|
|
|
|
|
|
|
unet/diffusion_pytorch_model.fp16.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:3ac986370f51d806d2119577d5a66fbf6d3746e2356f45dc474e7561ce94bdbf
|
3 |
-
size 1719327893
|
|
|
|
|
|
|
|
unet/diffusion_pytorch_model.fp16.safetensors
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a35404d03ec8f977715a4d2a080ddf72e2144f2ee49bb1ee213258bc64f9cc87
|
3 |
-
size 1719125304
|
|
|
|
|
|
|
|
unet/diffusion_pytorch_model.non_ema.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:f5f12f7078f361f137f91edc270cb523208dc2322a597e07773eb3b1e5703850
|
3 |
-
size 3438366373
|
|
|
|
|
|
|
|
unet/diffusion_pytorch_model.non_ema.safetensors
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:ac3d1bff03f9e9a6f8671b5a7a3fd984f90185c84e407bc569f97c1cce7445fd
|
3 |
-
size 3438167536
|
|
|
|
|
|
|
|
unet/diffusion_pytorch_model.safetensors
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:145a07e0f05ec5bbe6e2e9faf608bdb311caf708895cac8c8ed713c59864e1e8
|
3 |
-
size 3438167534
|
|
|
|
|
|
|
|
vae/config.json
CHANGED
@@ -19,7 +19,6 @@
|
|
19 |
"layers_per_block": 2,
|
20 |
"out_channels": 3,
|
21 |
"sample_size": 512,
|
22 |
-
"scaling_factor": 0.18215,
|
23 |
"up_block_types": [
|
24 |
"UpDecoderBlock2D",
|
25 |
"UpDecoderBlock2D",
|
|
|
19 |
"layers_per_block": 2,
|
20 |
"out_channels": 3,
|
21 |
"sample_size": 512,
|
|
|
22 |
"up_block_types": [
|
23 |
"UpDecoderBlock2D",
|
24 |
"UpDecoderBlock2D",
|
vae/diffusion_pytorch_model.fp16.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:b7643b3e40b9f128eda5fe174fea73c3ef3903562651fb344a79439709c2e503
|
3 |
-
size 167405651
|
|
|
|
|
|
|
|
vae/diffusion_pytorch_model.fp16.safetensors
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:4fbcf0ebe55a0984f5a5e00d8c4521d52359af7229bb4d81890039d2aa16dd7c
|
3 |
-
size 167335342
|
|
|
|
|
|
|
|
vae/diffusion_pytorch_model.safetensors
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a2b5134f4dbc140d9c11f11cba3233099e00af40f262f136c691fb7d38d2194c
|
3 |
-
size 334643276
|
|
|
|
|
|
|
|