radames commited on
Commit
96a3fa5
1 Parent(s): 812a64b

enable safety feature

Browse files
Files changed (1) hide show
  1. stablediffusion-infinity/app.py +4 -2
stablediffusion-infinity/app.py CHANGED
@@ -108,9 +108,10 @@ def sync_rooms_data_repo():
108
 
109
  def get_model():
110
  if "inpaint" not in model:
111
- scheduler = EulerAncestralDiscreteScheduler.from_pretrained("stabilityai/stable-diffusion-2-base", subfolder="scheduler")
 
112
  inpaint = DiffusionPipeline.from_pretrained(
113
- "stabilityai/stable-diffusion-2-inpainting", torch_dtype=torch.float16, revision="fp16")
114
  inpaint.scheduler = scheduler
115
  inpaint = inpaint.to("cuda")
116
  model["inpaint"] = inpaint
@@ -185,6 +186,7 @@ async def run_outpaint(
185
  num_inference_steps=step,
186
  guidance_scale=guidance,
187
  )
 
188
  image = output["images"][0]
189
  is_nsfw = False
190
  if "nsfw_content_detected" in output:
 
108
 
109
  def get_model():
110
  if "inpaint" not in model:
111
+ scheduler = EulerAncestralDiscreteScheduler.from_pretrained(
112
+ "stabilityai/stable-diffusion-2-base", subfolder="scheduler")
113
  inpaint = DiffusionPipeline.from_pretrained(
114
+ "radames/stable-diffusion-v2-inpainting", torch_dtype=torch.float16)
115
  inpaint.scheduler = scheduler
116
  inpaint = inpaint.to("cuda")
117
  model["inpaint"] = inpaint
 
186
  num_inference_steps=step,
187
  guidance_scale=guidance,
188
  )
189
+ print(output)
190
  image = output["images"][0]
191
  is_nsfw = False
192
  if "nsfw_content_detected" in output: