Gourieff / comfyui-reactor-node

Fast and Simple Face Swap Extension Node for ComfyUI
GNU General Public License v3.0
1.4k stars 133 forks source link

'NoneType' object has no attribute 'reshape' #409

Open 1247862674 opened 2 weeks ago

1247862674 commented 2 weeks ago

First, confirm

What happened?

Error occurred when executing ReActorFaceSwap:

'NoneType' object has no attribute 'reshape'

File "/data/app/execution.py", line 317, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "/data/app/execution.py", line 192, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "/data/app/execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "/data/app/execution.py", line 158, in process_inputs results.append(getattr(obj, func)(**inputs)) File "/data/app/custom_nodes/comfyui-reactor-node/nodes.py", line 335, in execute script.process( File "/data/app/custom_nodes/comfyui-reactor-node/scripts/reactor_faceswap.py", line 91, in process result = swap_face( File "/data/app/custom_nodes/comfyui-reactor-node/scripts/reactor_swapper.py", line 305, in swap_face result = face_swapper.get(result, target_face, source_face) File "/data/miniconda3/pkgs/comfyui/lib/python3.10/site-packages/insightface/model_zoo/inswapper.py", line 50, in get latent = source_face.normed_embedding.reshape((1,-1)) image

Steps to reproduce the problem

