Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,7 +59,53 @@ def query(prompt, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Ka
|
|
| 59 |
print(f"Error when trying to open the image: {e}")
|
| 60 |
return None
|
| 61 |
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
gr.HTML("""
|
| 64 |
<center>
|
| 65 |
<h1>Dream Generator with Flux</h1>
|
|
@@ -77,9 +123,9 @@ with gr.Blocks() as app:
|
|
| 77 |
strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
|
| 78 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
|
| 79 |
|
| 80 |
-
with gr.Row():
|
| 81 |
-
clear_button = gr.Button("Clear", elem_id="clear-button", variant="secondary"
|
| 82 |
-
generate_button = gr.Button("Generate", elem_id="generate-button", variant="primary"
|
| 83 |
|
| 84 |
with gr.Column(scale=1):
|
| 85 |
image_output = gr.Image(type="pil", label="Image Output", elem_id="gallery")
|
|
|
|
| 59 |
print(f"Error when trying to open the image: {e}")
|
| 60 |
return None
|
| 61 |
|
| 62 |
+
css = """
|
| 63 |
+
#app-container {
|
| 64 |
+
max-width: 600px;
|
| 65 |
+
margin-left: auto;
|
| 66 |
+
margin-right: auto;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
input, textarea, select {
|
| 70 |
+
background-color: #f5f5f5; /* Fondo gris claro para inputs */
|
| 71 |
+
color: #333333; /* Texto gris oscuro en inputs */
|
| 72 |
+
border: 1px solid #cccccc; /* Borde gris claro en inputs */
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
button {
|
| 76 |
+
background-color: #f5f5f5; /* Fondo gris claro */
|
| 77 |
+
color: #333333; /* Texto gris oscuro */
|
| 78 |
+
border: 2px solid black; /* Borde negro en botones */
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
button.primary {
|
| 82 |
+
background-color: green; /* Fondo verde para el bot贸n 'Generate' */
|
| 83 |
+
color: white; /* Texto blanco en el bot贸n 'Generate' */
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
button.secondary {
|
| 87 |
+
background-color: #f5f5f5; /* Fondo gris claro para el bot贸n 'Clear' */
|
| 88 |
+
color: #333333; /* Texto gris oscuro en el bot贸n 'Clear' */
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
button:hover {
|
| 92 |
+
background-color: #e0e0e0; /* Fondo gris m谩s oscuro en hover */
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
h1, h2, h3, h4, h5, h6 {
|
| 96 |
+
color: #333333; /* Texto gris oscuro en encabezados */
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
@media (max-width: 768px) {
|
| 100 |
+
.button-row {
|
| 101 |
+
display: flex;
|
| 102 |
+
flex-direction: column;
|
| 103 |
+
gap: 10px;
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
"""
|
| 107 |
+
|
| 108 |
+
with gr.Blocks(css=css) as app:
|
| 109 |
gr.HTML("""
|
| 110 |
<center>
|
| 111 |
<h1>Dream Generator with Flux</h1>
|
|
|
|
| 123 |
strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
|
| 124 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
|
| 125 |
|
| 126 |
+
with gr.Row(elem_id="button-row"):
|
| 127 |
+
clear_button = gr.Button("Clear", elem_id="clear-button", variant="secondary")
|
| 128 |
+
generate_button = gr.Button("Generate", elem_id="generate-button", variant="primary")
|
| 129 |
|
| 130 |
with gr.Column(scale=1):
|
| 131 |
image_output = gr.Image(type="pil", label="Image Output", elem_id="gallery")
|