Commit Graph
17 Commits
Author SHA1 Message Date
Carsten Li bc26fdd5de Update BiRefNet_node.py
Modifications to make it work on Apple Silicon devices:

1. Modified the load() method to handle loading the model weights based on the selected device (CPU, MPS, or CUDA). The map_location parameter is set accordingly to ensure the weights are loaded onto the correct device.

2. Updated the INPUT_TYPES() method to correctly define the available device options based on the availability of MPS and CUDA devices.

3. In the matting() method, added a step to move the model to the selected device (self.model.to(device)) before performing the forward pass. This ensures that both the input tensor and the model weights are on the same device, avoiding device mismatch errors.

These changes address the issues related to loading the pre-trained model weights on different devices (CPU, MPS, or CUDA) and ensure that the BiRefNet node works correctly on various hardware configurations, including MacBook Pro M2 with MPS.

The modifications improve the compatibility and robustness of the code, allowing users to run the BiRefNet node seamlessly on their specific hardware setup without encountering errors related to device mismatches or unsupported CUDA operations.
2024-03-25 11:45:06 +01:00
yang shawn 03bed543ed remove an empty file
probably fix the conflict with SDUltimate node
2024-03-22 16:35:10 +08:00
yang shawn 025063a00e update readme 2024-03-22 14:19:01 +08:00
yang shawn c72dd74232 update workflow 2024-03-22 14:17:49 +08:00
yang shawn 9a9556270a update gitignore 2024-03-22 14:17:42 +08:00
yang shawn 6e08ffec04 add segmentation samples 2024-03-22 10:47:51 +08:00
yang shawn 1aca549818 fix auto device 2024-03-22 10:33:54 +08:00
yang shawn 0c3066f4e9 fix auto device 2024-03-22 10:23:17 +08:00
yang shawn 50e248b929 update requirements.txt 2024-03-21 20:42:23 +08:00
yang shawn 8a1435ad98 add Acknowledgments 2024-03-21 20:38:31 +08:00
yang shawn c85ed5fce9 readme 2024-03-21 20:37:02 +08:00
yang shawn 0bf9cdb916 update checkpoints info 2024-03-21 20:31:31 +08:00
yang shawn ef78e07590 usage update 2024-03-21 20:29:56 +08:00
yang shawn 9a1486a06a add usage 2024-03-21 20:29:07 +08:00
yang shawn a12cacf752 init this repo 2024-03-21 19:24:54 +08:00
yang shawn 6a7eca8087 update gitignore 2024-03-21 19:24:40 +08:00
Xu Yang eb007a7b66 Initial commit 2024-03-21 19:09:28 +08:00