Deadmon commited on
Commit
d278cd3
1 Parent(s): 0e8b5b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -233,9 +233,9 @@ def run(
233
  image = Image.fromarray(controlnet_img)
234
  elif not use_hed:
235
  controlnet_img = resized_image
 
236
  else:
237
  controlnet_img = processor(resized_image, scribble=False)
238
- # Process controlnet_img as before...
239
  controlnet_img = np.array(controlnet_img)
240
  controlnet_img = nms(controlnet_img, 127, 3)
241
  controlnet_img = cv2.GaussianBlur(controlnet_img, (0, 0), 3)
@@ -275,7 +275,6 @@ def run(
275
 
276
  return (controlnet_img, out)
277
 
278
-
279
  with gr.Blocks(css="style.css", js=js_func) as demo:
280
  gr.Markdown(DESCRIPTION, elem_id="description")
281
  gr.DuplicateButton(
@@ -287,7 +286,7 @@ with gr.Blocks(css="style.css", js=js_func) as demo:
287
  with gr.Row():
288
  with gr.Column():
289
  with gr.Group():
290
- image = gr.ImageEditor(type="pil",label="Sketch your image or upload one", crop_size="1:1", width=512, height=512,)
291
  prompt = gr.Textbox(label="Prompt")
292
  style = gr.Dropdown(label="Style", choices=STYLE_NAMES, value=DEFAULT_STYLE_NAME)
293
  use_hed = gr.Checkbox(label="use HED detector", value=False, info="check this box if you upload an image and want to turn it to a sketch")
 
233
  image = Image.fromarray(controlnet_img)
234
  elif not use_hed:
235
  controlnet_img = resized_image
236
+ image = resized_image
237
  else:
238
  controlnet_img = processor(resized_image, scribble=False)
 
239
  controlnet_img = np.array(controlnet_img)
240
  controlnet_img = nms(controlnet_img, 127, 3)
241
  controlnet_img = cv2.GaussianBlur(controlnet_img, (0, 0), 3)
 
275
 
276
  return (controlnet_img, out)
277
 
 
278
  with gr.Blocks(css="style.css", js=js_func) as demo:
279
  gr.Markdown(DESCRIPTION, elem_id="description")
280
  gr.DuplicateButton(
 
286
  with gr.Row():
287
  with gr.Column():
288
  with gr.Group():
289
+ image = gr.ImageEditor(type="pil", label="Sketch your image or upload one", width=512, height=512)
290
  prompt = gr.Textbox(label="Prompt")
291
  style = gr.Dropdown(label="Style", choices=STYLE_NAMES, value=DEFAULT_STYLE_NAME)
292
  use_hed = gr.Checkbox(label="use HED detector", value=False, info="check this box if you upload an image and want to turn it to a sketch")