Spaces:
Runtime error
Runtime error
Create new file
Browse files
app.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from diffusers import DiffusionPipeline
|
| 3 |
+
|
| 4 |
+
ldm = DiffusionPipeline.from_pretrained("CompVis/ldm-text2im-large-256")
|
| 5 |
+
|
| 6 |
+
def inference(prompt):
|
| 7 |
+
images = ldm([prompt],
|
| 8 |
+
num_inference_steps=10,
|
| 9 |
+
eta=0.3,
|
| 10 |
+
guidance_scale=6)["sample"]
|
| 11 |
+
return images
|
| 12 |
+
|
| 13 |
+
gr.Interface(inference, "text", gr.Gallery()).launch()
|