1
0
Fork 0

turn controlnet into a select list and localize its label, fix name lookup on server

This commit is contained in:
Sean Sube 2023-04-12 20:03:00 -05:00
parent 948bec6d0f
commit 555ec5a644
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
8 changed files with 12 additions and 4 deletions

View File

@ -122,6 +122,7 @@ def load_pipeline(
):
inversions = inversions or []
loras = loras or []
control_key = control.name if control is not None else None
torch_dtype = (
torch.float16 if "torch-fp16" in server.optimizations else torch.float32
@ -133,6 +134,7 @@ def load_pipeline(
device.device,
device.provider,
lpw,
control_key,
inversions,
loras,
)
@ -282,7 +284,7 @@ def load_pipeline(
if control is not None:
components["controlnet"] = OnnxRuntimeModel(
OnnxRuntimeModel.load_model(
path.join(server.model_path, "control", f"{control}.onnx"),
path.join(server.model_path, "control", f"{control.name}.onnx"),
provider=device.ort_provider(),
sess_options=device.sess_options(),
)

View File

@ -210,7 +210,7 @@ class ImageParams:
"lpw": self.lpw,
"eta": self.eta,
"batch": self.batch,
"control": self.control,
"control": self.control.name,
}
def with_args(self, **kwargs):

View File

@ -116,7 +116,7 @@ export function ModelControl() {
});
}}
/>
<QueryMenu
<QueryList
id='control'
labelKey='model'
name={t('modelType.control')}
@ -124,7 +124,8 @@ export function ModelControl() {
result: models,
selector: (result) => result.networks.filter((network) => network.type === 'control').map((network) => network.name),
}}
onSelect={(control) => {
value={params.control}
onChange={(control) => {
setModel({
control,
});

View File

@ -70,6 +70,7 @@ export const I18N_STRINGS_DE = {
'none': 'Keiner',
},
modelType: {
control: '',
correction: 'Korrekturmodelle',
diffusion: 'Diffusionsmodelle',
inversion: '',

View File

@ -111,6 +111,7 @@ export const I18N_STRINGS_EN = {
'diffusion-unstable-ink-dream-v6': 'Unstable Ink Dream v6',
},
modelType: {
control: 'ControlNet',
correction: 'Correction Model',
diffusion: 'Diffusion Model',
inversion: 'Textual Inversion',

View File

@ -70,6 +70,7 @@ export const I18N_STRINGS_ES = {
'none': 'Ninguno',
},
modelType: {
control: '',
correction: 'Modelo de corrección',
diffusion: 'Modelo de difusión',
inversion: '',

View File

@ -70,6 +70,7 @@ export const I18N_STRINGS_FR = {
'none': '',
},
modelType: {
control: '',
correction: 'modèle de correction',
diffusion: 'modèle de diffusion',
inversion: '',

View File

@ -19,6 +19,7 @@
"ckpt",
"codebook",
"codeformer",
"controlnet",
"CUDA",
"ddim",
"ddpm",