terrapretapermaculture commited on
Commit
f12959b
·
verified ·
1 Parent(s): 5182898

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +1 -2
model.py CHANGED
@@ -12,7 +12,6 @@ from diffusers import (
12
  StableDiffusionControlNetPipeline,
13
  UniPCMultistepScheduler
14
  )
15
- from diffusers.pipelines.stable_diffusion import StableDiffusionSafetyChecker
16
  from cv_utils import resize_image
17
  from preprocessor import Preprocessor
18
  from settings import MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
@@ -58,7 +57,7 @@ class Model:
58
  model_id = CONTROLNET_MODEL_IDS[task_name]
59
  controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype=torch.float16)
60
  pipe = StableDiffusionControlNetPipeline.from_pretrained(
61
- base_model_id, safety_checker=StableDiffusionSafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker"), controlnet=controlnet, torch_dtype=torch.float16
62
  )
63
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
64
  if self.device.type == "cuda":
 
12
  StableDiffusionControlNetPipeline,
13
  UniPCMultistepScheduler
14
  )
 
15
  from cv_utils import resize_image
16
  from preprocessor import Preprocessor
17
  from settings import MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
 
57
  model_id = CONTROLNET_MODEL_IDS[task_name]
58
  controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype=torch.float16)
59
  pipe = StableDiffusionControlNetPipeline.from_pretrained(
60
+ base_model_id, safety_checker=None, controlnet=controlnet, torch_dtype=torch.float16
61
  )
62
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
63
  if self.device.type == "cuda":