linoyts HF staff commited on
Commit
0ad8efc
·
verified ·
1 Parent(s): 06ee083

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -393,7 +393,8 @@ with gr.Blocks(delete_cache=(600, 600), js=js_func) as demo:
393
  with gr.Tabs() as input_tabs:
394
  with gr.Tab(label="Single Image", id=0) as single_image_input_tab:
395
  #image_prompt = gr.Image(label="Image Prompt", format="png", image_mode="RGBA", type="pil", height=300)
396
- image_prompt = image = gr.ImageEditor(type="pil", image_mode="L", crop_size=(512, 512))
 
397
  with gr.Column():
398
  prompt = gr.Textbox(label="Prompt")
399
  with gr.Row():
@@ -486,9 +487,10 @@ with gr.Blocks(delete_cache=(600, 600), js=js_func) as demo:
486
  # inputs=[image_prompt, prompt, negative_prompt, style, do_preprocess],
487
  # outputs=[image_prompt, do_preprocess],
488
  # )
489
- image_prompt.change(
490
- reset_do_preprocess,
491
- outputs=[do_preprocess]
 
492
  )
493
  multiimage_prompt.upload(
494
  preprocess_images,
@@ -500,10 +502,6 @@ with gr.Blocks(delete_cache=(600, 600), js=js_func) as demo:
500
  get_seed,
501
  inputs=[randomize_seed, seed],
502
  outputs=[seed],
503
- ).then(
504
- preprocess_image,
505
- inputs=[image_prompt, prompt, negative_prompt, style, do_preprocess],
506
- outputs=[image_prompt, do_preprocess],
507
  ).then(
508
  image_to_3d,
509
  inputs=[image_prompt, multiimage_prompt, is_multiimage, seed, ss_guidance_strength, ss_sampling_steps, slat_guidance_strength, slat_sampling_steps, multiimage_algo, do_preprocess],
 
393
  with gr.Tabs() as input_tabs:
394
  with gr.Tab(label="Single Image", id=0) as single_image_input_tab:
395
  #image_prompt = gr.Image(label="Image Prompt", format="png", image_mode="RGBA", type="pil", height=300)
396
+ image_prompt = gr.ImageEditor(type="pil", image_mode="L", crop_size=(512, 512))
397
+ sketch_btn = gr.Button("process sketch")
398
  with gr.Column():
399
  prompt = gr.Textbox(label="Prompt")
400
  with gr.Row():
 
487
  # inputs=[image_prompt, prompt, negative_prompt, style, do_preprocess],
488
  # outputs=[image_prompt, do_preprocess],
489
  # )
490
+ sketch_btn.click(
491
+ preprocess_image,
492
+ inputs=[image_prompt, prompt, negative_prompt, style, do_preprocess],
493
+ outputs=[image_prompt, do_preprocess],
494
  )
495
  multiimage_prompt.upload(
496
  preprocess_images,
 
502
  get_seed,
503
  inputs=[randomize_seed, seed],
504
  outputs=[seed],
 
 
 
 
505
  ).then(
506
  image_to_3d,
507
  inputs=[image_prompt, multiimage_prompt, is_multiimage, seed, ss_guidance_strength, ss_sampling_steps, slat_guidance_strength, slat_sampling_steps, multiimage_algo, do_preprocess],