TaiTair / comfyui-simswap

Simswap node for ComfyUI
GNU General Public License v3.0
15 stars 4 forks source link

[ERROR] ModuleNotFoundError: No module named 'scripts.simswap' #1

Open syddharth opened 6 months ago

syddharth commented 6 months ago

One gets the following error on running the swimswap node.

[Simswap] 15:20:19 - STATUS - Working: source face index [0], target face index [0]
[Simswap] 15:20:19 - STATUS - Analyzing Source Image...
[Simswap] 15:20:20 - STATUS - Analyzing Target Image...
[Simswap] 15:20:21 - STATUS - Swapping...
!!! Exception during processing!!! No module named 'scripts.simswap'
Traceback (most recent call last):
  File "D:\AI\SD\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "D:\AI\SD\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 "D:\AI\SD\ComfyUI\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "D:\AI\SD\ComfyUI\custom_nodes\comfyui-simswap\nodes.py", line 309, in execute
    script.process(
  File "D:\AI\SD\ComfyUI\custom_nodes\comfyui-simswap\scripts\simswap_faceswap.py", line 95, in process
    result = swap_face(
  File "D:\AI\SD\ComfyUI\custom_nodes\comfyui-simswap\scripts\simswap_swapper.py", line 326, in swap_face
    from .simswap.options.test_options import TestOptions
ModuleNotFoundError: No module named 'scripts.simswap'

#208 [Simswap]: 2.98s
Prompt executed in 5.06 seconds
TaiTair commented 6 months ago

Hmmm it looks like this might be a windows filesystem issue. I will investigate!

syddharth commented 6 months ago

Tried to move all the from .simswap.* import * to the top of each file and was able to get it to work. But I think it was a very hacky solution.

TaiTair commented 6 months ago

Tried to move all the from .simswap.* import * to the top of each file and was able to get it to work. But I think it was a very hacky solution.

Oh glad you got it to work! I think it might be only line 326 in scripts/simswap_swapper.py that needs to be moved up. I'll try to do some testing on my end and push a new commit if it works.

syddharth commented 6 months ago

After moving the 326 on scripts/simswap_swapper.py, I got two more similar/realted errors: line 12 on simswap/models/models.py, line 58 on simswap/models/fs_models.py moving all those imports to the top solved the problem. Though I had to comment out the opt.crop_size if else section on simswap/models/fs_models.py image I wonder if this will have any problems running the non-512 models.

TaiTair commented 6 months ago

After moving the 326 on scripts/simswap_swapper.py, I got two more similar/realted errors: line 12 on simswap/models/models.py, line 58 on simswap/models/fs_models.py moving all those imports to the top solved the problem. Though I had to comment out the opt.crop_size if else section on simswap/models/fs_models.py image I wonder if this will have any problems running the non-512 models.

Thanks for the update. I'd love to get that fixed so at least it works out of the box for windows users. You shouldn't have to comment out those relative imports in there that depend on crop_size. Though the crop size is under options/test_options.py I think and it's set to 512 by default. So keep that in mind. I haven't played with that much yet and I don't think it would be too hard to add it as a parameter for the actual node.
I'm going to try something else here and I'll get back to you.

TaiTair commented 6 months ago

Can I see the error you get when you don't comment out that if/elif statement?