Update server.py
Browse files
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(
|
|
|
|
|
|
|
|
|
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
|