Spaces:
Paused
Paused
Update app.py
Browse files
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
|
| 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 |
|