Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -71,17 +71,7 @@ scripts = """
|
|
71 |
async () => {
|
72 |
|
73 |
|
74 |
-
|
75 |
-
console.log("test output download function")
|
76 |
-
var link = document.createElement("a");
|
77 |
-
dataUri = document.getElementById('download_output').href
|
78 |
-
link.setAttribute("href", dataUri);
|
79 |
-
link.setAttribute("download", "output.png");
|
80 |
-
document.body.appendChild(link); // Required for Firefox
|
81 |
-
link.click();
|
82 |
-
document.body.removeChild(link); // Clean up
|
83 |
-
return false
|
84 |
-
}
|
85 |
|
86 |
globalThis.DELETE_SKETCH_FUNCTION = () => {
|
87 |
console.log("delete sketch function")
|
@@ -171,7 +161,6 @@ with gr.Blocks(css="style.css") as demo:
|
|
171 |
|
172 |
with gr.Column(elem_id="column_output"):
|
173 |
result = gr.Image(label="Result", height=440, width=440, elem_id="output_image", show_label=False, show_download_button=True)
|
174 |
-
download_output = gr.Button("Download output", elem_id="download_output")
|
175 |
|
176 |
|
177 |
eraser.change(fn=lambda x: gr.update(value=not x), inputs=[eraser], outputs=[line]).then(update_canvas, [line, eraser], [image])
|
@@ -179,7 +168,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
179 |
|
180 |
demo.load(None,None,None,_js=scripts)
|
181 |
inputs = [image, item]
|
182 |
-
outputs = [result
|
183 |
item.change(fn=run, inputs=inputs, outputs=outputs)
|
184 |
image.change(run, inputs=inputs, outputs=outputs,)
|
185 |
|
|
|
71 |
async () => {
|
72 |
|
73 |
|
74 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
globalThis.DELETE_SKETCH_FUNCTION = () => {
|
77 |
console.log("delete sketch function")
|
|
|
161 |
|
162 |
with gr.Column(elem_id="column_output"):
|
163 |
result = gr.Image(label="Result", height=440, width=440, elem_id="output_image", show_label=False, show_download_button=True)
|
|
|
164 |
|
165 |
|
166 |
eraser.change(fn=lambda x: gr.update(value=not x), inputs=[eraser], outputs=[line]).then(update_canvas, [line, eraser], [image])
|
|
|
168 |
|
169 |
demo.load(None,None,None,_js=scripts)
|
170 |
inputs = [image, item]
|
171 |
+
outputs = [result]
|
172 |
item.change(fn=run, inputs=inputs, outputs=outputs)
|
173 |
image.change(run, inputs=inputs, outputs=outputs,)
|
174 |
|