Spaces:
Runtime error
Runtime error
refactor: Mejorar diseño de interfaz de usuario en app.py
Browse files
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 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
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,
|