Closed mesax1 closed 1 year ago
Hmm, maybe there's a problem with the providers. That's surprising because I didn't change that part. In this file: https://github.com/glucauze/sd-webui-faceswaplab/blob/main/scripts/faceswaplab_swapping/swapper.py
The providers are set to ["CPUExecutionProvider"], and these are the versions being used.
Unfortunately, I don't have a Mac to test it on.
You could try looking at the dependencies in roop to see if anything makes more sense.
From what I see:
onnxruntime==1.15.1; python_version != '3.9' and sys_platform == 'darwin' and platform_machine != 'arm64'
onnxruntime-coreml==1.13.1; python_version == '3.9' and sys_platform == 'darwin' and platform_machine != 'arm64'
onnxruntime-silicon==1.13.1; sys_platform == 'darwin' and platform_machine == 'arm64'
These could be necessary on a Mac.
If you manage to get it working, I will modify the code accordingly.
Thanks! I tried that too, installed some of them that were apparently missing, but I'm still getting the same error :(
Could you try to do that :
@lru_cache(maxsize=1)
def getFaceSwapModel(model_path: str) -> upscaled_inswapper.UpscaledINSwapper:
"""
Retrieves the face swap model and initializes it if necessary.
Args:
model_path (str): Path to the face swap model.
Returns:
insightface.model_zoo.FaceModel: The face swap model.
"""
try:
# Initializes the face swap model using the specified model path.
return upscaled_inswapper.UpscaledINSwapper(
insightface.model_zoo.get_model(model_path, providers=providers)
)
except Exception as e:
logger.error(
"Loading of swapping model failed, please check the requirements (On Windows, download and install Visual Studio. During the install, make sure to include the Python and C++ packages.)"
)
import traceback
traceback.print_exc()
raise FaceModelException("Loading of swapping model failed")
I was stupid enough not to print the complete exception i need to investigate more.
Since it comes from the inswapper model and the analyzer seems to load, you'll have to check that the model isn't corrupted. On my computer, i have that :
sha1sum inswapper_128.onnx
17a64851eaefd55ea597ee41e5c18409754244c5 inswapper_128.onnx
sha256sum inswapper_128.onnx
e4a3f08c753cb72d04e10aa0f7dbe3deebbf39567d4ead6dce08e98aa49e16af inswapper_128.onnx
sha512sum inswapper_128.onnx
4311f4ccd9da58ec544e912b32ac0cba95f5ab4b1a06ac367efd3e157396efbae1097f624f10e77dd811fbba0917fa7c96e73de44563aa6099e5f46830965069 inswapper_128.onnx
Maybe the model inswapper_128.onnx was corrupted. I deleted it, downloaded it again, and now it works! Thanks!
Well, better that than something hard to fix. I've added a control and a warning in version 1.2. I still have a lot of things to test and correct before publishing it.
Hi, I'm getting this problem when trying to run on a Mac with M2
Considering this part:
FaceSwapLab - ERROR - Loading of swapping model failed, please check the requirements (On Windows, download and install Visual Studio. During the install, make sure to include the Python and C++ packages.)
Given that I'm not on Windows, how can I get the swapping model to load correctly?The extension used to work when it was part of SD-roop-webui, but now that its independent, I don't know what went wrong.
I tried by installing each the the dependencies from requirements.txt independently, but still I'm getting the same error.