Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
-
from diffusers import AutoPipelineForText2Image
|
4 |
import torch
|
5 |
|
6 |
-
|
7 |
-
model_id =
|
8 |
-
pipe = AutoPipelineForText2Image.from_pretrained(model_id, torch_dtype=torch.float32, safety_checker=None)
|
9 |
|
10 |
|
11 |
def infer(prompt):
|
12 |
|
13 |
prompt = "a photo of an astronaut riding a horse on mars"
|
14 |
-
image = pipe(prompt=prompt, guidance_scale=10.0, num_inference_steps=
|
15 |
|
16 |
return image
|
17 |
|
|
|
1 |
import gradio as gr
|
2 |
+
from diffusers import StableDiffusionPipeline
|
|
|
3 |
import torch
|
4 |
|
5 |
+
model_id = "runwayml/stable-diffusion-v1-5"
|
6 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float32, safety_checker=None)
|
|
|
7 |
|
8 |
|
9 |
def infer(prompt):
|
10 |
|
11 |
prompt = "a photo of an astronaut riding a horse on mars"
|
12 |
+
image = pipe(prompt=prompt, guidance_scale=10.0, num_inference_steps=25, width=256, height=256).images[0]
|
13 |
|
14 |
return image
|
15 |
|