Fabrice-TIERCELIN commited on
Commit
d5fc5bb
·
verified ·
1 Parent(s): 6a6ba72

Move options

Browse files
Files changed (1) hide show
  1. gradio_demo.py +13 -13
gradio_demo.py CHANGED
@@ -286,9 +286,17 @@ with gr.Blocks(title="SUPIR") as interface:
286
  gr.HTML(title_html)
287
 
288
  input_image = gr.Image(label="Input", show_label=True, type="numpy", height=600, elem_id="image-input")
289
- prompt = gr.Textbox(label="Image description", value="", placeholder="A person, walking, in a town, Summer, photorealistic", lines=3)
 
 
 
 
 
 
 
 
290
 
291
- with gr.Accordion("Pre-denoising", open=False):
292
  gamma_correction = gr.Slider(label="Gamma Correction", minimum=0.1, maximum=2.0, value=1.0, step=0.1)
293
  denoise_button = gr.Button(value="Pre-denoise")
294
  denoise_image = gr.Image(label="Denoised image", show_label=True, type="numpy", height=600, elem_id="image-s1")
@@ -299,25 +307,17 @@ with gr.Blocks(title="SUPIR") as interface:
299
  top_p = gr.Slider(label="Top P", info = "Percent of tokens shortlisted", minimum=0., maximum=1.0, value=0.7, step=0.1)
300
  qs = gr.Textbox(label="Question", info="Ask LLaVa what description you want", value="Describe the image and its style in a very detailed manner. The image is a realistic photography, not an art painting.", lines=3)
301
 
302
- with gr.Accordion("Restoring options", open=False):
303
- upscale = gr.Radio([1, 2, 3, 4, 5, 6, 7, 8], label="Upscale factor", info="Resolution x1 to x8", value=2, interactive=True)
304
- a_prompt = gr.Textbox(label="Default Positive Prompt",
305
- info="Describe what the image represents",
306
- value='Cinematic, High Contrast, highly detailed, taken using a Canon EOS R '
307
- 'camera, hyper detailed photo - realistic maximum detail, 32k, Color '
308
- 'Grading, ultra HD, extreme meticulous detailing, skin pore detailing, '
309
- 'hyper sharpness, perfect without deformations.',
310
- lines=3)
311
- n_prompt = gr.Textbox(label="Default Negative Prompt",
312
  info="List what the image does NOT represent",
313
  value='painting, oil painting, illustration, drawing, art, sketch, anime, '
314
  'cartoon, CG Style, 3D render, unreal engine, blurring, bokeh, ugly, dirty, messy, '
315
  'worst quality, low quality, frames, watermark, signature, jpeg artifacts, '
316
  'deformed, lowres, over-smooth',
317
  lines=3)
 
318
  num_samples = gr.Slider(label="Num Samples", info="Number of generated results; I discourage to increase because the process is limited to 4 min", minimum=1, maximum=4 if not args.use_image_slider else 1
319
  , value=1, step=1)
320
- edm_steps = gr.Slider(label="Steps", info="lower=faster, higher=more details", minimum=1, maximum=200, value=default_setting.edm_steps if torch.cuda.device_count() > 0 else 1, step=1)
321
  with gr.Row():
322
  with gr.Column():
323
  model_select = gr.Radio(["v0-Q", "v0-F"], label="Model Selection", info="Q=Quality, F=Fidelity", value="v0-Q",
 
286
  gr.HTML(title_html)
287
 
288
  input_image = gr.Image(label="Input", show_label=True, type="numpy", height=600, elem_id="image-input")
289
+ prompt = gr.Textbox(label="Image description", value="", placeholder="A person, walking, in a town, Summer, photorealistic", lines=3, visible=False)
290
+ upscale = gr.Radio([1, 2, 3, 4, 5, 6, 7, 8], label="Upscale factor", info="Resolution x1 to x8", value=2, interactive=True)
291
+ a_prompt = gr.Textbox(label="Positive Prompt",
292
+ info="Describe what the image represents",
293
+ value='Cinematic, High Contrast, highly detailed, taken using a Canon EOS R '
294
+ 'camera, hyper detailed photo - realistic maximum detail, 32k, Color '
295
+ 'Grading, ultra HD, extreme meticulous detailing, skin pore detailing, '
296
+ 'hyper sharpness, perfect without deformations.',
297
+ lines=3)
298
 
299
+ with gr.Accordion("Pre-denoising (optional)", open=False):
300
  gamma_correction = gr.Slider(label="Gamma Correction", minimum=0.1, maximum=2.0, value=1.0, step=0.1)
301
  denoise_button = gr.Button(value="Pre-denoise")
302
  denoise_image = gr.Image(label="Denoised image", show_label=True, type="numpy", height=600, elem_id="image-s1")
 
307
  top_p = gr.Slider(label="Top P", info = "Percent of tokens shortlisted", minimum=0., maximum=1.0, value=0.7, step=0.1)
308
  qs = gr.Textbox(label="Question", info="Ask LLaVa what description you want", value="Describe the image and its style in a very detailed manner. The image is a realistic photography, not an art painting.", lines=3)
309
 
310
+ with gr.Accordion("Advanced options", open=False):
311
+ n_prompt = gr.Textbox(label="Negative Prompt",
 
 
 
 
 
 
 
 
312
  info="List what the image does NOT represent",
313
  value='painting, oil painting, illustration, drawing, art, sketch, anime, '
314
  'cartoon, CG Style, 3D render, unreal engine, blurring, bokeh, ugly, dirty, messy, '
315
  'worst quality, low quality, frames, watermark, signature, jpeg artifacts, '
316
  'deformed, lowres, over-smooth',
317
  lines=3)
318
+ edm_steps = gr.Slider(label="Steps", info="lower=faster, higher=more details", minimum=1, maximum=200, value=default_setting.edm_steps if torch.cuda.device_count() > 0 else 1, step=1)
319
  num_samples = gr.Slider(label="Num Samples", info="Number of generated results; I discourage to increase because the process is limited to 4 min", minimum=1, maximum=4 if not args.use_image_slider else 1
320
  , value=1, step=1)
 
321
  with gr.Row():
322
  with gr.Column():
323
  model_select = gr.Radio(["v0-Q", "v0-F"], label="Model Selection", info="Q=Quality, F=Fidelity", value="v0-Q",