Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,15 @@ def generate(image, prompt, seed):
|
|
8 |
result = subprocess.run(command, shell=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
9 |
output_path = 'output'
|
10 |
print("Output:", result.stdout)
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
except subprocess.CalledProcessError as e:
|
13 |
print("Error:", e.stderr)
|
14 |
return None
|
@@ -20,7 +28,8 @@ with gr.Blocks() as demo:
|
|
20 |
textbox = gr.Textbox(show_label=False, value="a person facing the camera, making a hand gesture, indoor")
|
21 |
seed = gr.Slider(minimum=0, maximum=1000000, value=643534)
|
22 |
button = gr.Button()
|
23 |
-
output_image = gr.Image(show_label=False, type="filepath", interactive=False, height=512, width=512)
|
|
|
24 |
button.click(fn=generate, inputs=[image, textbox, seed], outputs=[output_image])
|
25 |
|
26 |
demo.queue().launch(inline=False, share=True, debug=True)
|
|
|
8 |
result = subprocess.run(command, shell=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
9 |
output_path = 'output'
|
10 |
print("Output:", result.stdout)
|
11 |
+
print output_path
|
12 |
+
# List all files and directories in the given directory
|
13 |
+
contents = os.listdir(directory_path)
|
14 |
+
|
15 |
+
# Print the contents
|
16 |
+
for item in contents:
|
17 |
+
print(item)
|
18 |
+
|
19 |
+
return "Done"
|
20 |
except subprocess.CalledProcessError as e:
|
21 |
print("Error:", e.stderr)
|
22 |
return None
|
|
|
28 |
textbox = gr.Textbox(show_label=False, value="a person facing the camera, making a hand gesture, indoor")
|
29 |
seed = gr.Slider(minimum=0, maximum=1000000, value=643534)
|
30 |
button = gr.Button()
|
31 |
+
#output_image = gr.Image(show_label=False, type="filepath", interactive=False, height=512, width=512)
|
32 |
+
output_image = gr.Textbox()
|
33 |
button.click(fn=generate, inputs=[image, textbox, seed], outputs=[output_image])
|
34 |
|
35 |
demo.queue().launch(inline=False, share=True, debug=True)
|