pseudotheos yqrashawn commited on
Commit
40b693f
1 Parent(s): 47e0f32

fix: safety_model_id not defined (#1)

Browse files

- fix: safety_model_id not defined (d10ca257c4dcbc56c258e0ed20bb7d305f127a66)


Co-authored-by: Rashawn <yqrashawn@users.noreply.huggingface.co>

Files changed (1) hide show
  1. app.py +2 -1
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 = "CompVis/stable-diffusion-safety-checker",
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,