Spaces:
Running
Running
salomonsky
commited on
Commit
•
3b09086
1
Parent(s):
ffd64d8
Update app.py
Browse files
app.py
CHANGED
@@ -47,9 +47,9 @@ async def gen(prompt, basemodel, width, height, scales, steps, seed, upscale_fac
|
|
47 |
if image is None:
|
48 |
return [None, None]
|
49 |
|
50 |
-
image_path = "temp_image.
|
51 |
try:
|
52 |
-
image.save(image_path, format="
|
53 |
except Exception as e:
|
54 |
print(f"Error al guardar la imagen: {e}")
|
55 |
return [None, None]
|
@@ -58,9 +58,9 @@ async def gen(prompt, basemodel, width, height, scales, steps, seed, upscale_fac
|
|
58 |
upscale_image = get_upscale_finegrain(prompt, image_path, upscale_factor)
|
59 |
if upscale_image is None:
|
60 |
return [image_path, image_path]
|
61 |
-
upscale_image_path = "upscale_image.
|
62 |
try:
|
63 |
-
upscale_image.save(upscale_image_path, format="
|
64 |
except Exception as e:
|
65 |
print(f"Error al guardar la imagen escalada: {e}")
|
66 |
return [image_path, None]
|
@@ -83,7 +83,7 @@ with gr.Blocks(css=css, theme="Nymbo/Nymbo_Theme") as demo:
|
|
83 |
process_upscale = gr.Checkbox(label="Procesar Escalador")
|
84 |
upscale_factor = gr.Radio(label="Factor de Escala", choices=[2, 4, 8], value=2)
|
85 |
|
86 |
-
|
87 |
width = gr.Slider(label="Ancho", minimum=512, maximum=1280, step=8, value=1280)
|
88 |
height = gr.Slider(label="Alto", minimum=512, maximum=1280, step=8, value=768)
|
89 |
scales = gr.Slider(label="Escalas", minimum=3.5, maximum=7, step=0.1, value=3.5)
|
|
|
47 |
if image is None:
|
48 |
return [None, None]
|
49 |
|
50 |
+
image_path = "temp_image.png"
|
51 |
try:
|
52 |
+
image.save(image_path, format="PNG")
|
53 |
except Exception as e:
|
54 |
print(f"Error al guardar la imagen: {e}")
|
55 |
return [None, None]
|
|
|
58 |
upscale_image = get_upscale_finegrain(prompt, image_path, upscale_factor)
|
59 |
if upscale_image is None:
|
60 |
return [image_path, image_path]
|
61 |
+
upscale_image_path = "upscale_image.png"
|
62 |
try:
|
63 |
+
upscale_image.save(upscale_image_path, format="PNG")
|
64 |
except Exception as e:
|
65 |
print(f"Error al guardar la imagen escalada: {e}")
|
66 |
return [image_path, None]
|
|
|
83 |
process_upscale = gr.Checkbox(label="Procesar Escalador")
|
84 |
upscale_factor = gr.Radio(label="Factor de Escala", choices=[2, 4, 8], value=2)
|
85 |
|
86 |
+
with gr.Accordion(label="Opciones Avanzadas", open=False):
|
87 |
width = gr.Slider(label="Ancho", minimum=512, maximum=1280, step=8, value=1280)
|
88 |
height = gr.Slider(label="Alto", minimum=512, maximum=1280, step=8, value=768)
|
89 |
scales = gr.Slider(label="Escalas", minimum=3.5, maximum=7, step=0.1, value=3.5)
|