Skip to content

Commit

Permalink
fix: fix no attribute del error
Browse files Browse the repository at this point in the history
  • Loading branch information
rubi-du committed Nov 18, 2024
1 parent 0a82a7b commit 272f5cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions js/BiRefNet_Lite.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 272f5cd

Please sign in to comment.