nsfwalex commited on
Commit
b4d8694
β€’
1 Parent(s): b27bc0d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -14
app.py CHANGED
@@ -43,8 +43,9 @@ title = "Undress AI"
43
  description = "β›” Input photos of people, similar to the test picture at the bottom, and undress pictures will be produced. You may have to wait 30 seconds for a picture. πŸ”ž Do not upload personal photos πŸ”ž There is a queue system. According to the logic of first come, first served, only one picture will be made at a time. Must be able to at least see the outline of a human body β›”"
44
 
45
  examples = [
46
- ['input.png', 'Test'],
47
- ['input.jpg', 'Test'],
 
48
  ]
49
 
50
  css = """
@@ -58,24 +59,21 @@ body {
58
  }
59
  footer {display: none !important;}
60
  """
61
-
62
  with gr.Blocks(css=css) as demo:
63
- width=240
64
- height=320
 
 
 
65
  with gr.Row():
66
  with gr.Column(scale=2): # Adjust scale for proper sizing
67
- image_input = gr.Image(type="numpy", label="Upload Image", width=width, height=height,scale=1)
68
- process_button = gr.Button("Nude!",scale=1)
69
- status = gr.Markdown(value="")
70
- with gr.Column(scale=1): # Adjust scale for proper sizing
71
- gr.Markdown("### Examples")
72
- example_1 = gr.Examples(examples=[examples[0]], inputs=image_input, examples_per_page=1)
73
- example_2 = gr.Examples(examples=[examples[1]], inputs=image_input, examples_per_page=1)
74
 
75
  def update_status(img):
76
- status.update(value="Processing... Please wait.")
77
  processed_img = inference(img)
78
- status.update(value="Processing complete!")
79
  return processed_img
80
 
81
  process_button.click(update_status, inputs=image_input, outputs=image_input)
 
43
  description = "β›” Input photos of people, similar to the test picture at the bottom, and undress pictures will be produced. You may have to wait 30 seconds for a picture. πŸ”ž Do not upload personal photos πŸ”ž There is a queue system. According to the logic of first come, first served, only one picture will be made at a time. Must be able to at least see the outline of a human body β›”"
44
 
45
  examples = [
46
+ ['example1.png'],
47
+ ['example2.png'],
48
+ ['example3.png'],
49
  ]
50
 
51
  css = """
 
59
  }
60
  footer {display: none !important;}
61
  """
62
+
63
  with gr.Blocks(css=css) as demo:
64
+ url_params = gr.State()
65
+ demo.load(get_params, None, url_params)
66
+ url_params = url_params.value
67
+ width=320
68
+ height=240
69
  with gr.Row():
70
  with gr.Column(scale=2): # Adjust scale for proper sizing
71
+ image_input = gr.Image(type="numpy", label="Upload Image", width=width, height=height)
72
+ gr.Examples(examples=examples, inputs=image_input, examples_per_page=3)
73
+ process_button = gr.Button("Nude!").style(width=width)
 
 
 
 
74
 
75
  def update_status(img):
 
76
  processed_img = inference(img)
 
77
  return processed_img
78
 
79
  process_button.click(update_status, inputs=image_input, outputs=image_input)