Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -57,15 +57,6 @@ def query(prompt, is_negative=False, steps=30, cfg_scale=7, strength=0.7):
|
|
57 |
print(f"Error when trying to open the image: {e}")
|
58 |
return None
|
59 |
|
60 |
-
def reset_prompt():
|
61 |
-
default_text_prompt = "" # Valor por defecto para el campo de texto
|
62 |
-
default_negative_prompt = "(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" # Valor por defecto para el campo de texto negativo
|
63 |
-
default_steps = 35 # Valor por defecto para el slider de pasos de muestreo
|
64 |
-
default_cfg = 7 # Valor por defecto para el slider de nivel de detalle
|
65 |
-
default_strength = 0.7 # Valor por defecto para el slider de fuerza de transformaci贸n
|
66 |
-
|
67 |
-
return default_text_prompt, default_negative_prompt, default_steps, default_cfg, default_strength
|
68 |
-
|
69 |
css = """
|
70 |
#app-container {
|
71 |
max-width: 100%;
|
@@ -137,10 +128,6 @@ h1, h2, h3, h4, h5, h6 {
|
|
137 |
width: auto;
|
138 |
margin-top: 10px;
|
139 |
}
|
140 |
-
|
141 |
-
#reset-button {
|
142 |
-
display: none; /* Oculta el bot贸n de reinicio en pantallas m贸viles */
|
143 |
-
}
|
144 |
}
|
145 |
|
146 |
@media (min-width: 769px) {
|
@@ -164,7 +151,7 @@ examples = [
|
|
164 |
with gr.Blocks(css=css) as app:
|
165 |
gr.HTML("""
|
166 |
<center>
|
167 |
-
<h1>
|
168 |
<h2>Transforma tus sue帽os en im谩genes vibrantes con un solo clic.</h2>
|
169 |
</center>
|
170 |
""")
|
@@ -212,12 +199,10 @@ with gr.Blocks(css=css) as app:
|
|
212 |
|
213 |
with gr.Row(elem_id="button-container"):
|
214 |
generate_button = gr.Button("QUIERO VER MI SUE脩O", elem_id="generate-button", variant="primary")
|
215 |
-
reset_button = gr.Button("REINICIAR MI SUE脩O", elem_id="reset-button", variant="secondary")
|
216 |
|
217 |
with gr.Column(scale=1):
|
218 |
-
image_output = gr.Image(type="pil", label="
|
219 |
|
220 |
generate_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, strength], outputs=image_output)
|
221 |
-
reset_button.click(reset_prompt, outputs=[text_prompt, negative_prompt, steps, cfg, strength])
|
222 |
|
223 |
app.launch(show_api=False, share=False)
|
|
|
57 |
print(f"Error when trying to open the image: {e}")
|
58 |
return None
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
css = """
|
61 |
#app-container {
|
62 |
max-width: 100%;
|
|
|
128 |
width: auto;
|
129 |
margin-top: 10px;
|
130 |
}
|
|
|
|
|
|
|
|
|
131 |
}
|
132 |
|
133 |
@media (min-width: 769px) {
|
|
|
151 |
with gr.Blocks(css=css) as app:
|
152 |
gr.HTML("""
|
153 |
<center>
|
154 |
+
<h1>Generador de Sue帽os con Flux</h1>
|
155 |
<h2>Transforma tus sue帽os en im谩genes vibrantes con un solo clic.</h2>
|
156 |
</center>
|
157 |
""")
|
|
|
199 |
|
200 |
with gr.Row(elem_id="button-container"):
|
201 |
generate_button = gr.Button("QUIERO VER MI SUE脩O", elem_id="generate-button", variant="primary")
|
|
|
202 |
|
203 |
with gr.Column(scale=1):
|
204 |
+
image_output = gr.Image(type="pil", label="Imagen Resultado", elem_id="gallery")
|
205 |
|
206 |
generate_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, strength], outputs=image_output)
|
|
|
207 |
|
208 |
app.launch(show_api=False, share=False)
|