Fabrice-TIERCELIN commited on
Commit
845cc97
·
verified ·
1 Parent(s): 9b81f36

Improve layout

Browse files
Files changed (1) hide show
  1. app.py +14 -9
app.py CHANGED
@@ -151,11 +151,11 @@ with gr.Blocks() as interface:
151
  )
152
  with gr.Row():
153
  with gr.Column():
154
- dummy_1 = gr.Label()
155
  with gr.Column():
156
  enlarge_top = gr.Number(minimum = 0, value = 64, precision = 0, label = "Enlarge on top", info = "in pixels")
157
  with gr.Column():
158
- dummy_2 = gr.Label()
159
  with gr.Row():
160
  with gr.Column():
161
  enlarge_left = gr.Number(minimum = 0, value = 64, precision = 0, label = "Enlarge on left", info = "in pixels")
@@ -165,15 +165,15 @@ with gr.Blocks() as interface:
165
  enlarge_right = gr.Number(minimum = 0, value = 64, precision = 0, label = "Enlarge on right", info = "in pixels")
166
  with gr.Row():
167
  with gr.Column():
168
- dummy_3 = gr.Label()
169
  with gr.Column():
170
  enlarge_bottom = gr.Number(minimum = 0, value = 64, precision = 0, label = "Enlarge on bottom", info = "in pixels")
171
  with gr.Column():
172
- dummy_4 = gr.Label()
173
  with gr.Row():
174
- with gr.Row():
175
- prompt = gr.Textbox(label = 'Prompt', info = "Describe the subject, the background and the style of image; 77 token limit", placeholder = 'Describe what you want to see in the entire image')
176
- with gr.Accordion("Advanced options", open = False):
177
  negative_prompt = gr.Textbox(label = 'Negative prompt', placeholder = 'Describe what you do NOT want to see in the entire image', value = 'Border, frame, painting, scribbling, smear, noise, blur, watermark')
178
  denoising_steps = gr.Slider(minimum = 0, maximum = 1000, value = 1000, step = 1, label = "Denoising", info = "lower=irrelevant result, higher=relevant result")
179
  num_inference_steps = gr.Slider(minimum = 10, maximum = 25, value = 10, step = 1, label = "Number of inference steps", info = "lower=faster, higher=image quality")
@@ -181,14 +181,19 @@ with gr.Blocks() as interface:
181
  randomize_seed = gr.Checkbox(label = "Randomize seed (not working, always checked)", value = True, info = "If checked, result is always different")
182
  seed = gr.Slider(minimum = 0, maximum = max_64_bit_int, step = 1, randomize = True, label = "Seed (if not randomized)")
183
  debug_mode = gr.Checkbox(label = "Debug mode", value = True, info = "Show intermediate results")
184
- with gr.Row():
185
- submit = gr.Button("Uncrop", variant = "primary")
186
  with gr.Row():
187
  uncropped_image = gr.Image(label = "Uncropped image")
 
188
  information = gr.Label(label = "Information")
 
189
  original_image = gr.Image(label = "Original image")
 
190
  enlarged_image = gr.Image(label = "Enlarged image")
 
191
  mask_image = gr.Image(label = "Mask image")
 
192
  submit.click(predict, inputs = [
193
  source_img,
194
  enlarge_top,
 
151
  )
152
  with gr.Row():
153
  with gr.Column():
154
+ dummy_1 = gr.Label(visible = False)
155
  with gr.Column():
156
  enlarge_top = gr.Number(minimum = 0, value = 64, precision = 0, label = "Enlarge on top", info = "in pixels")
157
  with gr.Column():
158
+ dummy_2 = gr.Label(visible = False)
159
  with gr.Row():
160
  with gr.Column():
161
  enlarge_left = gr.Number(minimum = 0, value = 64, precision = 0, label = "Enlarge on left", info = "in pixels")
 
165
  enlarge_right = gr.Number(minimum = 0, value = 64, precision = 0, label = "Enlarge on right", info = "in pixels")
166
  with gr.Row():
167
  with gr.Column():
168
+ dummy_3 = gr.Label(visible = False)
169
  with gr.Column():
170
  enlarge_bottom = gr.Number(minimum = 0, value = 64, precision = 0, label = "Enlarge on bottom", info = "in pixels")
171
  with gr.Column():
172
+ dummy_4 = gr.Label(visible = False)
173
  with gr.Row():
174
+ prompt = gr.Textbox(label = 'Prompt', info = "Describe the subject, the background and the style of image; 77 token limit", placeholder = 'Describe what you want to see in the entire image')
175
+ with gr.Row():
176
+ with gr.Accordion("Advanced options", open = False):
177
  negative_prompt = gr.Textbox(label = 'Negative prompt', placeholder = 'Describe what you do NOT want to see in the entire image', value = 'Border, frame, painting, scribbling, smear, noise, blur, watermark')
178
  denoising_steps = gr.Slider(minimum = 0, maximum = 1000, value = 1000, step = 1, label = "Denoising", info = "lower=irrelevant result, higher=relevant result")
179
  num_inference_steps = gr.Slider(minimum = 10, maximum = 25, value = 10, step = 1, label = "Number of inference steps", info = "lower=faster, higher=image quality")
 
181
  randomize_seed = gr.Checkbox(label = "Randomize seed (not working, always checked)", value = True, info = "If checked, result is always different")
182
  seed = gr.Slider(minimum = 0, maximum = max_64_bit_int, step = 1, randomize = True, label = "Seed (if not randomized)")
183
  debug_mode = gr.Checkbox(label = "Debug mode", value = True, info = "Show intermediate results")
184
+ with gr.Row():
185
+ submit = gr.Button("Uncrop", variant = "primary")
186
  with gr.Row():
187
  uncropped_image = gr.Image(label = "Uncropped image")
188
+ with gr.Row():
189
  information = gr.Label(label = "Information")
190
+ with gr.Row():
191
  original_image = gr.Image(label = "Original image")
192
+ with gr.Row():
193
  enlarged_image = gr.Image(label = "Enlarged image")
194
+ with gr.Row():
195
  mask_image = gr.Image(label = "Mask image")
196
+
197
  submit.click(predict, inputs = [
198
  source_img,
199
  enlarge_top,