diff --git a/js/BiRefNet_Lite.js b/js/BiRefNet_Lite.js index f7d201d..8a6b47f 100644 --- a/js/BiRefNet_Lite.js +++ b/js/BiRefNet_Lite.js @@ -81,8 +81,8 @@ app.registerExtension({ return; } - if(node.widgets_values[3] != undefined){ - localModelPathWidget.value = node.widgets_values[3]; + if(node.widgets_values[8] != undefined){ + localModelPathWidget.value = node.widgets_values[8]; } // 初始状态控制:根据 load_local_model 的值决定是否显示 local_model_path diff --git a/nodes.py b/nodes.py index fe42e7a..0f28ae4 100644 --- a/nodes.py +++ b/nodes.py @@ -232,8 +232,11 @@ def background_remove(self, spare_params['max_memory'] = {0: f"{max_gpu_size}GiB", "cpu": f"{cpu_size}GiB"} setattr(model_class, '_no_split_modules', ["Decoder", "SwinTransformer"]) else: - if hasattr(model_class, "_no_split_modules"): - delattr(model_class, "_no_split_modules") + try: + if hasattr(model_class, "_no_split_modules"): + delattr(model_class, "_no_split_modules") + except Exception as e: + print('No need to delete:', e) birefnet = AutoModelForImageSegmentation.from_pretrained(local_model_path,trust_remote_code=True, **spare_params) else: