radames commited on
Commit
02f815e
·
1 Parent(s): aba0e27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,7 +11,7 @@ import random
11
  start_time = time.time()
12
  current_steps = 15
13
 
14
- pipe = DiffusionPipeline.from_pretrained("timbrooks/instruct-pix2pix", torch_dtype=torch.float16, safety_checker=None)
15
  pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
16
  pipe.enable_xformers_memory_efficient_attention()
17
  pipe.unet.to(memory_format=torch.channels_last)
@@ -64,7 +64,7 @@ def inference(
64
  )
65
 
66
  # return replace_nsfw_images(result)
67
- return result.images, f"Done. Seed: {seed}"
68
  except Exception as e:
69
  return None, error_str(e)
70
 
 
11
  start_time = time.time()
12
  current_steps = 15
13
 
14
+ pipe = DiffusionPipeline.from_pretrained("timbrooks/instruct-pix2pix", torch_dtype=torch.float16) # safety_checker=None)
15
  pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
16
  pipe.enable_xformers_memory_efficient_attention()
17
  pipe.unet.to(memory_format=torch.channels_last)
 
64
  )
65
 
66
  # return replace_nsfw_images(result)
67
+ return result.images, results.nsfw_content_detected, f"Done. Seed: {seed}"
68
  except Exception as e:
69
  return None, error_str(e)
70