Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,20 @@
|
|
| 1 |
from diffusers import DiffusionPipeline
|
| 2 |
import gradio as gr
|
|
|
|
| 3 |
model_id = "CompVis/ldm-text2im-large-256"
|
| 4 |
ldm = DiffusionPipeline.from_pretrained(model_id)
|
|
|
|
| 5 |
def generate_image(Prompt):
|
| 6 |
-
images = ldm([Prompt], num_inference_steps=50, eta
|
| 7 |
-
return images.images[0]
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from diffusers import DiffusionPipeline
|
| 2 |
import gradio as gr
|
| 3 |
+
|
| 4 |
model_id = "CompVis/ldm-text2im-large-256"
|
| 5 |
ldm = DiffusionPipeline.from_pretrained(model_id)
|
| 6 |
+
|
| 7 |
def generate_image(Prompt):
|
| 8 |
+
images = ldm([Prompt], num_inference_steps=50, eta=0.3, guidance_scale=6)
|
| 9 |
+
return images.images[0]
|
| 10 |
+
|
| 11 |
+
interface = gr.Interface(
|
| 12 |
+
fn=generate_image,
|
| 13 |
+
inputs="text",
|
| 14 |
+
outputs="image",
|
| 15 |
+
title="Mashdemy Demo Image Generator App", # Added missing quotation mark
|
| 16 |
+
description="Type in a text and click submit to generate an image:",
|
| 17 |
+
examples=["a clown reading a book", "a cat using a laptop", "An elephant on grass"]
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
interface.launch(share=True)
|