diff --git a/docs/documentation.markdown b/docs/documentation.markdown index aecd4fa..c66155b 100644 --- a/docs/documentation.markdown +++ b/docs/documentation.markdown @@ -176,7 +176,7 @@ You need a sufficiently recent version of your SD environment. Using the GPU has In Version 1.2.1, the ability to use the GPU has been added, a setting that can be configured in SD at startup. Currently, this feature is only supported on Windows and Linux, as the necessary dependencies for Mac have not been included. -The `--faceswaplab_gpu` option in SD can be added to the args in webui-user.sh or webui-user.bat. +The `--faceswaplab_gpu` option in SD can be added to the args in webui-user.sh or webui-user.bat. **There is also an option in SD settings**. The model stays loaded in VRAM and won't be unloaded after each use. As of now, I don't know a straightforward way to handle this, so it will occupy space continuously. If your system's VRAM is limited, enabling this option might not be advisable. @@ -196,6 +196,16 @@ You should therefore be able to debug a little before activating the option. If The first time the swap is used, the program will continue to use the CPU, but will offer to install the GPU. You will then need to restart. This is due to the optimizations made by SD.Next to the installation scripts. +For SD.Next, the best is to install dependencies manually : + +on windows : + +```shell +.\venv\Scripts\activate +cd .\extensions\sd-webui-faceswaplab\ + pip install .\requirements-gpu.txt +``` + ## Settings You can change the program's default behavior in your webui's global settings (FaceSwapLab section in settings). This is particularly useful if you want to have default options for inpainting or for post-processsing, for example. diff --git a/scripts/faceswaplab_swapping/swapper.py b/scripts/faceswaplab_swapping/swapper.py index 1c3a55b..168ba7e 100644 --- a/scripts/faceswaplab_swapping/swapper.py +++ b/scripts/faceswaplab_swapping/swapper.py @@ -50,14 +50,19 @@ def use_gpu() -> bool: @lru_cache def force_install_gpu_providers() -> None: # Ugly Ugly hack due to SDNEXT : - from scripts.configure import check_install - - logger.warning("Try to reinstall gpu dependencies") - check_install() - logger.warning("IF onnxruntime-gpu has been installed successfully, RESTART") - logger.warning( - "On SD.NEXT/vladmantic you will also need to check numpy>=1.24.2 and tensorflow>=2.13.0" - ) + try: + from scripts.configure import check_install + + logger.warning("Try to reinstall gpu dependencies") + check_install() + logger.warning("IF onnxruntime-gpu has been installed successfully, RESTART") + logger.warning( + "On SD.NEXT/vladmantic you will also need to check numpy>=1.24.2 and tensorflow>=2.13.0" + ) + except: + logger.error( + "Reinstall has failed (which is normal on windows), please install requirements-gpu.txt manually to enable gpu." + ) def get_providers() -> List[str]: