Ming Li commited on
Commit
03489e1
1 Parent(s): 84fd721

turn off safty_checker

Browse files
Files changed (1) hide show
  1. model.py +1 -1
model.py CHANGED
@@ -54,7 +54,7 @@ class Model:
54
  model_id = CONTROLNET_MODEL_IDS[task_name]
55
  controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype=torch.float16)
56
  pipe = StableDiffusionControlNetPipeline.from_pretrained(
57
- base_model_id, controlnet=controlnet, torch_dtype=torch.float16
58
  )
59
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
60
  if self.device.type == "cuda":
 
54
  model_id = CONTROLNET_MODEL_IDS[task_name]
55
  controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype=torch.float16)
56
  pipe = StableDiffusionControlNetPipeline.from_pretrained(
57
+ base_model_id, safety_checker=None, controlnet=controlnet, torch_dtype=torch.float16
58
  )
59
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
60
  if self.device.type == "cuda":