update
This commit is contained in:
parent
468e698a5c
commit
4561d5c31b
@ -21,10 +21,8 @@ from loguru import logger
|
|||||||
|
|
||||||
from iopaint.const import *
|
from iopaint.const import *
|
||||||
|
|
||||||
|
|
||||||
_config_file: Path = None
|
_config_file: Path = None
|
||||||
|
|
||||||
|
|
||||||
default_configs = dict(
|
default_configs = dict(
|
||||||
host="127.0.0.1",
|
host="127.0.0.1",
|
||||||
port=8080,
|
port=8080,
|
||||||
@ -67,7 +65,7 @@ def load_config(p: Path) -> WebConfig:
|
|||||||
try:
|
try:
|
||||||
return WebConfig(**{**default_configs, **json.load(f)})
|
return WebConfig(**{**default_configs, **json.load(f)})
|
||||||
except JSONDecodeError:
|
except JSONDecodeError:
|
||||||
print(f"Load config file failed, using default configs")
|
print("Load config file failed, using default configs")
|
||||||
return WebConfig(**default_configs)
|
return WebConfig(**default_configs)
|
||||||
else:
|
else:
|
||||||
return WebConfig(**default_configs)
|
return WebConfig(**default_configs)
|
||||||
@ -150,13 +148,6 @@ def main(config_file: Path):
|
|||||||
port = gr.Number(init_config.port, label="Port", precision=0)
|
port = gr.Number(init_config.port, label="Port", precision=0)
|
||||||
inbrowser = gr.Checkbox(init_config.inbrowser, label=INBROWSER_HELP)
|
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():
|
with gr.Row():
|
||||||
recommend_model = gr.Dropdown(
|
recommend_model = gr.Dropdown(
|
||||||
["lama", "mat", "migan"] + DIFFUSION_MODELS,
|
["lama", "mat", "migan"] + DIFFUSION_MODELS,
|
||||||
@ -165,6 +156,12 @@ def main(config_file: Path):
|
|||||||
downloaded_model = gr.Dropdown(
|
downloaded_model = gr.Dropdown(
|
||||||
downloaded_models, label="Downloaded Models"
|
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 = gr.Radio(
|
||||||
Device.values(), label="Device", value=init_config.device
|
Device.values(), label="Device", value=init_config.device
|
||||||
|
Loading…
Reference in New Issue
Block a user