Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -60,46 +60,20 @@ def query(prompt, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Ka
|
|
60 |
print(f"Error when trying to open the image: {e}")
|
61 |
return None
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
}
|
71 |
-
|
72 |
-
input, textarea, select {
|
73 |
-
background-color: #f5f5f5; /* Fondo gris claro para inputs */
|
74 |
-
color: #333333; /* Texto gris oscuro en inputs */
|
75 |
-
border: 1px solid #cccccc; /* Borde gris claro en inputs */
|
76 |
-
}
|
77 |
-
|
78 |
-
button {
|
79 |
-
background-color: #f28f8f; /* Fondo rojo */
|
80 |
-
color: #ffffff; /* Texto blanco en botones */
|
81 |
-
border: 1px solid #f28f8f; /* Borde rojo en botones */
|
82 |
-
}
|
83 |
-
|
84 |
-
button:hover {
|
85 |
-
background-color: #e74c3c; /* Rojo oscuro en hover */
|
86 |
-
}
|
87 |
-
|
88 |
-
h1, h2, h3, h4, h5, h6 {
|
89 |
-
color: #f28f8f; /* Texto rojo en encabezados */
|
90 |
-
}
|
91 |
-
"""
|
92 |
-
|
93 |
-
with gr.Blocks(css=css) as app:
|
94 |
-
gr.HTML("<center><h1>FLUX.1-Dev</h1></center>")
|
95 |
-
with gr.Column(elem_id="app-container"):
|
96 |
with gr.Row():
|
97 |
-
with gr.Column(
|
98 |
with gr.Row():
|
99 |
-
text_prompt = gr.Textbox(label="Prompt", placeholder="Enter a prompt here", lines=2
|
100 |
with gr.Row():
|
101 |
with gr.Accordion("Advanced Settings", open=False):
|
102 |
-
negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="What should not be in the image", value="(deformed, distorted, disfigured), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, misspellings, typos", lines=3
|
103 |
steps = gr.Slider(label="Sampling steps", value=35, minimum=1, maximum=100, step=1)
|
104 |
cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
|
105 |
method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
|
@@ -107,9 +81,9 @@ with gr.Blocks(css=css) as app:
|
|
107 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
|
108 |
|
109 |
with gr.Row():
|
110 |
-
text_button = gr.Button("Run", variant='primary'
|
111 |
with gr.Row():
|
112 |
-
image_output = gr.Image(type="pil", label="Image Output"
|
113 |
|
114 |
text_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, method, seed, strength], outputs=image_output)
|
115 |
|
|
|
60 |
print(f"Error when trying to open the image: {e}")
|
61 |
return None
|
62 |
|
63 |
+
with gr.Blocks() as app:
|
64 |
+
gr.HTML("""
|
65 |
+
<center><h1 style="color: #f28f8f;">Dream Generator with Flux</h1></center>
|
66 |
+
<center><h2 style="color: #333333;">Transforma tus sueños en imágenes vibrantes con un solo clic.</h2></center>
|
67 |
+
""")
|
68 |
+
|
69 |
+
with gr.Column():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
with gr.Row():
|
71 |
+
with gr.Column():
|
72 |
with gr.Row():
|
73 |
+
text_prompt = gr.Textbox(label="Prompt", placeholder="Enter a prompt here", lines=2)
|
74 |
with gr.Row():
|
75 |
with gr.Accordion("Advanced Settings", open=False):
|
76 |
+
negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="What should not be in the image", value="(deformed, distorted, disfigured), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, misspellings, typos", lines=3)
|
77 |
steps = gr.Slider(label="Sampling steps", value=35, minimum=1, maximum=100, step=1)
|
78 |
cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
|
79 |
method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
|
|
|
81 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
|
82 |
|
83 |
with gr.Row():
|
84 |
+
text_button = gr.Button("Run", variant='primary')
|
85 |
with gr.Row():
|
86 |
+
image_output = gr.Image(type="pil", label="Image Output")
|
87 |
|
88 |
text_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, method, seed, strength], outputs=image_output)
|
89 |
|