{ "last_node_id": 50, "last_link_id": 68, "nodes": [ { "id": 4, "type": "LoadImage", "pos": [ 50, 430 ], "size": [ 320, 310 ], "flags": {}, "order": 0, "mode": 0, "outputs": [ { "name": "IMAGE", "type": "IMAGE", "links": [ 4 ], "shape": 3, "slot_index": 0 }, { "name": "MASK", "type": "MASK", "links": null, "shape": 3 } ], "properties": { "Node name for S&R": "LoadImage" }, "widgets_values": [ "ПолинаГагарина01.jpg", "image" ] }, { "id": 6, "type": "LoadImage", "pos": [ 380, 430 ], "size": [ 320, 310 ], "flags": {}, "order": 1, "mode": 0, "outputs": [ { "name": "IMAGE", "type": "IMAGE", "links": [ 5 ], "shape": 3, "slot_index": 0 }, { "name": "MASK", "type": "MASK", "links": null, "shape": 3 } ], "properties": { "Node name for S&R": "LoadImage" }, "widgets_values": [ "ОльгаКуриленко01.jpg", "image" ] }, { "id": 11, "type": "LoadImage", "pos": [ 710, 430 ], "size": [ 320, 310 ], "flags": {}, "order": 2, "mode": 0, "outputs": [ { "name": "IMAGE", "type": "IMAGE", "links": [ 14 ], "shape": 3, "slot_index": 0 }, { "name": "MASK", "type": "MASK", "links": null, "shape": 3 } ], "properties": { "Node name for S&R": "LoadImage" }, "widgets_values": [ "ИринаАнтоненко02.jpg", "image" ] }, { "id": 5, "type": "ImpactMakeImageBatch", "pos": [ 490, 260 ], "size": { "0": 160, "1": 110 }, "flags": {}, "order": 5, "mode": 0, "inputs": [ { "name": "image1", "type": "IMAGE", "link": 3 }, { "name": "image2", "type": "IMAGE", "link": 4 }, { "name": "image3", "type": "IMAGE", "link": 5 }, { "name": "image4", "type": "IMAGE", "link": 14 }, { "name": "image5", "type": "IMAGE", "link": null } ], "outputs": [ { "name": "IMAGE", "type": "IMAGE", "links": [ 6 ], "shape": 3, "slot_index": 0 } ], "properties": { "Node name for S&R": "ImpactMakeImageBatch" } }, { "id": 3, "type": "LoadImage", "pos": [ 50, 80 ], "size": [ 320, 310 ], "flags": {}, "order": 3, "mode": 0, "outputs": [ { "name": "IMAGE", "type": "IMAGE", "links": [ 3, 67 ], "shape": 3, "slot_index": 0 }, { "name": "MASK", "type": "MASK", "links": null, "shape": 3 } ], "properties": { "Node name for S&R": "LoadImage" }, "widgets_values": [ "ПаулинаАндреева01.jpg", "image" ] }, { "id": 50, "type": "PreviewImage", "pos": [ 1520, 80 ], "size": [ 250, 330 ], "flags": {}, "order": 8, "mode": 0, "inputs": [ { "name": "images", "type": "IMAGE", "link": 68 } ], "properties": { "Node name for S&R": "PreviewImage" } }, { "id": 47, "type": "Note", "pos": [ 710, 50 ], "size": [ 360, 160 ], "flags": {}, "order": 4, "mode": 0, "properties": { "text": "" }, "widgets_values": [ "save_mode - save a blended face model or not\nsend_only - if you already build the model and want to use with the main ReActor node but don't want to waste your time for rebuilding it when you run the queue again - set this option to YES \n\nMean (recommended) - Average value (best result 👍)\nMedian - Mid-point value (may be funny 😅)\nMode - Most common value (may be scary 😨)\n\nMean and Median will be similar if you load two images" ], "color": "#432", "bgcolor": "#653" }, { "id": 1, "type": "ReActorBuildFaceModel", "pos": [ 710, 260 ], "size": { "0": 315, "1": 130 }, "flags": {}, "order": 6, "mode": 0, "inputs": [ { "name": "images", "type": "IMAGE", "link": 6, "slot_index": 0 } ], "outputs": [ { "name": "FACE_MODEL", "type": "FACE_MODEL", "links": [ 66 ], "shape": 3, "slot_index": 0 } ], "properties": { "Node name for S&R": "ReActorBuildFaceModel" }, "widgets_values": [ true, true, "test", "Mean" ] }, { "id": 49, "type": "ReActorFaceSwap", "pos": [ 1160, 80 ], "size": { "0": 315, "1": 338 }, "flags": {}, "order": 7, "mode": 0, "inputs": [ { "name": "input_image", "type": "IMAGE", "link": 67, "slot_index": 0 }, { "name": "source_image", "type": "IMAGE", "link": null }, { "name": "face_model", "type": "FACE_MODEL", "link": 66 } ], "outputs": [ { "name": "IMAGE", "type": "IMAGE", "links": [ 68 ], "shape": 3, "slot_index": 0 }, { "name": "FACE_MODEL", "type": "FACE_MODEL", "links": null, "shape": 3 } ], "properties": { "Node name for S&R": "ReActorFaceSwap" }, "widgets_values": [ true, "inswapper_128.onnx", "retinaface_resnet50", "GFPGANv1.4.pth", 1, 0.5, "no", "no", "0", "0", 1 ] } ], "links": [ [ 3, 3, 0, 5, 0, "IMAGE" ], [ 4, 4, 0, 5, 1, "IMAGE" ], [ 5, 6, 0, 5, 2, "IMAGE" ], [ 6, 5, 0, 1, 0, "IMAGE" ], [ 14, 11, 0, 5, 3, "IMAGE" ], [ 66, 1, 0, 49, 2, "FACE_MODEL" ], [ 67, 3, 0, 49, 0, "IMAGE" ], [ 68, 49, 0, 50, 0, "IMAGE" ] ], "groups": [], "config": {}, "extra": {}, "version": 0.4 }

Sysinfo

Ubuntu20.04 python3.10.14 A10

Relevant console log

Error occurred when executing ReActorFaceSwap:

'NoneType' object has no attribute 'reshape'

Additional information

No response

vrgamegirl19 commented 2 weeks ago

I'm getting this same error and have a post too. Please reply back if you get it working!! I even bought a brand new hard drive and did a fresh install of comfy and it still won't work.

Gourieff commented 2 days ago

Related https://github.com/Gourieff/comfyui-reactor-node/issues/398