Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -194,45 +194,45 @@ def img2img(input_image, denoising, prompt, negative_prompt, model, steps, sampl
|
|
| 194 |
|
| 195 |
css = """
|
| 196 |
#generate {
|
| 197 |
-
height:
|
| 198 |
}
|
| 199 |
"""
|
| 200 |
|
| 201 |
with gr.Blocks(css=css) as demo:
|
| 202 |
with gr.Row():
|
| 203 |
with gr.Column(scale=6):
|
| 204 |
-
model = gr.Dropdown(interactive=True,value="absolutereality_v181.safetensors [3d9d4d2b]", show_label=True, label="
|
| 205 |
|
| 206 |
with gr.Tabs() as tabs:
|
| 207 |
with gr.Tab("txt2img", id='t2i'):
|
| 208 |
with gr.Row():
|
| 209 |
with gr.Column(scale=6, min_width=600):
|
| 210 |
-
prompt = gr.Textbox("", placeholder="
|
| 211 |
-
negative_prompt = gr.Textbox(placeholder="
|
| 212 |
with gr.Column():
|
| 213 |
-
text_button = gr.Button("
|
| 214 |
|
| 215 |
with gr.Row():
|
| 216 |
with gr.Column(scale=3):
|
| 217 |
with gr.Tab("Generation"):
|
| 218 |
with gr.Row():
|
| 219 |
with gr.Column(scale=1):
|
| 220 |
-
sampler = gr.Dropdown(value="DPM++ 2M Karras", show_label=True, label="
|
| 221 |
|
| 222 |
with gr.Column(scale=1):
|
| 223 |
-
steps = gr.Slider(label="
|
| 224 |
|
| 225 |
with gr.Row():
|
| 226 |
with gr.Column(scale=1):
|
| 227 |
-
width = gr.Slider(label="
|
| 228 |
-
height = gr.Slider(label="
|
| 229 |
|
| 230 |
with gr.Column(scale=1):
|
| 231 |
-
batch_size = gr.Slider(label="
|
| 232 |
-
batch_count = gr.Slider(label="
|
| 233 |
|
| 234 |
-
cfg_scale = gr.Slider(label="
|
| 235 |
-
seed = gr.Number(label="
|
| 236 |
|
| 237 |
with gr.Column(scale=2):
|
| 238 |
image_output = gr.Image(value="https://huggingface.co/spaces/salomonsky/fast/raw/main/image.jpg")
|
|
@@ -243,10 +243,10 @@ with gr.Blocks(css=css) as demo:
|
|
| 243 |
with gr.Tab("img2img", id='i2i'):
|
| 244 |
with gr.Row():
|
| 245 |
with gr.Column(scale=6, min_width=600):
|
| 246 |
-
i2i_prompt = gr.Textbox("
|
| 247 |
-
i2i_negative_prompt = gr.Textbox(placeholder="
|
| 248 |
with gr.Column():
|
| 249 |
-
i2i_text_button = gr.Button("
|
| 250 |
|
| 251 |
with gr.Row():
|
| 252 |
with gr.Column(scale=3):
|
|
@@ -255,23 +255,23 @@ with gr.Blocks(css=css) as demo:
|
|
| 255 |
|
| 256 |
with gr.Row():
|
| 257 |
with gr.Column(scale=1):
|
| 258 |
-
i2i_sampler = gr.Dropdown(value="Euler a", show_label=True, label="
|
| 259 |
|
| 260 |
with gr.Column(scale=1):
|
| 261 |
-
i2i_steps = gr.Slider(label="
|
| 262 |
|
| 263 |
with gr.Row():
|
| 264 |
with gr.Column(scale=1):
|
| 265 |
-
i2i_width = gr.Slider(label="
|
| 266 |
-
i2i_height = gr.Slider(label="
|
| 267 |
|
| 268 |
with gr.Column(scale=1):
|
| 269 |
-
i2i_batch_size = gr.Slider(label="
|
| 270 |
-
i2i_batch_count = gr.Slider(label="
|
| 271 |
|
| 272 |
-
i2i_cfg_scale = gr.Slider(label="
|
| 273 |
-
i2i_denoising = gr.Slider(label="
|
| 274 |
-
i2i_seed = gr.Number(label="
|
| 275 |
|
| 276 |
with gr.Column(scale=2):
|
| 277 |
i2i_image_output = gr.Image(value="https://huggingface.co/spaces/salomonsky/fast/raw/main/image.jpg")
|
|
@@ -300,7 +300,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 300 |
""".strip()+"\n"
|
| 301 |
|
| 302 |
if len(info) == 0:
|
| 303 |
-
message = "
|
| 304 |
info = f"<div><p>{message}<p></div>"
|
| 305 |
|
| 306 |
return info
|
|
@@ -310,8 +310,8 @@ with gr.Blocks(css=css) as demo:
|
|
| 310 |
image_input = gr.Image(type="pil")
|
| 311 |
|
| 312 |
with gr.Column():
|
| 313 |
-
exif_output = gr.HTML(label="
|
| 314 |
-
send_to_txt2img_btn = gr.Button("
|
| 315 |
|
| 316 |
image_input.upload(get_exif_data, inputs=[image_input], outputs=exif_output)
|
| 317 |
send_to_txt2img_btn.click(send_to_txt2img, inputs=[image_input], outputs=[tabs, prompt, negative_prompt,
|
|
|
|
| 194 |
|
| 195 |
css = """
|
| 196 |
#generate {
|
| 197 |
+
height: 70%;
|
| 198 |
}
|
| 199 |
"""
|
| 200 |
|
| 201 |
with gr.Blocks(css=css) as demo:
|
| 202 |
with gr.Row():
|
| 203 |
with gr.Column(scale=6):
|
| 204 |
+
model = gr.Dropdown(interactive=True,value="absolutereality_v181.safetensors [3d9d4d2b]", show_label=True, label="Modelos de Inteligencia Artificial", choices=prodia_client.list_models())
|
| 205 |
|
| 206 |
with gr.Tabs() as tabs:
|
| 207 |
with gr.Tab("txt2img", id='t2i'):
|
| 208 |
with gr.Row():
|
| 209 |
with gr.Column(scale=6, min_width=600):
|
| 210 |
+
prompt = gr.Textbox("", placeholder="Palabras", show_label=False, lines=3)
|
| 211 |
+
negative_prompt = gr.Textbox(placeholder="Exclusi贸n", show_label=False, lines=3, value="")
|
| 212 |
with gr.Column():
|
| 213 |
+
text_button = gr.Button("Generar", variant='primary', elem_id="generate")
|
| 214 |
|
| 215 |
with gr.Row():
|
| 216 |
with gr.Column(scale=3):
|
| 217 |
with gr.Tab("Generation"):
|
| 218 |
with gr.Row():
|
| 219 |
with gr.Column(scale=1):
|
| 220 |
+
sampler = gr.Dropdown(value="DPM++ 2M Karras", show_label=True, label="Sampleo", choices=prodia_client.list_samplers())
|
| 221 |
|
| 222 |
with gr.Column(scale=1):
|
| 223 |
+
steps = gr.Slider(label="Pasos", minimum=1, maximum=30, value=25, step=1)
|
| 224 |
|
| 225 |
with gr.Row():
|
| 226 |
with gr.Column(scale=1):
|
| 227 |
+
width = gr.Slider(label="Ancho", maximum=1024, value=512, step=8)
|
| 228 |
+
height = gr.Slider(label="Alto", maximum=1024, value=512, step=8)
|
| 229 |
|
| 230 |
with gr.Column(scale=1):
|
| 231 |
+
batch_size = gr.Slider(label="Tama帽o", maximum=1, value=1)
|
| 232 |
+
batch_count = gr.Slider(label="Cuenta", maximum=1, value=1)
|
| 233 |
|
| 234 |
+
cfg_scale = gr.Slider(label="Escala", minimum=1, maximum=20, value=7, step=1)
|
| 235 |
+
seed = gr.Number(label="Semillas", value=-1)
|
| 236 |
|
| 237 |
with gr.Column(scale=2):
|
| 238 |
image_output = gr.Image(value="https://huggingface.co/spaces/salomonsky/fast/raw/main/image.jpg")
|
|
|
|
| 243 |
with gr.Tab("img2img", id='i2i'):
|
| 244 |
with gr.Row():
|
| 245 |
with gr.Column(scale=6, min_width=600):
|
| 246 |
+
i2i_prompt = gr.Textbox("", placeholder="Busqueda", show_label=False, lines=3)
|
| 247 |
+
i2i_negative_prompt = gr.Textbox(placeholder="Exclusi贸n", show_label=False, lines=3, value="")
|
| 248 |
with gr.Column():
|
| 249 |
+
i2i_text_button = gr.Button("Generar", variant='primary', elem_id="generate")
|
| 250 |
|
| 251 |
with gr.Row():
|
| 252 |
with gr.Column(scale=3):
|
|
|
|
| 255 |
|
| 256 |
with gr.Row():
|
| 257 |
with gr.Column(scale=1):
|
| 258 |
+
i2i_sampler = gr.Dropdown(value="Euler a", show_label=True, label="Sampleo", choices=prodia_client.list_samplers())
|
| 259 |
|
| 260 |
with gr.Column(scale=1):
|
| 261 |
+
i2i_steps = gr.Slider(label="Pasos", minimum=1, maximum=30, value=25, step=1)
|
| 262 |
|
| 263 |
with gr.Row():
|
| 264 |
with gr.Column(scale=1):
|
| 265 |
+
i2i_width = gr.Slider(label="Ancho", maximum=1024, value=512, step=8)
|
| 266 |
+
i2i_height = gr.Slider(label="Alto", maximum=1024, value=512, step=8)
|
| 267 |
|
| 268 |
with gr.Column(scale=1):
|
| 269 |
+
i2i_batch_size = gr.Slider(label="Tama帽o", maximum=1, value=1)
|
| 270 |
+
i2i_batch_count = gr.Slider(label="Cuenta", maximum=1, value=1)
|
| 271 |
|
| 272 |
+
i2i_cfg_scale = gr.Slider(label="Escala", minimum=1, maximum=20, value=7, step=1)
|
| 273 |
+
i2i_denoising = gr.Slider(label="Fuerza", minimum=0, maximum=1, value=0.7, step=0.1)
|
| 274 |
+
i2i_seed = gr.Number(label="Semillas", value=-1)
|
| 275 |
|
| 276 |
with gr.Column(scale=2):
|
| 277 |
i2i_image_output = gr.Image(value="https://huggingface.co/spaces/salomonsky/fast/raw/main/image.jpg")
|
|
|
|
| 300 |
""".strip()+"\n"
|
| 301 |
|
| 302 |
if len(info) == 0:
|
| 303 |
+
message = "Nada."
|
| 304 |
info = f"<div><p>{message}<p></div>"
|
| 305 |
|
| 306 |
return info
|
|
|
|
| 310 |
image_input = gr.Image(type="pil")
|
| 311 |
|
| 312 |
with gr.Column():
|
| 313 |
+
exif_output = gr.HTML(label="Datos")
|
| 314 |
+
send_to_txt2img_btn = gr.Button("Enviar")
|
| 315 |
|
| 316 |
image_input.upload(get_exif_data, inputs=[image_input], outputs=exif_output)
|
| 317 |
send_to_txt2img_btn.click(send_to_txt2img, inputs=[image_input], outputs=[tabs, prompt, negative_prompt,
|