Spaces:
Runtime error
Runtime error
Commit
·
506e749
1
Parent(s):
698c77d
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from diffusers import DiffusionPipeline
|
3 |
+
|
4 |
+
pipeline = DiffusionPipeline.from_pretrained("dataautogpt3/OpenDalleV1.1")
|
5 |
+
|
6 |
+
def generate_image(prompt):
|
7 |
+
if prompt != '':
|
8 |
+
image = pipeline.generate(prompt=prompt)
|
9 |
+
return image
|
10 |
+
else:
|
11 |
+
return None
|
12 |
+
|
13 |
+
prompt_input = gr.textbox(input_type="area", label="Enter your prompt here:", default="Visualize a scene of a burning bonfire with the word '2023' clearly visible amidst the flames. Underneath the burning text, there is another, undamaged text that reads '2024'. The image should convey a sense of transition and change, with the old year being consumed by the fire and the new year emerging triumphant.")
|
14 |
+
|
15 |
+
gr.Interface(generate_image, inputs=gr.inputs.Textbox(lines=5), outputs=gr.outputs.Image(label="Generated Image")).launch()
|