Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion py/AILab_BiRefNet.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
from safetensors.torch import load_file
import cv2

device = "cuda" if torch.cuda.is_available() else "cpu"
if torch.cuda.is_available():
device = "cuda"
elif torch.backends.mps.is_available():
device = "mps"
else:
device = "cpu"

# Add model path
folder_paths.add_model_folder_path("rmbg", os.path.join(folder_paths.models_dir, "RMBG"))
Expand Down
7 changes: 6 additions & 1 deletion py/AILab_RMBG.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@
import cv2
import types

device = "cuda" if torch.cuda.is_available() else "cpu"
if torch.cuda.is_available():
device = "cuda"
elif torch.backends.mps.is_available():
device = "mps"
else:
device = "cpu"

folder_paths.add_model_folder_path("rmbg", os.path.join(folder_paths.models_dir, "RMBG"))

Expand Down
18 changes: 18 additions & 0 deletions requirements_mac.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Base dependencies
huggingface-hub>=0.19.0
transparent-background>=1.1.2
segment-anything>=1.0
groundingdino-py>=0.4.0
opencv-python>=4.7.0
onnxruntime>=1.15.0
protobuf>=3.20.2,<6.0.0

#SAM2
hydra-core>=1.3.0
omegaconf>=2.3.0
iopath>=0.1.9

#SAM3
ftfy
typing_extensions