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

ReActorFaceSwap shapes (1,3145728) and (512,512) not aligned: 3145728 (dim 1) != 512 (dim 0) #556

Open
3 tasks done
BilguunVorshilov opened this issue Oct 17, 2024 · 0 comments
Labels
bug Something isn't working new

Comments

@BilguunVorshilov
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?

I can't generate images i keep getting this error

ReActorFaceSwap
shapes (1,3145728) and (512,512) not aligned: 3145728 (dim 1) != 512 (dim 0)

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

Sysinfo

Windows, python 3.11.9

Relevant console log

# ComfyUI Error Report
## Error Details
- **Node Type:** ReActorFaceSwap
- **Exception Type:** ValueError
- **Exception Message:** shapes (1,3145728) and (512,512) not aligned: 3145728 (dim 1) != 512 (dim 0)
## Stack Trace

  File "S:\ComfyUI_windows_portable\ComfyUI\execution.py", line 323, 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 "S:\ComfyUI_windows_portable\ComfyUI\execution.py", line 198, 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 "S:\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)

  File "S:\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 350, in execute
    script.process(

  File "S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_faceswap.py", line 101, in process
    result = swap_face(
             ^^^^^^^^^^

  File "S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 329, in swap_face
    result = face_swapper.get(result, target_face, source_face)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "S:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\inswapper.py", line 51, in get
    latent = np.dot(latent, self.emap)
             ^^^^^^^^^^^^^^^^^^^^^^^^^

System Information

  • ComfyUI Version: v0.2.3-13-g7390ff3
  • Arguments: ComfyUI\main.py --windows-standalone-build
  • OS: nt
  • Python Version: 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]
  • Embedded Python: true
  • PyTorch Version: 2.4.1+cu124

Devices

  • Name: cuda:0 NVIDIA GeForce RTX 3060 : cudaMallocAsync
    • Type: cuda
    • VRAM Total: 12884377600
    • VRAM Free: 11793334272
    • Torch VRAM Total: 0
    • Torch VRAM Free: 0

Logs

2024-10-17 19:01:06,713 - root - INFO - Total VRAM 12288 MB, total RAM 32677 MB
2024-10-17 19:01:06,713 - root - INFO - pytorch version: 2.4.1+cu124
2024-10-17 19:01:06,714 - root - INFO - Set vram state to: NORMAL_VRAM
2024-10-17 19:01:06,714 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 3060 : cudaMallocAsync
2024-10-17 19:01:07,643 - root - INFO - Using pytorch cross attention
2024-10-17 19:01:08,771 - root - INFO - [Prompt Server] web root: S:\ComfyUI_windows_portable\ComfyUI\web
2024-10-17 19:01:11,972 - root - INFO - Total VRAM 12288 MB, total RAM 32677 MB
2024-10-17 19:01:11,973 - root - INFO - pytorch version: 2.4.1+cu124
2024-10-17 19:01:11,974 - root - INFO - Set vram state to: NORMAL_VRAM
2024-10-17 19:01:11,974 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 3060 : cudaMallocAsync
2024-10-17 19:01:15,487 - root - INFO - --------------
2024-10-17 19:01:15,487 - root - INFO - �[91m ### Mixlab Nodes: �[93mLoaded
2024-10-17 19:01:15,498 - root - INFO - ChatGPT.available True
2024-10-17 19:01:15,498 - root - INFO - edit_mask.available True
2024-10-17 19:01:15,642 - root - INFO - ClipInterrogator.available True
2024-10-17 19:01:15,769 - root - INFO - PromptGenerate.available True
2024-10-17 19:01:15,769 - root - INFO - ChinesePrompt.available True
2024-10-17 19:01:15,769 - root - INFO - RembgNode_.available True
2024-10-17 19:01:16,158 - root - INFO - TripoSR.available
2024-10-17 19:01:16,159 - root - INFO - MiniCPMNode.available
2024-10-17 19:01:16,369 - root - INFO - Scenedetect.available
2024-10-17 19:01:16,465 - root - INFO - FishSpeech.available
2024-10-17 19:01:16,474 - root - INFO - SenseVoice.available
2024-10-17 19:01:16,498 - root - INFO - Whisper.available False
2024-10-17 19:01:16,508 - root - INFO - FalVideo.available
2024-10-17 19:01:16,508 - root - INFO - �[93m -------------- �[0m
2024-10-17 19:01:19,014 - root - INFO - 
Import times for custom nodes:
2024-10-17 19:01:19,014 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py
2024-10-17 19:01:19,014 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\CPlus_Ardenius
2024-10-17 19:01:19,014 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-saveimage-plus
2024-10-17 19:01:19,014 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\cg-use-everywhere
2024-10-17 19:01:19,014 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus
2024-10-17 19:01:19,014 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\efficiency-nodes-comfyui
2024-10-17 19:01:19,014 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\cg-image-picker
2024-10-17 19:01:19,014 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Universal-Styler
2024-10-17 19:01:19,014 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite
2024-10-17 19:01:19,014 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\masquerade-nodes-comfyui
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-lama-remover
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-SuperBeasts
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Florence2
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ControlAltAI-Nodes
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Video-Matting
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-tooling-nodes
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Florence-2
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy-image-saver
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Custom-Scripts
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-various
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale
2024-10-17 19:01:19,015 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\virtuoso-nodes
2024-10-17 19:01:19,016 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_essentials
2024-10-17 19:01:19,016 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Frame-Interpolation
2024-10-17 19:01:19,016 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-KJNodes
2024-10-17 19:01:19,016 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-GGUF
2024-10-17 19:01:19,016 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Advanced-ControlNet
2024-10-17 19:01:19,016 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\x-flux-comfyui
2024-10-17 19:01:19,016 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy
2024-10-17 19:01:19,016 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-IC-Light
2024-10-17 19:01:19,016 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Comfyroll_CustomNodes
2024-10-17 19:01:19,016 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved
2024-10-17 19:01:19,016 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\facerestore_cf
2024-10-17 19:01:19,016 - root - INFO -    0.0 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-tensorops
2024-10-17 19:01:19,017 - root - INFO -    0.1 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\CharacterFaceSwap
2024-10-17 19:01:19,017 - root - INFO -    0.1 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-segment-anything-2
2024-10-17 19:01:19,017 - root - INFO -    0.1 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy_mtb
2024-10-17 19:01:19,017 - root - INFO -    0.1 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node
2024-10-17 19:01:19,017 - root - INFO -    0.1 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_segment_anything
2024-10-17 19:01:19,017 - root - INFO -    0.1 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_LayerStyle
2024-10-17 19:01:19,017 - root - INFO -    0.1 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-PuLID-Flux-Enhanced
2024-10-17 19:01:19,017 - root - INFO -    0.3 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Crystools
2024-10-17 19:01:19,017 - root - INFO -    0.4 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AdvancedLivePortrait
2024-10-17 19:01:19,017 - root - INFO -    0.5 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager
2024-10-17 19:01:19,017 - root - INFO -    0.7 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Image-Filters
2024-10-17 19:01:19,017 - root - INFO -    0.9 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Easy-Use
2024-10-17 19:01:19,017 - root - INFO -    0.9 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-art-venture
2024-10-17 19:01:19,018 - root - INFO -    1.4 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-mixlab-nodes
2024-10-17 19:01:19,018 - root - INFO -    1.7 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui
2024-10-17 19:01:19,018 - root - INFO -    1.8 seconds: S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Inspyrenet-Rembg
2024-10-17 19:01:19,018 - root - INFO - 
2024-10-17 19:01:19,035 - root - INFO - Starting server

2024-10-17 19:01:19,035 - root - INFO - To see the GUI go to: http://127.0.0.1:8188
2024-10-17 19:01:28,322 - root - INFO - got prompt
2024-10-17 19:01:35,240 - root - ERROR - !!! Exception during processing !!! shapes (1,3145728) and (512,512) not aligned: 3145728 (dim 1) != 512 (dim 0)
2024-10-17 19:01:35,242 - root - ERROR - Traceback (most recent call last):
  File "S:\ComfyUI_windows_portable\ComfyUI\execution.py", line 323, 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 "S:\ComfyUI_windows_portable\ComfyUI\execution.py", line 198, 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 "S:\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "S:\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 350, in execute
    script.process(
  File "S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_faceswap.py", line 101, in process
    result = swap_face(
             ^^^^^^^^^^
  File "S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 329, in swap_face
    result = face_swapper.get(result, target_face, source_face)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "S:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\inswapper.py", line 51, in get
    latent = np.dot(latent, self.emap)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: shapes (1,3145728) and (512,512) not aligned: 3145728 (dim 1) != 512 (dim 0)

2024-10-17 19:01:35,244 - root - INFO - Prompt executed in 6.91 seconds

Attached Workflow

Please make sure that workflow does not contain any sensitive information such as API keys or passwords.

{"last_node_id":28,"last_link_id":47,"nodes":[{"id":13,"type":"FaceRestoreModelLoader","pos":{"0":822,"1":93},"size":{"0":315,"1":58},"flags":{},"order":0,"mode":2,"inputs":[],"outputs":[{"name":"FACERESTORE_MODEL","type":"FACERESTORE_MODEL","links":[18],"shape":3}],"properties":{"Node name for S&R":"FaceRestoreModelLoader"},"widgets_values":["codeformer-v0.1.0.pth"]},{"id":11,"type":"FaceRestoreCFWithModel","pos":{"0":1164,"1":162},"size":{"0":315,"1":102},"flags":{},"order":3,"mode":2,"inputs":[{"name":"facerestore_model","type":"FACERESTORE_MODEL","link":18,"slot_index":0},{"name":"image","type":"IMAGE","link":null}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[22],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"FaceRestoreCFWithModel"},"widgets_values":["retinaface_resnet50",1]},{"id":3,"type":"LoadImage","pos":{"0":-56,"1":46},"size":{"0":315,"1":314},"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[47],"slot_index":0,"shape":3},{"name":"MASK","type":"MASK","links":null,"slot_index":1,"shape":3}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["Test1.png","image"]},{"id":4,"type":"PreviewImage","pos":{"0":1202,"1":420},"size":{"0":330,"1":600},"flags":{},"order":6,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":42}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"},"widgets_values":[],"color":"#222","bgcolor":"#000"},{"id":24,"type":"ReActorFaceSwap","pos":{"0":599,"1":236},"size":{"0":315,"1":358},"flags":{},"order":4,"mode":0,"inputs":[{"name":"input_image","type":"IMAGE","link":46},{"name":"source_image","type":"IMAGE","link":47,"shape":7},{"name":"face_model","type":"FACE_MODEL","link":null,"shape":7},{"name":"face_boost","type":"FACE_BOOST","link":null,"shape":7}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[42],"slot_index":0},{"name":"FACE_MODEL","type":"FACE_MODEL","links":null}],"properties":{"Node name for S&R":"ReActorFaceSwap"},"widgets_values":[true,"inswapper_128.onnx","retinaface_resnet50","codeformer-v0.1.0.pth",1,0.5,"no","no","0","0",0]},{"id":17,"type":"SaveImage","pos":{"0":1691,"1":259},"size":{"0":330,"1":600},"flags":{},"order":5,"mode":2,"inputs":[{"name":"images","type":"IMAGE","link":22}],"outputs":[],"properties":{"Node name for S&R":"SaveImage"},"widgets_values":[""],"color":"#222","bgcolor":"#000"},{"id":25,"type":"LoadImage","pos":{"0":-62,"1":449},"size":{"0":315,"1":314},"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[46],"slot_index":0},{"name":"MASK","type":"MASK","links":null}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["1.png","image"]}],"links":[[18,13,0,11,0,"FACERESTORE_MODEL"],[22,11,0,17,0,"IMAGE"],[42,24,0,4,0,"IMAGE"],[46,25,0,24,0,"IMAGE"],[47,3,0,24,1,"IMAGE"]],"groups":[],"config":{},"extra":{"ds":{"scale":2.274511628246825,"offset":[-486.15935874179775,-279.49467482175163]}},"version":0.4}

Additional Context

(Please add any additional context or steps to reproduce the error here)



### Additional information

_No response_
@BilguunVorshilov BilguunVorshilov added bug Something isn't working new labels Oct 17, 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 new
Projects
None yet
Development

No branches or pull requests

1 participant