fix: safety_model_id not defined
Browse files
app.py
CHANGED
@@ -46,11 +46,12 @@ BASE_MODEL = "SG161222/Realistic_Vision_V5.1_noVAE"
|
|
46 |
# Initialize both pipelines
|
47 |
vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch.float16)
|
48 |
controlnet = ControlNetModel.from_pretrained("monster-labs/control_v1p_sd15_qrcode_monster", torch_dtype=torch.float16)
|
|
|
49 |
main_pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
50 |
BASE_MODEL,
|
51 |
controlnet=controlnet,
|
52 |
vae=vae,
|
53 |
-
safety_model_id =
|
54 |
safety_feature_extractor = AutoFeatureExtractor.from_pretrained(safety_model_id),
|
55 |
safety_checker = StableDiffusionSafetyChecker.from_pretrained(safety_model_id),
|
56 |
torch_dtype=torch.float16,
|
|
|
46 |
# Initialize both pipelines
|
47 |
vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch.float16)
|
48 |
controlnet = ControlNetModel.from_pretrained("monster-labs/control_v1p_sd15_qrcode_monster", torch_dtype=torch.float16)
|
49 |
+
safety_model_id = "CompVis/stable-diffusion-safety-checker"
|
50 |
main_pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
51 |
BASE_MODEL,
|
52 |
controlnet=controlnet,
|
53 |
vae=vae,
|
54 |
+
safety_model_id = safety_model_id,
|
55 |
safety_feature_extractor = AutoFeatureExtractor.from_pretrained(safety_model_id),
|
56 |
safety_checker = StableDiffusionSafetyChecker.from_pretrained(safety_model_id),
|
57 |
torch_dtype=torch.float16,
|