Skip to content

Commit c4121ac

Browse files
committed
[chore] Reuse get_resolutions
1 parent 37351e6 commit c4121ac

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

gradio/gradio_infer_demo.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
get_logger,
1010
get_lora_checkpoint_dirs,
1111
get_lora_checkpoint_rootdir,
12+
get_resolutions,
1213
)
1314

1415
import gradio as gr
@@ -75,22 +76,11 @@ def update_task(hf_model_id: str) -> Tuple[gr.Dropdown, gr.Component]:
7576

7677
# Configure resolution dropdown based on task
7778
if task == GenerationMode.TextToImage:
78-
resolution_list = [
79-
"512x512",
80-
"512x768",
81-
"512x1024",
82-
"720x1280",
83-
"768x768",
84-
"1024x1024",
85-
"1080x1920",
86-
]
79+
resolution_list = get_resolutions(task)
8780
default_resolution = resolution_list[0]
8881
resolution_info = "Height x Width"
8982
elif task == GenerationMode.TextToVideo:
90-
resolution_list = [
91-
"49x480x720",
92-
"81x768x1360",
93-
]
83+
resolution_list = get_resolutions(task)
9484
default_resolution = resolution_list[0]
9585
resolution_info = "Frames x Height x Width"
9686
else:

0 commit comments

Comments
 (0)