This commit is contained in:
Qing 2024-03-05 22:33:38 +08:00
parent 468e698a5c
commit 4561d5c31b

View File

@ -21,10 +21,8 @@ from loguru import logger
from iopaint.const import *
_config_file: Path = None
default_configs = dict(
host="127.0.0.1",
port=8080,
@ -67,7 +65,7 @@ def load_config(p: Path) -> WebConfig:
try:
return WebConfig(**{**default_configs, **json.load(f)})
except JSONDecodeError:
print(f"Load config file failed, using default configs")
print("Load config file failed, using default configs")
return WebConfig(**default_configs)
else:
return WebConfig(**default_configs)
@ -150,13 +148,6 @@ def main(config_file: Path):
port = gr.Number(init_config.port, label="Port", precision=0)
inbrowser = gr.Checkbox(init_config.inbrowser, label=INBROWSER_HELP)
with gr.Column():
model = gr.Textbox(
init_config.model,
label="Current Model. This is the model that will be used when the service starts. "
"If the model has not been downloaded before, it will be automatically downloaded. "
"You can select a model from the dropdown box below or manually enter the SD/SDXL model ID from HuggingFace, for example, runwayml/stable-diffusion-inpainting.",
)
with gr.Row():
recommend_model = gr.Dropdown(
["lama", "mat", "migan"] + DIFFUSION_MODELS,
@ -165,6 +156,12 @@ def main(config_file: Path):
downloaded_model = gr.Dropdown(
downloaded_models, label="Downloaded Models"
)
with gr.Column():
model = gr.Textbox(
init_config.model,
label="Current Model. Model will be automatically downloaded. "
"You can select a model in Recommended Models or Downloaded Models or manually enter the SD/SDXL model ID from HuggingFace, for example, runwayml/stable-diffusion-inpainting.",
)
device = gr.Radio(
Device.values(), label="Device", value=init_config.device