Spaces:
Running
on
A10G
Running
on
A10G
Update app.py
Browse files
app.py
CHANGED
@@ -18,13 +18,14 @@ def infer(prompt,image):
|
|
18 |
print(result[0])
|
19 |
print(result[0][0])
|
20 |
# return "done"
|
21 |
-
|
|
|
22 |
|
23 |
with gr.Blocks() as demo:
|
24 |
with gr.Column():
|
25 |
prompt = gr.Textbox(placeholder="enter prompt")
|
26 |
image = gr.Image(source="upload", type="filepath")
|
27 |
-
|
28 |
#text_out = gr.Textbox()
|
29 |
submit_btn = gr.Button("go")
|
30 |
|
@@ -32,7 +33,7 @@ with gr.Blocks() as demo:
|
|
32 |
prompt,
|
33 |
image
|
34 |
]
|
35 |
-
outputs = [
|
36 |
#outputs = [text_out]
|
37 |
submit_btn.click(infer, inputs, outputs)
|
38 |
|
|
|
18 |
print(result[0])
|
19 |
print(result[0][0])
|
20 |
# return "done"
|
21 |
+
images = [os.path.join(result[0], img) for img in os.listdir(result[0])]
|
22 |
+
return images[0]
|
23 |
|
24 |
with gr.Blocks() as demo:
|
25 |
with gr.Column():
|
26 |
prompt = gr.Textbox(placeholder="enter prompt")
|
27 |
image = gr.Image(source="upload", type="filepath")
|
28 |
+
image_out = gr.Image()
|
29 |
#text_out = gr.Textbox()
|
30 |
submit_btn = gr.Button("go")
|
31 |
|
|
|
33 |
prompt,
|
34 |
image
|
35 |
]
|
36 |
+
outputs = [image_out]
|
37 |
#outputs = [text_out]
|
38 |
submit_btn.click(infer, inputs, outputs)
|
39 |
|