TaiTair / comfyui-simswap

Simswap node for ComfyUI
GNU General Public License v3.0
13 stars 2 forks source link

What am I missing #11

Open ggenovez opened 1 month ago

ggenovez commented 1 month ago

Hi all,

I'm having a hard time getting simswap working. getting the following

[Simswap] 20:36:55 - STATUS - Working: source face index [0], target face index [0] [Simswap] 20:36:55 - STATUS - Using Hashed Source Face(s) Model... [Simswap] 20:36:55 - STATUS - Using Hashed Target Face(s) Model... [Simswap] 20:36:55 - STATUS - Swapping... !!! Exception during processing!!! module 'torch._C' has no attribute '_cuda_setDevice' Traceback (most recent call last): File "/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ComfyUI/execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/CofyUI/custom_nodes/comfyui-simswap/nodes.py", line 309, in execute script.process( File "/ComfyUI/custom_nodes/comfyui-simswap/scripts/simswap_faceswap.py", line 95, in process result = swap_face( ^^^^^^^^^^ File "/ComfyUI/custom_nodes/comfyui-simswap/scripts/simswap_swapper.py", line 327, in swap_face opt = TestOptions().parse() ^^^^^^^^^^^^^^^^^^^^^ File "/ComfyUI/custom_nodes/comfyui-simswap/scripts/simswap/options/base_options.py", line 92, in parse torch.cuda.set_device(self.opt.gpu_ids[0]) File "/anaconda3/lib/python3.11/site-packages/torch/cuda/init.py", line 404, in set_device AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'

ggenovez commented 1 month ago

FYI, this is on a mac M1

TaiTair commented 1 month ago

Does any of comfy work at all? It looks like there's an issue with your pytorch installation and it's trying to use CUDA. Does your mac have an nvidia graphics card?

ggenovez commented 1 month ago

Yes. Comfy does work. The M1 has a monolithic die that has it all built onto the soc. So no NVDIA chip. just apple

TaiTair commented 1 month ago

Ok so from what I am reading pytorch is only going to work for you in cpu mode. The base options are set to use a gpu by default which you don't have.

You're going to have to go into this file https://github.com/TaiTair/comfyui-simswap/blob/main/scripts/simswap/options/base_options.py
And replace line 21 here: self.parser.add_argument('--gpu_ids', type=str, default='0', help='gpu ids: e.g. 0 0,1,2, 0,2. use -1 for CPU')
With this: self.parser.add_argument('--gpu_ids', type=str, default='-1', help='gpu ids: e.g. 0 0,1,2, 0,2. use -1 for CPU')

Then it should work for you.