Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,11 +3,12 @@ import torch
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
|
| 6 |
-
pipe.to("
|
| 7 |
|
| 8 |
def generate_image(prompt):
|
| 9 |
images = pipe(prompt='an highly detailed , highly realistic'+prompt).images[0]
|
| 10 |
return images
|
| 11 |
|
| 12 |
iface = gr.Interface(fn=generate_image, inputs="text", outputs="image")
|
| 13 |
-
iface.launch(share = True)
|
|
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
|
| 6 |
+
pipe.to("cpu") # Note the change here
|
| 7 |
|
| 8 |
def generate_image(prompt):
|
| 9 |
images = pipe(prompt='an highly detailed , highly realistic'+prompt).images[0]
|
| 10 |
return images
|
| 11 |
|
| 12 |
iface = gr.Interface(fn=generate_image, inputs="text", outputs="image")
|
| 13 |
+
iface.launch(share = True)
|
| 14 |
+
|