yashvii commited on
Commit
71e256a
1 Parent(s): 950d754

Add submit button and change watermark dimensions

Browse files
Files changed (1) hide show
  1. gradio_demo/app.py +30 -30
gradio_demo/app.py CHANGED
@@ -49,7 +49,7 @@ controlnet_path = f'./checkpoints/ControlNetModel'
49
  controlnet = ControlNetModel.from_pretrained(controlnet_path, torch_dtype=dtype)
50
 
51
  logo = Image.open("./gradio_demo/watermark.png")
52
- logo = logo.resize((100, 70))
53
 
54
  from cv2 import imencode
55
  import base64
@@ -422,7 +422,7 @@ def main(pretrained_model_name_or_path="wangqixun/YamerMIX_v8", enable_lcm_arg=F
422
  justify-content: center;
423
  align-items: center;
424
  width: 100%;}
425
- #store-btn {
426
  background: linear-gradient(to right, #ffffff, #f2bb13); !important;
427
  color: #254977 !important;
428
  }
@@ -439,7 +439,7 @@ def main(pretrained_model_name_or_path="wangqixun/YamerMIX_v8", enable_lcm_arg=F
439
  with gr.Row(equal_height=True): # Center the face file
440
  with gr.Column(elem_id="centered-face", elem_classes=["centered-column"]): # Use CSS class for centering
441
  face_file = gr.Image(label="Upload a photo of your face", type="pil", height=400, width=500)
442
- # submit = gr.Button("Submit", variant="primary")
443
  with gr.Column():
444
  with gr.Row():
445
  gallery1 = gr.Image(label="Generated Images")
@@ -499,34 +499,34 @@ def main(pretrained_model_name_or_path="wangqixun/YamerMIX_v8", enable_lcm_arg=F
499
  inputs=[face_file,style],
500
  outputs=[gallery4]
501
  )
502
- # submit.click(
503
- # fn=remove_tips,
504
- # outputs=usage_tips,
505
- # queue=True,
506
- # api_name=False,
507
- # show_progress = "full"
508
- # ).then(
509
- # fn=run_for_prompts1,
510
- # inputs=[face_file,style],
511
- # outputs=[gallery1]
512
- # ).then(
513
- # fn=run_for_prompts2,
514
- # inputs=[face_file,style],
515
- # outputs=[gallery2]
516
- # ).then(
517
- # fn=run_for_prompts3,
518
- # inputs=[face_file,style],
519
- # outputs=[gallery3]
520
- # ).then(
521
- # fn=run_for_prompts4,
522
- # inputs=[face_file,style],
523
- # outputs=[gallery4]
524
- # )
525
 
526
- # submit1.click(
527
- # fn=store_images,
528
- # inputs=[email,gallery1,gallery2,gallery3,gallery4,consent],
529
- # outputs=None)
530
 
531
 
532
 
 
49
  controlnet = ControlNetModel.from_pretrained(controlnet_path, torch_dtype=dtype)
50
 
51
  logo = Image.open("./gradio_demo/watermark.png")
52
+ logo = logo.resize((100, 100))
53
 
54
  from cv2 import imencode
55
  import base64
 
422
  justify-content: center;
423
  align-items: center;
424
  width: 100%;}
425
+ sub-btn,#store-btn {
426
  background: linear-gradient(to right, #ffffff, #f2bb13); !important;
427
  color: #254977 !important;
428
  }
 
439
  with gr.Row(equal_height=True): # Center the face file
440
  with gr.Column(elem_id="centered-face", elem_classes=["centered-column"]): # Use CSS class for centering
441
  face_file = gr.Image(label="Upload a photo of your face", type="pil", height=400, width=500)
442
+ submit = gr.Button("Submit", variant="primary",elem_id="sub-btn")
443
  with gr.Column():
444
  with gr.Row():
445
  gallery1 = gr.Image(label="Generated Images")
 
499
  inputs=[face_file,style],
500
  outputs=[gallery4]
501
  )
502
+ submit.click(
503
+ fn=remove_tips,
504
+ outputs=usage_tips,
505
+ queue=True,
506
+ api_name=False,
507
+ show_progress = "full"
508
+ ).then(
509
+ fn=run_for_prompts1,
510
+ inputs=[face_file,style],
511
+ outputs=[gallery1]
512
+ ).then(
513
+ fn=run_for_prompts2,
514
+ inputs=[face_file,style],
515
+ outputs=[gallery2]
516
+ ).then(
517
+ fn=run_for_prompts3,
518
+ inputs=[face_file,style],
519
+ outputs=[gallery3]
520
+ ).then(
521
+ fn=run_for_prompts4,
522
+ inputs=[face_file,style],
523
+ outputs=[gallery4]
524
+ )
525
 
526
+ submit1.click(
527
+ fn=store_images,
528
+ inputs=[email,gallery1,gallery2,gallery3,gallery4,consent],
529
+ outputs=None)
530
 
531
 
532