Skip to content

Commit

Permalink
fix: error AutoDownloadBiRefNetModel node's name
Browse files Browse the repository at this point in the history
  • Loading branch information
刘雪峰 committed Sep 6, 2024
1 parent f47fbcb commit a6617a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 3 additions & 2 deletions birefnet/config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import os
import math

CUR_DIR = os.path.dirname(__file__)
# CUR_DIR = os.path.dirname(__file__)

class Config():

class Config:
def __init__(self, bb_index: int = 6) -> None:
# PATH settings
# Make up your file system as: SYS_HOME_DIR/codes/dis/BiRefNet, SYS_HOME_DIR/datasets/dis/xx, SYS_HOME_DIR/weights/xx
Expand Down
7 changes: 2 additions & 5 deletions birefnetNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
import comfy
from comfy import model_management
import folder_paths
from birefnet.config import Config
from birefnet.models.birefnet import BiRefNet
from birefnet.utils import check_state_dict
from .util import tensor_to_pil, apply_mask_to_image

config = Config()

deviceType = model_management.get_torch_device().type

models_dir_key = "birefnet"
Expand Down Expand Up @@ -193,13 +190,13 @@ def rem_bg(self, model, images):


NODE_CLASS_MAPPINGS = {
"LoadBiRefNetModelByName": AutoDownloadBiRefNetModel,
"AutoDownloadBiRefNetModel": AutoDownloadBiRefNetModel,
"LoadRembgByBiRefNetModel": LoadRembgByBiRefNetModel,
"RembgByBiRefNet": RembgByBiRefNet,
}

NODE_DISPLAY_NAME_MAPPINGS = {
"LoadBiRefNetModelByName": "LoadBiRefNetModelByName",
"AutoDownloadBiRefNetModel": "AutoDownloadBiRefNetModel",
"LoadRembgByBiRefNetModel": "LoadRembgByBiRefNetModel",
"RembgByBiRefNet": "RembgByBiRefNet",
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "comfyui_birefnet_ll"
description = "Sync with version of BiRefNet. NODES:AutoDownloadBiRefNetModel, LoadRembgByBiRefNetModel, RembgByBiRefNet."
version = "1.0.0"
version = "1.0.1"
license = {file = "LICENSE"}
dependencies = ["numpy<2", "opencv-python", "scipy", "timm"]

Expand Down

0 comments on commit a6617a0

Please sign in to comment.