Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ And oh, my dreams,
|
|
| 11 |
it's never quite as it seems
|
| 12 |
Never quite as it seems"""
|
| 13 |
|
| 14 |
-
examples = [["mind"], ["memory"], ["sleep"],["wellness"],["nutrition"]]
|
| 15 |
|
| 16 |
|
| 17 |
def poem2_generate(word):
|
|
@@ -81,9 +81,13 @@ def poem_to_image(poem):
|
|
| 81 |
poem = " ".join(poem.split('\n'))
|
| 82 |
poem = poem + " oil on canvas."
|
| 83 |
steps, width, height, images, diversity = '50','256','256','1',15
|
| 84 |
-
img = gr.Interface(
|
| 85 |
return img
|
| 86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
demo = gr.Blocks()
|
| 88 |
|
| 89 |
with demo:
|
|
@@ -93,6 +97,11 @@ with demo:
|
|
| 93 |
)
|
| 94 |
with gr.Row():
|
| 95 |
input_word = gr.Textbox(lines=7, value=prompt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
poem_txt = gr.Textbox(lines=7)
|
| 97 |
output_image = gr.Image(type="filepath", shape=(256,256))
|
| 98 |
|
|
|
|
| 11 |
it's never quite as it seems
|
| 12 |
Never quite as it seems"""
|
| 13 |
|
| 14 |
+
#examples = [["mind"], ["memory"], ["sleep"],["wellness"],["nutrition"]]
|
| 15 |
|
| 16 |
|
| 17 |
def poem2_generate(word):
|
|
|
|
| 81 |
poem = " ".join(poem.split('\n'))
|
| 82 |
poem = poem + " oil on canvas."
|
| 83 |
steps, width, height, images, diversity = '50','256','256','1',15
|
| 84 |
+
img = gr.Interface().load("spaces/multimodalart/latentdiffusion")(poem, steps, width, height, images, diversity)[0]
|
| 85 |
return img
|
| 86 |
|
| 87 |
+
def set_example(example: list) -> dict:
|
| 88 |
+
return gr.Textbox.update(value=example[0])
|
| 89 |
+
|
| 90 |
+
|
| 91 |
demo = gr.Blocks()
|
| 92 |
|
| 93 |
with demo:
|
|
|
|
| 97 |
)
|
| 98 |
with gr.Row():
|
| 99 |
input_word = gr.Textbox(lines=7, value=prompt)
|
| 100 |
+
|
| 101 |
+
examples=[["living, loving, feeling good"], ["I want to live. I want to give."],["Ive been to Hollywood. Ive been to Redwood"]]
|
| 102 |
+
example_text = gr.Dataset(components=[input_text], samples=examples)
|
| 103 |
+
example_text.click(fn=set_example,inputs = example_text,outputs= example_text.components)
|
| 104 |
+
|
| 105 |
poem_txt = gr.Textbox(lines=7)
|
| 106 |
output_image = gr.Image(type="filepath", shape=(256,256))
|
| 107 |
|