load controlnets from network models list
This commit is contained in:
parent
9e017ee35d
commit
948bec6d0f
|
@ -280,11 +280,13 @@ def load_pipeline(
|
||||||
)
|
)
|
||||||
|
|
||||||
if control is not None:
|
if control is not None:
|
||||||
components["controlnet"] = OnnxRuntimeModel(OnnxRuntimeModel.load_model(
|
components["controlnet"] = OnnxRuntimeModel(
|
||||||
control,
|
OnnxRuntimeModel.load_model(
|
||||||
provider=device.ort_provider(),
|
path.join(server.model_path, "control", f"{control}.onnx"),
|
||||||
sess_options=device.sess_options(),
|
provider=device.ort_provider(),
|
||||||
))
|
sess_options=device.sess_options(),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
pipe = pipeline.from_pretrained(
|
pipe = pipeline.from_pretrained(
|
||||||
model,
|
model,
|
||||||
|
|
|
@ -20,6 +20,7 @@ from .load import (
|
||||||
get_config_value,
|
get_config_value,
|
||||||
get_correction_models,
|
get_correction_models,
|
||||||
get_highres_methods,
|
get_highres_methods,
|
||||||
|
get_network_models,
|
||||||
get_upscaling_models,
|
get_upscaling_models,
|
||||||
)
|
)
|
||||||
from .utils import get_model_path
|
from .utils import get_model_path
|
||||||
|
@ -42,13 +43,13 @@ def pipeline_from_request(
|
||||||
device = platform
|
device = platform
|
||||||
|
|
||||||
# pipeline stuff
|
# pipeline stuff
|
||||||
control = get_not_empty(request.args, "control", get_config_value("control"))
|
|
||||||
lpw = get_not_empty(request.args, "lpw", "false") == "true"
|
lpw = get_not_empty(request.args, "lpw", "false") == "true"
|
||||||
model = get_not_empty(request.args, "model", get_config_value("model"))
|
model = get_not_empty(request.args, "model", get_config_value("model"))
|
||||||
model_path = get_model_path(server, model)
|
model_path = get_model_path(server, model)
|
||||||
scheduler = get_from_list(
|
scheduler = get_from_list(
|
||||||
request.args, "scheduler", list(pipeline_schedulers.keys())
|
request.args, "scheduler", list(pipeline_schedulers.keys())
|
||||||
)
|
)
|
||||||
|
control = get_from_list(request.args, "control", get_network_models())
|
||||||
|
|
||||||
if scheduler is None:
|
if scheduler is None:
|
||||||
scheduler = get_config_value("scheduler")
|
scheduler = get_config_value("scheduler")
|
||||||
|
|
Loading…
Reference in New Issue