Support drag-and-drop and use-these-settings for controlnet

This commit is contained in:
cmdr2 2023-08-18 17:53:16 +05:30
parent 767d8fc35d
commit 1d54943d71

View File

@ -289,6 +289,22 @@ const TASK_MAPPING = {
readUI: () => vaeModelField.value, readUI: () => vaeModelField.value,
parse: (val) => val, parse: (val) => val,
}, },
use_controlnet_model: {
name: "ControlNet model",
setUI: (use_controlnet_model) => {
controlnetModelField.value = getModelPath(use_controlnet_model, [".pth", ".safetensors"])
},
readUI: () => controlnetModelField.value,
parse: (val) => val,
},
control_filter_to_apply: {
name: "ControlNet Filter",
setUI: (control_filter_to_apply) => {
controlImageFilterField.value = control_filter_to_apply
},
readUI: () => controlImageFilterField.value,
parse: (val) => val,
},
use_lora_model: { use_lora_model: {
name: "LoRA model", name: "LoRA model",
setUI: (use_lora_model) => { setUI: (use_lora_model) => {
@ -552,6 +568,8 @@ const TASK_TEXT_MAPPING = {
hypernetwork_strength: "Hypernetwork Strength", hypernetwork_strength: "Hypernetwork Strength",
use_lora_model: "LoRA model", use_lora_model: "LoRA model",
lora_alpha: "LoRA Strength", lora_alpha: "LoRA Strength",
use_controlnet_model: "ControlNet model",
control_filter_to_apply: "ControlNet Filter",
} }
function parseTaskFromText(str) { function parseTaskFromText(str) {
const taskReqBody = {} const taskReqBody = {}