Lisandro commited on
Commit
c53e7e5
·
1 Parent(s): f70d5f1

refactor: Mejorar diseño de interfaz de usuario en app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -34
app.py CHANGED
@@ -19,40 +19,43 @@ def refine_image(image, prompt, negative_prompt, num_inference_steps, guidance_s
19
  return [image, refined_image]
20
 
21
  with gr.Blocks() as demo:
22
- image = gr.Image(type="filepath")
23
- prompt = gr.Textbox(lines=3, label="Prompt")
24
- negative_prompt = gr.Textbox(lines=3, label="Negative Prompt")
25
- strength = gr.Slider(
26
- label="Strength",
27
- minimum=0,
28
- maximum=300,
29
- step=0.01,
30
- value=1
31
- )
32
- num_inference_steps = gr.Slider(
33
- label="Inference steps",
34
- minimum=3,
35
- maximum=150,
36
- step=1,
37
- value=25
38
- )
39
- guidance_scale = gr.Slider(
40
- label="Guidance scale",
41
- minimum=0.0,
42
- maximum=50.0,
43
- step=0.1,
44
- value=12
45
- )
46
- seed = gr.Slider(
47
- label="Seed",
48
- info="-1 denotes a random seed",
49
- minimum=-1,
50
- maximum=423538377342,
51
- step=1,
52
- value=-1
53
- )
54
- refine_btn = gr.Button("Refine")
55
- output = ImageSlider(label="Before / After")
 
 
 
56
 
57
  refine_btn.click(
58
  refine_image,
 
19
  return [image, refined_image]
20
 
21
  with gr.Blocks() as demo:
22
+ with gr.Row():
23
+ with gr.Column():
24
+ image = gr.Image(type="filepath")
25
+ prompt = gr.Textbox(lines=3, label="Prompt")
26
+ negative_prompt = gr.Textbox(lines=3, label="Negative Prompt")
27
+ strength = gr.Slider(
28
+ label="Strength",
29
+ minimum=0,
30
+ maximum=300,
31
+ step=0.01,
32
+ value=1
33
+ )
34
+ num_inference_steps = gr.Slider(
35
+ label="Inference steps",
36
+ minimum=3,
37
+ maximum=150,
38
+ step=1,
39
+ value=25
40
+ )
41
+ guidance_scale = gr.Slider(
42
+ label="Guidance scale",
43
+ minimum=0.0,
44
+ maximum=50.0,
45
+ step=0.1,
46
+ value=12
47
+ )
48
+ seed = gr.Slider(
49
+ label="Seed",
50
+ info="-1 denotes a random seed",
51
+ minimum=-1,
52
+ maximum=423538377342,
53
+ step=1,
54
+ value=-1
55
+ )
56
+ refine_btn = gr.Button("Refine")
57
+ with gr.Column():
58
+ output = ImageSlider(label="Before / After")
59
 
60
  refine_btn.click(
61
  refine_image,