TaiTair / comfyui-simswap

Simswap node for ComfyUI
GNU General Public License v3.0
9 stars 1 forks source link

error : cannot unpack non-iterable NoneType object #7

Open YUMEORIGINS opened 1 month ago

YUMEORIGINS commented 1 month ago

hi i surely missing something i have this error : cannot unpack non-iterable NoneType object

VeryAngrySquirrel commented 1 month ago

I'm seing the same error. Appears to be related to image size, but can't quite figure out how/where? Trace below:

Error occurred when executing Simswap:

cannot unpack non-iterable NoneType object

File "/home/[]/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/home/[]/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 "/home/[**]/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) File "/home/[]/ComfyUI/custom_nodes/comfyui-simswap/nodes.py", line 309, in execute script.process( File "/home/[]/ComfyUI/custom_nodes/comfyui-simswap/scripts/simswap_faceswap.py", line 95, in process result = swap_face( File "/home/[****]/ComfyUI/custom_nodes/comfyui-simswap/scripts/simswap_swapper.py", line 353, in swap_face img_a_aligncrop, = app.get(img_a_whole,crop_size)

TaiTair commented 1 month ago

Sorry for the wait I've been busy.

Would it be possible to send me a screenshot of the workflow so I can help you debug this? It looks like you might have an issue with image lists/image batches.

VeryAngrySquirrel commented 1 month ago

workflow (20)

VeryAngrySquirrel commented 1 month ago

I've tried adding image batch to list and image list to batch nodes between both source and input connections. I've also tried resizing the source image to .5 megapixels just in case the error was in the crop function.

TaiTair commented 1 month ago

Hi,

It looks like you are using the wrong model for the simswap node. It needs to be one of the onnx files found here: https://huggingface.co/netrunner-exe/Insight-Swap-models-onnx/tree/main

Cheers.

VeryAngrySquirrel commented 1 month ago

Using any of those models (I stepped through all of them) produces the same error. Judging by the time it takes to error out, the problem may be occurring on output, or at least after loading the model.

On Thu, Jun 6, 2024 at 6:41 PM TTR @.***> wrote:

Hi,

It looks like you are using the wrong model for the simswap node. It needs to be one of the onnx files found here: https://huggingface.co/netrunner-exe/Insight-Swap-models-onnx/tree/main

Cheers.

— Reply to this email directly, view it on GitHub https://github.com/TaiTair/comfyui-simswap/issues/7#issuecomment-2153515366, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCACZVX7T2RVELT4DS54RE3ZGDQTNAVCNFSM6AAAAABH54MADWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJTGUYTKMZWGY . You are receiving this because you commented.Message ID: @.***>

--

Drew @.***

TaiTair commented 1 month ago

Hi again,

I was able to reproduce your error consistently by using the cropFace node. I'd have to look into that node a little bit to figure out why it's producing an output that is incompatible with the simswap node.

In the meantime I would suggest to use an upscaleimage node with crop set to center and a size that is slightly smaller than your source image. Since your face is centered that should work.

Alternatively I would suggest just removing cropface altogether since the simswap node already does that work. You can also use the masking helper node to benefit from bbox and sam.

Refer to this for the masking helper: https://raw.githubusercontent.com/Gourieff/Assets/main/comfyui-reactor-node/0.5.0-whatsnew-01.jpg

Please note that if you use the masking helper you will need to pipe the output into an "Images to RGB" node before it is usable with other nodes since the masking helper adds an alpha channel.