Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
from diffusers import StableDiffusionPipeline
|
| 3 |
import torch
|
| 4 |
|
| 5 |
-
#
|
| 6 |
pipe = StableDiffusionPipeline.from_pretrained(
|
| 7 |
"runwayml/stable-diffusion-v1-5",
|
| 8 |
torch_dtype=torch.float32
|
|
@@ -13,7 +13,7 @@ def generate_image(prompt):
|
|
| 13 |
image = pipe(prompt).images[0]
|
| 14 |
return image
|
| 15 |
|
| 16 |
-
#
|
| 17 |
demo = gr.Interface(
|
| 18 |
fn=generate_image,
|
| 19 |
inputs=gr.Textbox(label="Prompt"),
|
|
@@ -23,4 +23,4 @@ demo = gr.Interface(
|
|
| 23 |
)
|
| 24 |
|
| 25 |
if __name__ == "__main__":
|
| 26 |
-
demo.launch()
|
|
|
|
| 2 |
from diffusers import StableDiffusionPipeline
|
| 3 |
import torch
|
| 4 |
|
| 5 |
+
# Initialisation du pipeline Stable Diffusion en CPU
|
| 6 |
pipe = StableDiffusionPipeline.from_pretrained(
|
| 7 |
"runwayml/stable-diffusion-v1-5",
|
| 8 |
torch_dtype=torch.float32
|
|
|
|
| 13 |
image = pipe(prompt).images[0]
|
| 14 |
return image
|
| 15 |
|
| 16 |
+
# Création de l'interface Gradio
|
| 17 |
demo = gr.Interface(
|
| 18 |
fn=generate_image,
|
| 19 |
inputs=gr.Textbox(label="Prompt"),
|
|
|
|
| 23 |
)
|
| 24 |
|
| 25 |
if __name__ == "__main__":
|
| 26 |
+
demo.launch(server_name="0.0.0.0")
|