filter-out model file from 0 weighted LoraLoader

This commit is contained in:
Dr.Lt.Data 2023-06-17 20:49:44 +09:00
parent 436d9e2633
commit 21418d7f5c

View File

@ -8,6 +8,15 @@ function getFileExtension(filename) {
export class Util { export class Util {
static workflow_security_filter(workflow) { static workflow_security_filter(workflow) {
workflow.nodes.forEach((node) => { workflow.nodes.forEach((node) => {
// filter for 0 weighted LoraLoader
if(node.widgets_values && node.widgets_values.length == 3){
let wv = node.widgets_values;
if(typeof(wv[0]) == "string" && wv[1] == 0 && wv[2] == 0){
if(excludeExtensions.has(getFileExtension(wv[0])))
wv[0] = "";
}
}
if (node.inputs) { if (node.inputs) {
node.inputs.forEach((input) => { node.inputs.forEach((input) => {
if (input.widget && input.widget.config) { if (input.widget && input.widget.config) {