Spaces:
Running
on
Zero
Running
on
Zero
adamelliotfields
commited on
Commit
•
1a31768
1
Parent(s):
71080f0
Fix aspect ratio dropdown
Browse files- app.py +4 -4
- lib/utils.py +0 -1
app.py
CHANGED
@@ -91,7 +91,7 @@ async def generate_fn(*args):
|
|
91 |
progress=gr.Progress(),
|
92 |
)
|
93 |
except RuntimeError:
|
94 |
-
raise gr.Error("
|
95 |
return images
|
96 |
|
97 |
|
@@ -249,6 +249,9 @@ with gr.Blocks(
|
|
249 |
step=32,
|
250 |
)
|
251 |
aspect_ratio = gr.Dropdown(
|
|
|
|
|
|
|
252 |
choices=[
|
253 |
("Custom", None),
|
254 |
("4:7 (384x672)", "384,672"),
|
@@ -257,9 +260,6 @@ with gr.Blocks(
|
|
257 |
("9:7 (576x448)", "576,448"),
|
258 |
("7:4 (672x384)", "672,384"),
|
259 |
],
|
260 |
-
value="448,576",
|
261 |
-
filterable=False,
|
262 |
-
label="Aspect Ratio",
|
263 |
)
|
264 |
|
265 |
with gr.Row():
|
|
|
91 |
progress=gr.Progress(),
|
92 |
)
|
93 |
except RuntimeError:
|
94 |
+
raise gr.Error("Error: Please try again")
|
95 |
return images
|
96 |
|
97 |
|
|
|
249 |
step=32,
|
250 |
)
|
251 |
aspect_ratio = gr.Dropdown(
|
252 |
+
value=f"{Config.WIDTH},{Config.HEIGHT}",
|
253 |
+
label="Aspect Ratio",
|
254 |
+
filterable=False,
|
255 |
choices=[
|
256 |
("Custom", None),
|
257 |
("4:7 (384x672)", "384,672"),
|
|
|
260 |
("9:7 (576x448)", "576,448"),
|
261 |
("7:4 (672x384)", "672,384"),
|
262 |
],
|
|
|
|
|
|
|
263 |
)
|
264 |
|
265 |
with gr.Row():
|
lib/utils.py
CHANGED
@@ -62,7 +62,6 @@ def download_civit_file(lora_id, version_id, file_path=".", token=None):
|
|
62 |
with open(file, "wb") as f:
|
63 |
f.write(response.content)
|
64 |
except httpx.HTTPStatusError as e:
|
65 |
-
print(e.request.url)
|
66 |
print(f"HTTPError: {e.response.status_code} {e.response.text}")
|
67 |
except httpx.RequestError as e:
|
68 |
print(f"RequestError: {e}")
|
|
|
62 |
with open(file, "wb") as f:
|
63 |
f.write(response.content)
|
64 |
except httpx.HTTPStatusError as e:
|
|
|
65 |
print(f"HTTPError: {e.response.status_code} {e.response.text}")
|
66 |
except httpx.RequestError as e:
|
67 |
print(f"RequestError: {e}")
|