alexanz commited on
Commit
5be453f
·
verified ·
1 Parent(s): 3d7cccf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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 = "alexanz/SD14_lora_pusheen" # 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 = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
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