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

"AttributeError: 'NoneType' object has no attribute 'reshape'" when swapping from a single image. Works fine from a pre-fab model #23

Open
3 tasks done
RobZim41 opened this issue Feb 25, 2025 · 0 comments
Labels
bug Something isn't working new

Comments

@RobZim41
Copy link

RobZim41 commented Feb 25, 2025

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?

Context in case it's important: Over the weekend I decided to move from a beta to a more stable build of Windows 11, which requires a clean install. I am restoring Forge and ReActor-SFW, which involves a combination of fresh installation from scratch and copying over old files from backup, including old prefab face models. Both Forge and ReActor themselves are clean installations.

Now that everything is set up, I get the error below whenever I try to swap in a face from a single image. Swap works fine when using one of my old pre-fab face models.

Things I've tried:

  • Redownloaded inswapper_128.onnx and put in the models/insightface folder
  • Individually force reinstalled insightface 0.7.3, onnx, onnxruntime-gpu, opencv-python, and tqdm

Steps to reproduce the problem

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

Sysinfo

Windows 11, Edge, Forge f2.0.1v1.10.1-previous-654-g8dd92501, Python: 3.10.6, torch: 2.6.0+cu124 , xformers: 0.0.29.post3, gradio: 4.40.0

Relevant console log

Moving model(s) has taken 0.06 seconds
12:20:08 - ReActor - STATUS - Working: source face index [0], target face index [0]
12:20:08 - ReActor - STATUS - Checking for any unsafe content
12:20:08 - ReActor - STATUS - Analyzing Source Image...
12:20:09 - ReActor - STATUS - Analyzing Target Image...
12:20:10 - ReActor - STATUS - Detecting Source Face, Index = 0
12:20:10 - ReActor - STATUS - Detected: -34- y.o. Female
12:20:12 - ReActor - STATUS - Detecting Target Face, Index = 0
12:20:12 - ReActor - STATUS - Detected: -24- y.o. Female
12:20:12 - ReActor - STATUS - Swapping Source into Target
*** Error running postprocess_image: C:\Users\robz\stable-diffusion-webui-forge\extensions\sd-webui-reactor-sfw\scripts\reactor_faceswap.py
    Traceback (most recent call last):
      File "C:\Users\robz\stable-diffusion-webui-forge\modules\scripts.py", line 940, in postprocess_image
        script.postprocess_image(p, pp, *script_args)
      File "C:\Users\robz\stable-diffusion-webui-forge\extensions\sd-webui-reactor-sfw\scripts\reactor_faceswap.py", line 465, in postprocess_image
        result, output, swapped = swap_face(
      File "C:\Users\robz\stable-diffusion-webui-forge\extensions\sd-webui-reactor-sfw\scripts\reactor_swapper.py", line 636, in swap_face
        result_image, output, swapped = operate(source_img,target_img,target_img_orig,model,source_faces_index,faces_index,source_faces,target_faces,gender_source,gender_target,source_face,wrong_gender,source_age,source_gender,output,swapped,mask_face,entire_mask_image,enhancement_options,detection_options)
      File "C:\Users\robz\stable-diffusion-webui-forge\extensions\sd-webui-reactor-sfw\scripts\reactor_swapper.py", line 799, in operate
        swapped_image = face_swapper.get(result, target_face, source_face)
      File "C:\Users\robz\anaconda3\envs\autosd5\lib\site-packages\insightface\model_zoo\inswapper.py", line 50, in get
        latent = source_face.normed_embedding.reshape((1,-1))
    AttributeError: 'NoneType' object has no attribute 'reshape'

---
Total progress: 100%|██████████████████████████████████████████████████████████████████| 30/30 [00:29<00:00,  1.01it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 30/30 [00:29<00:00,  1.22it/s]

Additional information

No response

@RobZim41 RobZim41 added bug Something isn't working new labels Feb 25, 2025
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