Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,15 +8,18 @@ from diffusers import DiffusionPipeline, StableDiffusionPipeline
|
|
| 8 |
import torch
|
| 9 |
|
| 10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 11 |
-
model_repo_id = "
|
| 12 |
|
| 13 |
if torch.cuda.is_available():
|
| 14 |
torch_dtype = torch.float16
|
| 15 |
else:
|
| 16 |
torch_dtype = torch.float32
|
| 17 |
|
| 18 |
-
pipe =
|
| 19 |
pipe = pipe.to(device)
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
MAX_SEED = np.iinfo(np.int32).max
|
| 22 |
MAX_IMAGE_SIZE = 512
|
|
|
|
| 8 |
import torch
|
| 9 |
|
| 10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 11 |
+
model_repo_id = "CompVis/stable-diffusion-v1-4" # Replace to the model you would like to use
|
| 12 |
|
| 13 |
if torch.cuda.is_available():
|
| 14 |
torch_dtype = torch.float16
|
| 15 |
else:
|
| 16 |
torch_dtype = torch.float32
|
| 17 |
|
| 18 |
+
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
|
| 19 |
pipe = pipe.to(device)
|
| 20 |
+
pipe.unet = PeftModel.from_pretrained(pipe.unet, "alexanz/SD14_lora_pusheen")
|
| 21 |
+
pipe.safety_checker = None
|
| 22 |
+
pipe.requires_safety_checker = False
|
| 23 |
|
| 24 |
MAX_SEED = np.iinfo(np.int32).max
|
| 25 |
MAX_IMAGE_SIZE = 512
|