s-ahal commited on
Commit
a3efd32
·
verified ·
1 Parent(s): 9b256ac

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +5 -1
server.py CHANGED
@@ -37,7 +37,11 @@ def load_models(model_name="CompVis/stable-diffusion-v1-4"):
37
  global stable_diff_pipe, model
38
 
39
  # Load Stable Diffusion model pipeline
40
- stable_diff_pipe = StableDiffusionPipeline.from_pretrained(model_name)
 
 
 
 
41
  stable_diff_pipe.to("cuda" if torch.cuda.is_available() else "cpu")
42
 
43
  # Initialize MIDM model
 
37
  global stable_diff_pipe, model
38
 
39
  # Load Stable Diffusion model pipeline
40
+ stable_diff_pipe = StableDiffusionPipeline.from_pretrained(
41
+ model_name,
42
+ safety_checker=None, # Disable safety checker for feature extraction
43
+ requires_safety_checker=False # Explicitly indicate we don't need the safety checker
44
+ )
45
  stable_diff_pipe.to("cuda" if torch.cuda.is_available() else "cpu")
46
 
47
  # Initialize MIDM model