fountai commited on
Commit
9d70bcc
1 Parent(s): 7da477e

add debug mode

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -103,7 +103,7 @@ MAX_SEED = np.iinfo(np.int32).max
103
  TRIGGER = "a photo of TOK"
104
 
105
  @spaces.GPU(duration=100)
106
- def execute(image, prompt):
107
  if not prompt :
108
  gr.Info("Please enter a text prompt.")
109
  return None
@@ -146,6 +146,10 @@ def execute(image, prompt):
146
  max_sequence_length=256,
147
  joint_attention_kwargs={"scale": 0.9},
148
  ).images[0]
 
 
 
 
149
  response.append(result)
150
 
151
  return response
@@ -160,7 +164,8 @@ iface = gr.Interface(
160
  title=title,
161
  inputs=[
162
  gr.Image(type="filepath"),
163
- gr.Textbox(label="Prompt")
 
164
  ],
165
  outputs="gallery"
166
  )
 
103
  TRIGGER = "a photo of TOK"
104
 
105
  @spaces.GPU(duration=100)
106
+ def execute(image, prompt, debug=False):
107
  if not prompt :
108
  gr.Info("Please enter a text prompt.")
109
  return None
 
146
  max_sequence_length=256,
147
  joint_attention_kwargs={"scale": 0.9},
148
  ).images[0]
149
+
150
+ if debug:
151
+ response.appeend(im)
152
+ response.appeend(mask)
153
  response.append(result)
154
 
155
  return response
 
164
  title=title,
165
  inputs=[
166
  gr.Image(type="filepath"),
167
+ gr.Textbox(label="Prompt"),
168
+ gr.Checkbox(label="Debug Mode")
169
  ],
170
  outputs="gallery"
171
  )