Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
1247862674 opened this issue Aug 29, 2024 · 2 comments
Open
3 tasks done

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

1247862674 opened this issue Aug 29, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@1247862674
Copy link

First, confirm

  • I have read the instruction carefully
  • I have searched the existing issues
  • I have updated the extension to the latest version

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\n*Mean 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

@1247862674 1247862674 added bug Something isn't working new labels Aug 29, 2024
@vrgamegirl19
Copy link

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
Copy link
Owner

Related #398

@Gourieff Gourieff removed the new label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants