meap158 / ComfyUI-Background-Replacement

Instantly replace your image's background
MIT License
52 stars 8 forks source link

Fail to install #3

Open vivi-gomez opened 8 months ago

vivi-gomez commented 8 months ago

Loading: ComfyUI-Manager (V2.7.2)

ComfyUI Revision: 2005 [0d0fbabd] | Released on '2024-02-20'

(IMPORT FAILED) ComfyUI-Background-Replacement

from basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernels

File " /venv/lib/python3.10/site-packages/basicsr/data/degradations.py", line 8, in from torchvision.transforms.functional_tensor import rgb_to_grayscale ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'

vivi-gomez commented 8 months ago

I found a similar issue and solution; https://github.com/Gourieff/comfyui-reactor-node/issues/161

try: from torchvision.transforms.functional_tensor import rgb_to_grayscale except: from torchvision.transforms.functional import rgb_to_grayscale

from torchvision.transforms.functional_tensor import rgb_to_grayscale

--------------------------------------------------------------------

--------------------------- blur kernels ---------------------------

--------------------------------------------------------------------

Editing /venv/lib/python3.10/site-packages/basicsr/data/degradations.py did work for me. I do not know if it would affect any other node or misbehave in the Background-Replacement Node