Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,10 +24,11 @@ def create_img(prompt :str, number_output_requested: int) -> list:
|
|
| 24 |
revision="fp16",
|
| 25 |
torch_dtype=torch.float16,
|
| 26 |
use_auth_token=AUTH_TOKEN)
|
| 27 |
-
generator.to("
|
| 28 |
prompt = [prompt] * number_output_requested
|
| 29 |
-
|
| 30 |
-
|
|
|
|
| 31 |
return output_paths
|
| 32 |
|
| 33 |
diffusers_app = gr.Interface(
|
|
@@ -42,4 +43,4 @@ diffusers_app = gr.Interface(
|
|
| 42 |
description="This is a basic app to generate pictures with Stable Diffusion."
|
| 43 |
)
|
| 44 |
|
| 45 |
-
diffusers_app.launch(
|
|
|
|
| 24 |
revision="fp16",
|
| 25 |
torch_dtype=torch.float16,
|
| 26 |
use_auth_token=AUTH_TOKEN)
|
| 27 |
+
generator.to("cuda")
|
| 28 |
prompt = [prompt] * number_output_requested
|
| 29 |
+
with torch.autocast("cuda"):
|
| 30 |
+
images = generator(prompt).images
|
| 31 |
+
output_paths = save_images(images)
|
| 32 |
return output_paths
|
| 33 |
|
| 34 |
diffusers_app = gr.Interface(
|
|
|
|
| 43 |
description="This is a basic app to generate pictures with Stable Diffusion."
|
| 44 |
)
|
| 45 |
|
| 46 |
+
diffusers_app.launch()
|