um235 commited on
Commit
8d4358c
·
verified ·
1 Parent(s): 6c61655

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -47,12 +47,15 @@ def infer(
47
  if (model_id=="SD1.5 + lora Unet TextEncoder"):
48
  pipe=DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch_dtype)
49
  pipe.unet = PeftModel.from_pretrained(pipe.unet,"um235/VanillaCat",subfolder="unet")
 
50
  pipe.text_encoder= PeftModel.from_pretrained(pipe.text_encoder,"um235/VanillaCat",subfolder="text_encoder")
51
  elif (model_id=="SD1.5 + lora Unet"):
52
  pipe=DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch_dtype)
 
53
  pipe.unet = PeftModel.from_pretrained(pipe.unet,"um235/cartoon_cat_stickers")
54
  else:
55
  pipe=DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch_dtype)
 
56
  pipe = pipe.to(device)
57
 
58
  image = pipe(
@@ -104,7 +107,7 @@ with gr.Blocks(css=css) as demo:
104
  "SD1.5 + lora Unet TextEncoder",
105
  "SD1.5 + lora Unet"
106
  ],
107
- value="stable-diffusion-v1-5/stable-diffusion-v1-5 with lora with text encoder",
108
  show_label=True,
109
  type="value",
110
  )
 
47
  if (model_id=="SD1.5 + lora Unet TextEncoder"):
48
  pipe=DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch_dtype)
49
  pipe.unet = PeftModel.from_pretrained(pipe.unet,"um235/VanillaCat",subfolder="unet")
50
+ pipe.safety_checker = None
51
  pipe.text_encoder= PeftModel.from_pretrained(pipe.text_encoder,"um235/VanillaCat",subfolder="text_encoder")
52
  elif (model_id=="SD1.5 + lora Unet"):
53
  pipe=DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch_dtype)
54
+ pipe.safety_checker = None
55
  pipe.unet = PeftModel.from_pretrained(pipe.unet,"um235/cartoon_cat_stickers")
56
  else:
57
  pipe=DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch_dtype)
58
+ pipe.safety_checker = None
59
  pipe = pipe.to(device)
60
 
61
  image = pipe(
 
107
  "SD1.5 + lora Unet TextEncoder",
108
  "SD1.5 + lora Unet"
109
  ],
110
+ value="SD1.5 + lora Unet TextEncoder",
111
  show_label=True,
112
  type="value",
113
  )