Download comfyui_layerstyle/py/evf_sam/model/segment_anything_2/setup.py from MarkLilly/mis-custom-nodes: direct link, hf CLI and curl.
- Browser
- Download file 883 Bytes
-
https://huggingface.co/MarkLilly/mis-custom-nodes/resolve/main/comfyui_layerstyle/py/evf_sam/model/segment_anything_2/setup.py
- Command line
-
hf download hf://MarkLilly/mis-custom-nodes/comfyui_layerstyle/py/evf_sam/model/segment_anything_2/setup.py
-
curl -L -o setup.py https://huggingface.co/MarkLilly/mis-custom-nodes/resolve/main/comfyui_layerstyle/py/evf_sam/model/segment_anything_2/setup.py
883 Bytes
| # Copyright (c) Meta Platforms, Inc. and affiliates. | |
| # All rights reserved. | |
| # This source code is licensed under the license found in the | |
| # LICENSE file in the root directory of this source tree. | |
| from setuptools import find_packages, setup | |
| from torch.utils.cpp_extension import BuildExtension, CUDAExtension | |
| def get_extensions(): | |
| srcs = ["sam2/csrc/connected_components.cu"] | |
| compile_args = { | |
| "cxx": [], | |
| "nvcc": [ | |
| "-DCUDA_HAS_FP16=1", | |
| "-D__CUDA_NO_HALF_OPERATORS__", | |
| "-D__CUDA_NO_HALF_CONVERSIONS__", | |
| "-D__CUDA_NO_HALF2_OPERATORS__", | |
| ], | |
| } | |
| ext_modules = [CUDAExtension("sam2._C", srcs, extra_compile_args=compile_args)] | |
| return ext_modules | |
| # Setup configuration | |
| setup( | |
| ext_modules=get_extensions(), | |
| cmdclass={"build_ext": BuildExtension.with_options(no_python_abi_suffix=True)}, | |
| ) | |