glucauze / sd-webui-faceswaplab

Extended faceswap extension for StableDiffusion web-ui with multiple faceswaps, inpainting, checkpoints, ....
https://glucauze.github.io/sd-webui-faceswaplab/
GNU Affero General Public License v3.0
731 stars 97 forks source link

ERROR - Conversion failed 'UpscaledINSwapper' object has no attribute 'emap' #15

Closed XiaoCC closed 1 year ago

XiaoCC commented 1 year ago

set det-size: (640, 640) 2023-08-02 11:17:49,338 - FaceSwapLab - INFO - will generate 1 images 2023-08-02 11:17:49,338 - FaceSwapLab - INFO - Process face 0 2023-08-02 11:17:49,339 - FaceSwapLab - INFO - Source Gender 0 Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} set det-size: (640, 640) 2023-08-02 11:17:51,644 - FaceSwapLab - INFO - Target faces count : 1 2023-08-02 11:17:51,644 - FaceSwapLab - INFO - swap face 0 2023-08-02 11:17:51,649 - FaceSwapLab - ERROR - Conversion failed 'UpscaledINSwapper' object has no attribute 'emap' 2023-08-02 11:17:51,649 - FaceSwapLab - ERROR - Failed to swap face in postprocess method : 'UpscaledINSwapper' object has no attribute 'emap'

glucauze commented 1 year ago

I have no explaination for this issue. Noticed you closed it, did you find why ?

fallenangel3k commented 8 months ago

i have same issue. it seems to be related if you TRY to use other inswappers like simswap, blendswap or ghost. removing this additional swapper/onnx files from the faceswaplab folder seems to fix the error or produce it if you put additonal swapper models there. MAYBE this is the cause/solution. please try. for me it works and i really would love to use other inswappers than the simple 128px one.


EDIT: I re-tested my theory and can confirm it, that it is the cause and solution to the problem.

as soon as I put an other additional swapper model in the directory where the original inswapper128.onnx resides, the faceswaplab ceases to create new face-models:

''' 2023-12-18 08:01:49,687 - FaceSwapLab - INFO - Target faces count : 1 2023-12-18 08:01:49,687 - FaceSwapLab - INFO - swap face 0 2023-12-18 08:01:49,690 - FaceSwapLab - ERROR - Conversion failed 'UpscaledINSwapper' object has no attribute 'emap' 2023-12-18 08:01:49,692 - FaceSwapLab - ERROR - Failed to build checkpoint 'UpscaledINSwapper' object has no attribute 'emap' Traceback (most recent call last): File "E:\STABLEDIFFUSION_WEBUI\webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_swapping\face_checkpoints.py", line 95, in build_face_checkpoint_and_save result: swapper.ImageResult = swapper.swap_face( File "E:\STABLEDIFFUSION_WEBUI\webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_swapping\swapper.py", line 658, in swap_face raise e File "E:\STABLEDIFFUSION_WEBUI\webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_swapping\swapper.py", line 646, in swap_face result = face_swapper.get( File "E:\STABLEDIFFUSION_WEBUI\webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_swapping\upscaled_inswapper.py", line 176, in get latent = np.dot(latent, self.emap) AttributeError: 'UpscaledINSwapper' object has no attribute 'emap' ''' <-- ERROR!!!

when removing the additonal models: ''' 2023-12-18 08:05:11,281 - FaceSwapLab - INFO - Target faces count : 1 2023-12-18 08:05:11,282 - FaceSwapLab - INFO - swap face 0 2023-12-18 08:05:18,504 - FaceSwapLab - INFO - **** 2023-12-18 08:05:18,504 - FaceSwapLab - INFO - Inswapper 2023-12-18 08:05:18,508 - FaceSwapLab - INFO - Upscale with Lanczos scale = 4 2023-12-18 08:05:18,515 - FaceSwapLab - INFO - Restore face with CodeFormer 2023-12-18 08:05:29,247 - FaceSwapLab - INFO - sharpen 2023-12-18 08:05:29,256 - FaceSwapLab - INFO - improved_mask 2023-12-18 08:05:30,566 - FaceSwapLab - INFO - **** ''' <--- WORKS w/o error!

when putting the other swapper files in the directory, the error reappears again....

---> so how to use other inswapper models like simswap, ghost or blendswap?


EDIT2 : It seems the specific files of blendswapper.onnx and all files of ghost seem to provoke this error. by placing SIMSWAP in the directory there was NO error.

still the question remains: how to correctly use other swap-models in faceswaplab?

cheers