AP123 commited on
Commit
766763f
1 Parent(s): 6914f7a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -27,13 +27,17 @@ BASE_MODEL = "SG161222/Realistic_Vision_V5.1_noVAE"
27
 
28
  # Initialize both pipelines
29
  vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch.float16)
 
 
 
 
30
  #init_pipe = DiffusionPipeline.from_pretrained("SG161222/Realistic_Vision_V5.1_noVAE", torch_dtype=torch.float16)
31
  controlnet = ControlNetModel.from_pretrained("monster-labs/control_v1p_sd15_qrcode_monster", torch_dtype=torch.float16)#, torch_dtype=torch.float16)
32
  main_pipe = StableDiffusionControlNetPipeline.from_pretrained(
33
  BASE_MODEL,
34
  controlnet=controlnet,
35
  vae=vae,
36
- safety_checker=StableDiffusionSafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker"),
37
  torch_dtype=torch.float16,
38
  ).to("cuda")
39
 
 
27
 
28
  # Initialize both pipelines
29
  vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch.float16)
30
+
31
+ # Initialize the safety checker
32
+ safety_checker = StableDiffusionSafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker")
33
+
34
  #init_pipe = DiffusionPipeline.from_pretrained("SG161222/Realistic_Vision_V5.1_noVAE", torch_dtype=torch.float16)
35
  controlnet = ControlNetModel.from_pretrained("monster-labs/control_v1p_sd15_qrcode_monster", torch_dtype=torch.float16)#, torch_dtype=torch.float16)
36
  main_pipe = StableDiffusionControlNetPipeline.from_pretrained(
37
  BASE_MODEL,
38
  controlnet=controlnet,
39
  vae=vae,
40
+ safety_checker=safety_checker
41
  torch_dtype=torch.float16,
42
  ).to("cuda")
43