Spaces:
Sleeping
Sleeping
Li Yan
commited on
Commit
·
2c5ac74
1
Parent(s):
43f4c40
implet app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,15 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from diffusers import DiffusionPipeline, DDIMScheduler
|
3 |
|
4 |
+
scheduler = DDIMScheduler.from_pretrained('li-yan/diffusion-aurora-256')
|
5 |
+
scheduler.set_timesteps(num_inference_steps=40)
|
6 |
|
7 |
+
pipeline = DiffusionPipeline.from_pretrained(
|
8 |
+
'li-yan/diffusion-aurora-256', scheduler=scheduler).to("cuda")
|
9 |
+
|
10 |
+
def image_gen(name):
|
11 |
+
images = pipeline(num_inference_steps=40).images
|
12 |
+
return images[0]
|
13 |
+
|
14 |
+
demo = gr.Interface(fn=image_gen, inputs="text", outputs="image")
|
15 |
demo.launch()
|