angtrim commited on
Commit
fe2f0f2
·
verified ·
1 Parent(s): f872b37

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -16
app.py CHANGED
@@ -69,20 +69,7 @@ def upload_sketch(file):
69
 
70
  scripts = """
71
  async () => {
72
- globalThis.theSketchDownloadFunction = () => {
73
- console.log("test")
74
- var link = document.createElement("a");
75
- dataUri = document.getElementById('download_sketch').href
76
- link.setAttribute("href", dataUri)
77
- link.setAttribute("download", "sketch.png")
78
- document.body.appendChild(link); // Required for Firefox
79
- link.click();
80
- document.body.removeChild(link); // Clean up
81
-
82
- // also call the output download function
83
- theOutputDownloadFunction();
84
- return false
85
- }
86
 
87
  globalThis.theOutputDownloadFunction = () => {
88
  console.log("test output download function")
@@ -169,8 +156,7 @@ with gr.Blocks(css="style.css") as demo:
169
  image = gr.Image(
170
  source="canvas", tool="color-sketch", type="pil", image_mode="L",
171
  invert_colors=True, shape=(512, 512), brush_radius=4, height=440, width=440,
172
- brush_color="#000000", interactive=True, show_download_button=True, elem_id="input_image", show_label=False)
173
- download_sketch = gr.Button("Download sketch", scale=1, elem_id="download_sketch")
174
 
175
  gr.HTML("""
176
  <div class="button-row">
 
69
 
70
  scripts = """
71
  async () => {
72
+
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  globalThis.theOutputDownloadFunction = () => {
75
  console.log("test output download function")
 
156
  image = gr.Image(
157
  source="canvas", tool="color-sketch", type="pil", image_mode="L",
158
  invert_colors=True, shape=(512, 512), brush_radius=4, height=440, width=440,
159
+ brush_color="#000000", interactive=True, show_download_button=False, elem_id="input_image", show_label=False)
 
160
 
161
  gr.HTML("""
162
  <div class="button-row">