GithubHelp home page GithubHelp logo

glucauze / sd-webui-faceswaplab Goto Github PK

View Code? Open in Web Editor NEW
675.0 13.0 89.0 9.95 MB

Extended faceswap extension for StableDiffusion web-ui with multiple faceswaps, inpainting, checkpoints, ....

Home Page: https://glucauze.github.io/sd-webui-faceswaplab/

License: GNU Affero General Public License v3.0

Python 99.91% Shell 0.09%
automatic1111 face faceswap insightface sdnext swapping

sd-webui-faceswaplab's Introduction

FaceSwapLab for a1111/Vlad

V1.2.3 : Breaking change for settings, please read changelog.

Please read the documentation here : https://glucauze.github.io/sd-webui-faceswaplab/

You can also read the doc discussion section

See CHANGELOG.md for changes in last versions.

FaceSwapLab is an extension for Stable Diffusion that simplifies face-swapping. It has evolved from sd-webui-faceswap and some part of sd-webui-roop. However, a substantial amount of the code has been rewritten to improve performance and to better manage masks.

Some key features include the ability to reuse faces via checkpoints, multiple face units, batch process images, sort faces based on size or gender, and support for vladmantic. It also provides a face inpainting feature.

While FaceSwapLab is still under development, it has reached a good level of stability. This makes it a reliable tool for those who are interested in face-swapping within the Stable Diffusion environment. As with all projects of this type, it’s expected to improve and evolve over time.

Disclaimer and license

In short:

  • Ethical Guideline: NSFW is now configurable due to performance issue. Please don't use this to do harm.
  • License: This software is distributed under the terms of the GNU Affero General Public License (AGPL), version 3 or later.
  • Model License: This software uses InsightFace's pre-trained models, which are available for non-commercial research purposes only.

More on this here : https://glucauze.github.io/sd-webui-faceswaplab/

Known problems (wontfix):

  • Older versions of gradio don't work well with the extension. See this bug : #5

Quick Start

Here are some gifs to explain (non cherry picked, just random pictures) :

Simple Usage (roop like)

This use codeformer on all faces (including non swapped)

simple.webm

Advanced options

This is use to improve results. This use upscaling and codeformer only on swapped faces

advanced.webm

Inpainting

This add inpainting on faces :

inpainting.webm

Build and use checkpoints :

build.webm

Simple

  1. Put a face in the reference.
  2. Select a face number.
  3. Select "Enable."
  4. Select "CodeFormer" in Global Post-Processing tab.

Once you're happy with some results but want to improve, the next steps are to:

  • Use advanced settings in face units (which are not as complex as they might seem, it's basically fine tuning post-processing for each faces).
  • Use pre/post inpainting to tweak the image a bit for more natural results.

Better

  1. Put a face in the reference.

  2. Select a face number.

  3. Select "Enable."

  4. In Post-Processing accordeon:

    • Select "CodeFormer"
    • Select "LDSR" or a faster model "003_realSR_BSRGAN_DFOWMFC_s64w8_SwinIR-L_x4_GAN" in upscaler. See here for a list of upscalers.
    • Use sharpen, color_correction and improved mask
  5. Disable "CodeFormer" in Global Post-Processing tab (otherwise it will be applied twice)

Don't hesitate to share config in the discussion section.

Features

  • Face Unit Concept: Similar to controlNet, the program introduces the concept of a face unit. You can configure up to 10 units (3 units are the default setting) in the program settings (sd).

  • Vladmantic and a1111 Support

  • Batch Processing

  • GPU

  • Inpainting Fixes : supports “only masked” and mask inpainting.

  • Performance Improvements: The overall performance of the software has been enhanced.

  • FaceSwapLab Tab: providing various tools (build, compare, extract, batch)

  • FaceSwapLab Settings: FaceSwapLab settings are now part of the sd settings. To access them, navigate to the sd settings section.

  • Face Reuse Via Checkpoints: The FaceTools tab now allows creating checkpoints, which facilitate face reuse. When a checkpoint is used, it takes precedence over the reference image, and the reference source image is discarded.

  • Gender Detection: The program can now detect gender based on faces.

  • Face Combination (Blending): Multiple versions of a face can be combined to enhance the swapping result. This blending happens during checkpoint creation.)

  • Preserve Original Images: You can opt to keep original images before the swapping process.

  • Multiple Face Versions for Replacement: The program allows the use of multiple versions of the same face for replacement.

  • Face Similarity and Filtering: You can compare faces against the reference and/or source images.

  • Face Comparison: face comparison feature.

  • Face Extraction: face extraction with or without upscaling.

  • Improved Post-Processing: codeformer, gfpgan, upscaling.

  • Post Inpainting: This feature allows the application of image-to-image inpainting specifically to faces.

  • Upscaled Inswapper: The program now includes an upscaled inswapper option, which improves results by incorporating upsampling, sharpness adjustment, and color correction before face is merged to the original image.

  • API with typing support

Installation

See the documentation here : https://glucauze.github.io/sd-webui-faceswaplab/

sd-webui-faceswaplab's People

Contributors

glucauze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sd-webui-faceswaplab's Issues

sdapi/v1/img2img or txt2img api alwayson_scripts parameter "Batch Sources Images" support base64 images

like this:
image

I modified this file in the source code to achieve this function:
sd-webui-faceswaplab/scripts/faceswaplab_ui/faceswaplab_unit_settings.py

    @property
    def faces(self) -> List[Face]:
        """_summary_
        Extract all faces (including reference face) to provide an array of faces
        Only processed once.
        """
        if self.batch_files is not None and not hasattr(self, "_faces"):
            self._faces = (
                [self.reference_face] if self.reference_face is not None else []
            )
            # ===> begin change <===
            files = self.batch_files
            if isinstance(self.batch_files, str):
                batchs = []
                base64_batch_files = self.batch_files.split(',')
                for base64str in base64_batch_files:
                    batchs.append(api_utils.base64_to_pil(base64str))
                files = batchs
            for file in files:
            # ===> end change <===
                if isinstance(file, Image.Image):
                    img = file
                else:
                    img = Image.open(file.name)  # type: ignore

                face = swapper.get_or_default(
                    swapper.get_faces(pil_to_cv2(img)), 0, None
                )
                if face is not None:
                    self._faces.append(face)
        return self._faces

Hope it can be adopted

Couldn't install sd-webui-faceswaplab requirement: insightface==0.7.3.

Hi, I using the latest version of a1111 and the latest of gradio but I keep getting this huge error log when I launch a1111

( its really long sorry by advance )

Faceswaplab : Use GPU requirements
Checking faceswaplab requirements
Install insightface==0.7.3
Installing sd-webui-faceswaplab requirement: insightface==0.7.3
Couldn't install sd-webui-faceswaplab requirement: insightface==0.7.3.
Command: "C:\Users\Admin\Documents\Stable diffusion\stable-diffusion-webui\venv\Scripts\python.exe" -m pip install insightface==0.7.3 --prefer-binary
Error code: 1
stdout: Collecting insightface==0.7.3
Using cached insightface-0.7.3.tar.gz (439 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: numpy in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (1.23.5)
Collecting onnx (from insightface==0.7.3)
Obtaining dependency information for onnx from https://files.pythonhosted.org/packages/00/36/e7a7e7a85564e7d409e4e8addfa11d41015d2190bfff30064771e7c21ca0/onnx-1.14.1-cp310-cp310-win_amd64.whl.metadata
Downloading onnx-1.14.1-cp310-cp310-win_amd64.whl.metadata (15 kB)
Requirement already satisfied: tqdm in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (4.65.0)
Requirement already satisfied: requests in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (2.31.0)
Requirement already satisfied: matplotlib in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (3.7.2)
Requirement already satisfied: Pillow in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (9.5.0)
Requirement already satisfied: scipy in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (1.11.1)
Requirement already satisfied: scikit-learn in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (1.3.0)
Requirement already satisfied: scikit-image in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (0.21.0)
Collecting easydict (from insightface==0.7.3)
Using cached easydict-1.10-py3-none-any.whl
Requirement already satisfied: cython in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (3.0.2)
Collecting albumentations (from insightface==0.7.3)
Obtaining dependency information for albumentations from https://files.pythonhosted.org/packages/9b/f6/c486cedb4f75147232f32ec4c97026714cfef7c7e247a1f0427bc5489f66/albumentations-1.3.1-py3-none-any.whl.metadata
Downloading albumentations-1.3.1-py3-none-any.whl.metadata (34 kB)
Collecting prettytable (from insightface==0.7.3)
Obtaining dependency information for prettytable from https://files.pythonhosted.org/packages/25/1e/4c284713b092ec384fad4399452f43f6446ad9aabc9c0b3c3c0920cc53b6/prettytable-3.8.0-py3-none-any.whl.metadata
Downloading prettytable-3.8.0-py3-none-any.whl.metadata (26 kB)
Requirement already satisfied: PyYAML in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from albumentations->insightface==0.7.3) (6.0.1)
Collecting qudida>=0.0.4 (from albumentations->insightface==0.7.3)
Using cached qudida-0.0.4-py3-none-any.whl (3.5 kB)
Requirement already satisfied: opencv-python-headless>=4.1.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from albumentations->insightface==0.7.3) (4.8.0.76)
Requirement already satisfied: networkx>=2.8 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (3.1)
Requirement already satisfied: imageio>=2.27 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (2.31.1)
Requirement already satisfied: tifffile>=2022.8.12 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (2023.7.18)
Requirement already satisfied: PyWavelets>=1.1.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (1.4.1)
Requirement already satisfied: packaging>=21 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (23.1)
Requirement already satisfied: lazy_loader>=0.2 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (0.3)
Requirement already satisfied: contourpy>=1.0.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (1.1.0)
Requirement already satisfied: cycler>=0.10 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (4.41.1)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (1.4.4)
Requirement already satisfied: pyparsing<3.1,>=2.3.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (3.0.9)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (2.8.2)
Collecting protobuf>=3.20.2 (from onnx->insightface==0.7.3)
Obtaining dependency information for protobuf>=3.20.2 from https://files.pythonhosted.org/packages/5e/46/5b9674a33cbf690ffdd79ab1863767a66461cd06ea7aeb9f90e4e50be7a5/protobuf-4.24.3-cp310-abi3-win_amd64.whl.metadata
Downloading protobuf-4.24.3-cp310-abi3-win_amd64.whl.metadata (540 bytes)
Requirement already satisfied: typing-extensions>=3.6.2.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from onnx->insightface==0.7.3) (4.7.1)
Requirement already satisfied: wcwidth in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from prettytable->insightface==0.7.3) (0.2.6)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from requests->insightface==0.7.3) (3.2.0)
Requirement already satisfied: idna<4,>=2.5 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from requests->insightface==0.7.3) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from requests->insightface==0.7.3) (1.26.16)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from requests->insightface==0.7.3) (2023.7.22)
Requirement already satisfied: joblib>=1.1.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-learn->insightface==0.7.3) (1.3.2)
Requirement already satisfied: threadpoolctl>=2.0.0 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-learn->insightface==0.7.3) (3.2.0)
Requirement already satisfied: colorama in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from tqdm->insightface==0.7.3) (0.4.6)
Requirement already satisfied: six>=1.5 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from python-dateutil>=2.7->matplotlib->insightface==0.7.3) (1.16.0)
Using cached albumentations-1.3.1-py3-none-any.whl (125 kB)
Using cached onnx-1.14.1-cp310-cp310-win_amd64.whl (13.3 MB)
Using cached prettytable-3.8.0-py3-none-any.whl (27 kB)
Using cached protobuf-4.24.3-cp310-abi3-win_amd64.whl (430 kB)
Building wheels for collected packages: insightface
Building wheel for insightface (pyproject.toml): started
Building wheel for insightface (pyproject.toml): finished with status 'error'
Failed to build insightface

stderr: WARNING: Ignoring invalid distribution -ediapipe (c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages)
error: subprocess-exited-with-error

Building wheel for insightface (pyproject.toml) did not run successfully.
exit code: 1

[214 lines of output]
WARNING: pandoc not enabled
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\insightface
copying insightface_init_.py -> build\lib.win-amd64-cpython-310\insightface
creating build\lib.win-amd64-cpython-310\insightface\app
copying insightface\app\common.py -> build\lib.win-amd64-cpython-310\insightface\app
copying insightface\app\face_analysis.py -> build\lib.win-amd64-cpython-310\insightface\app
copying insightface\app\mask_renderer.py -> build\lib.win-amd64-cpython-310\insightface\app
copying insightface\app_init_.py -> build\lib.win-amd64-cpython-310\insightface\app
creating build\lib.win-amd64-cpython-310\insightface\commands
copying insightface\commands\insightface_cli.py -> build\lib.win-amd64-cpython-310\insightface\commands
copying insightface\commands\model_download.py -> build\lib.win-amd64-cpython-310\insightface\commands
copying insightface\commands\rec_add_mask_param.py -> build\lib.win-amd64-cpython-310\insightface\commands
copying insightface\commands_init_.py -> build\lib.win-amd64-cpython-310\insightface\commands
creating build\lib.win-amd64-cpython-310\insightface\data
copying insightface\data\image.py -> build\lib.win-amd64-cpython-310\insightface\data
copying insightface\data\pickle_object.py -> build\lib.win-amd64-cpython-310\insightface\data
copying insightface\data\rec_builder.py -> build\lib.win-amd64-cpython-310\insightface\data
copying insightface\data_init_.py -> build\lib.win-amd64-cpython-310\insightface\data
creating build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\arcface_onnx.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\attribute.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\inswapper.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\landmark.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\model_store.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\model_zoo.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\retinaface.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\scrfd.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo_init_.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
creating build\lib.win-amd64-cpython-310\insightface\thirdparty
copying insightface\thirdparty_init_.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty
creating build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils\constant.py -> build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils\download.py -> build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils\face_align.py -> build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils\filesystem.py -> build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils\storage.py -> build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils\transform.py -> build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils_init_.py -> build\lib.win-amd64-cpython-310\insightface\utils
creating build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d
copying insightface\thirdparty\face3d_init_.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d
creating build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh
copying insightface\thirdparty\face3d\mesh\io.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh copying insightface\thirdparty\face3d\mesh\light.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh
copying insightface\thirdparty\face3d\mesh\render.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh
copying insightface\thirdparty\face3d\mesh\transform.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh
copying insightface\thirdparty\face3d\mesh\vis.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh
copying insightface\thirdparty\face3d\mesh_init_.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh
creating build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
copying insightface\thirdparty\face3d\mesh_numpy\io.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
copying insightface\thirdparty\face3d\mesh_numpy\light.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
copying insightface\thirdparty\face3d\mesh_numpy\render.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
copying insightface\thirdparty\face3d\mesh_numpy\transform.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
copying insightface\thirdparty\face3d\mesh_numpy\vis.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
copying insightface\thirdparty\face3d\mesh_numpy_init_.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
creating build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\morphable_model
copying insightface\thirdparty\face3d\morphable_model\fit.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\morphable_model
copying insightface\thirdparty\face3d\morphable_model\load.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\morphable_model
copying insightface\thirdparty\face3d\morphable_model\morphabel_model.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\morphable_model
copying insightface\thirdparty\face3d\morphable_model_init_.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\morphable_model
running egg_info
writing insightface.egg-info\PKG-INFO
writing dependency_links to insightface.egg-info\dependency_links.txt
writing entry points to insightface.egg-info\entry_points.txt
writing requirements to insightface.egg-info\requires.txt
writing top-level names to insightface.egg-info\top_level.txt
reading manifest file 'insightface.egg-info\SOURCES.txt'
writing manifest file 'insightface.egg-info\SOURCES.txt'
C:\Users\Admin\AppData\Local\Temp\pip-build-env-21vr7lym\overlay\Lib\site-packages\setuptools\command\build_py.py:204: _Warning: Package 'insightface.thirdparty.face3d.mesh.cython' is absent from the packages configuration.
!!

      ********************************************************************************
      ############################
      # Package would be ignored #
      ############################
      Python recognizes 'insightface.thirdparty.face3d.mesh.cython' as an importable package[^1],
      but it is absent from setuptools' `packages` configuration.

      This leads to an ambiguous overall configuration. If you want to distribute this
      package, please make sure that 'insightface.thirdparty.face3d.mesh.cython' is explicitly added
      to the `packages` configuration field.

      Alternatively, you can also rely on setuptools' discovery methods
      (for example by using `find_namespace_packages(...)`/`find_namespace:`
      instead of `find_packages(...)`/`find:`).

      You can read more about "package discovery" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

      If you don't want 'insightface.thirdparty.face3d.mesh.cython' to be distributed and are
      already explicitly excluding 'insightface.thirdparty.face3d.mesh.cython' via
      `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
      you can try to use `exclude_package_data`, or `include-package-data=False` in
      combination with a more fine grained `package-data` configuration.

      You can read more about "package data files" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


      [^1]: For Python, any directory (with suitable naming) can be imported,
            even if it does not contain any `.py` files.
            On the other hand, currently there is no concept of package data
            directory, all directories are treated like packages.
      ********************************************************************************

!!
check.warn(importable)
C:\Users\Admin\AppData\Local\Temp\pip-build-env-21vr7lym\overlay\Lib\site-packages\setuptools\command\build_py.py:204: _Warning: Package 'insightface.data.images' is absent from the packages configuration.
!!

      ********************************************************************************
      ############################
      # Package would be ignored #
      ############################
      Python recognizes 'insightface.data.images' as an importable package[^1],
      but it is absent from setuptools' `packages` configuration.

      This leads to an ambiguous overall configuration. If you want to distribute this
      package, please make sure that 'insightface.data.images' is explicitly added
      to the `packages` configuration field.

      Alternatively, you can also rely on setuptools' discovery methods
      (for example by using `find_namespace_packages(...)`/`find_namespace:`
      instead of `find_packages(...)`/`find:`).

      You can read more about "package discovery" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

      If you don't want 'insightface.data.images' to be distributed and are
      already explicitly excluding 'insightface.data.images' via
      `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
      you can try to use `exclude_package_data`, or `include-package-data=False` in
      combination with a more fine grained `package-data` configuration.

      You can read more about "package data files" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


      [^1]: For Python, any directory (with suitable naming) can be imported,
            even if it does not contain any `.py` files.
            On the other hand, currently there is no concept of package data
            directory, all directories are treated like packages.
      ********************************************************************************

!!
check.warn(importable)
C:\Users\Admin\AppData\Local\Temp\pip-build-env-21vr7lym\overlay\Lib\site-packages\setuptools\command\build_py.py:204: _Warning: Package 'insightface.data.objects' is absent from the packages configuration.
!!

      ********************************************************************************
      ############################
      # Package would be ignored #
      ############################
      Python recognizes 'insightface.data.objects' as an importable package[^1],
      but it is absent from setuptools' `packages` configuration.

      This leads to an ambiguous overall configuration. If you want to distribute this
      package, please make sure that 'insightface.data.objects' is explicitly added
      to the `packages` configuration field.

      Alternatively, you can also rely on setuptools' discovery methods
      (for example by using `find_namespace_packages(...)`/`find_namespace:`
      instead of `find_packages(...)`/`find:`).

      You can read more about "package discovery" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

      If you don't want 'insightface.data.objects' to be distributed and are
      already explicitly excluding 'insightface.data.objects' via
      `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
      you can try to use `exclude_package_data`, or `include-package-data=False` in
      combination with a more fine grained `package-data` configuration.

      You can read more about "package data files" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


      [^1]: For Python, any directory (with suitable naming) can be imported,
            even if it does not contain any `.py` files.
            On the other hand, currently there is no concept of package data
            directory, all directories are treated like packages.
      ********************************************************************************

!!
check.warn(importable)
creating build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
copying insightface\thirdparty\face3d\mesh\cython\mesh_core.cpp -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
copying insightface\thirdparty\face3d\mesh\cython\mesh_core.h -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
copying insightface\thirdparty\face3d\mesh\cython\mesh_core_cython.cpp -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
creating build\lib.win-amd64-cpython-310\insightface\data\images
copying insightface\data\images\Tom_Hanks_54745.png -> build\lib.win-amd64-cpython-310\insightface\data\images
copying insightface\data\images\mask_black.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
copying insightface\data\images\mask_blue.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
copying insightface\data\images\mask_green.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
copying insightface\data\images\mask_white.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
copying insightface\data\images\t1.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
creating build\lib.win-amd64-cpython-310\insightface\data\objects
copying insightface\data\objects\meanshape_68.pkl -> build\lib.win-amd64-cpython-310\insightface\data\objects
copying insightface\thirdparty\face3d\mesh\cython\mesh_core_cython.c -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
copying insightface\thirdparty\face3d\mesh\cython\mesh_core_cython.pyx -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
copying insightface\thirdparty\face3d\mesh\cython\setup.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
running build_ext
building 'insightface.thirdparty.face3d.mesh.cython.mesh_core_cython' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for insightface
ERROR: Could not build wheels for insightface, which is required to install pyproject.toml-based projects

Warning: Failed to install insightface==0.7.3, faceswaplab may not work. Try to restart server or install dependencies manually.
FaceswapLab install failed Couldn't install sd-webui-faceswaplab requirement: insightface==0.7.3.
Command: "C:\Users\Admin\Documents\Stable diffusion\stable-diffusion-webui\venv\Scripts\python.exe" -m pip install insightface==0.7.3 --prefer-binary
Error code: 1
stdout: Collecting insightface==0.7.3
Using cached insightface-0.7.3.tar.gz (439 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: numpy in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (1.23.5)
Collecting onnx (from insightface==0.7.3)
Obtaining dependency information for onnx from https://files.pythonhosted.org/packages/00/36/e7a7e7a85564e7d409e4e8addfa11d41015d2190bfff30064771e7c21ca0/onnx-1.14.1-cp310-cp310-win_amd64.whl.metadata
Downloading onnx-1.14.1-cp310-cp310-win_amd64.whl.metadata (15 kB)
Requirement already satisfied: tqdm in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (4.65.0)
Requirement already satisfied: requests in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (2.31.0)
Requirement already satisfied: matplotlib in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (3.7.2)
Requirement already satisfied: Pillow in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (9.5.0)
Requirement already satisfied: scipy in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (1.11.1)
Requirement already satisfied: scikit-learn in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (1.3.0)
Requirement already satisfied: scikit-image in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (0.21.0)
Collecting easydict (from insightface==0.7.3)
Using cached easydict-1.10-py3-none-any.whl
Requirement already satisfied: cython in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (3.0.2)
Collecting albumentations (from insightface==0.7.3)
Obtaining dependency information for albumentations from https://files.pythonhosted.org/packages/9b/f6/c486cedb4f75147232f32ec4c97026714cfef7c7e247a1f0427bc5489f66/albumentations-1.3.1-py3-none-any.whl.metadata
Downloading albumentations-1.3.1-py3-none-any.whl.metadata (34 kB)
Collecting prettytable (from insightface==0.7.3)
Obtaining dependency information for prettytable from https://files.pythonhosted.org/packages/25/1e/4c284713b092ec384fad4399452f43f6446ad9aabc9c0b3c3c0920cc53b6/prettytable-3.8.0-py3-none-any.whl.metadata
Downloading prettytable-3.8.0-py3-none-any.whl.metadata (26 kB)
Requirement already satisfied: PyYAML in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from albumentations->insightface==0.7.3) (6.0.1)
Collecting qudida>=0.0.4 (from albumentations->insightface==0.7.3)
Using cached qudida-0.0.4-py3-none-any.whl (3.5 kB)
Requirement already satisfied: opencv-python-headless>=4.1.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from albumentations->insightface==0.7.3) (4.8.0.76)
Requirement already satisfied: networkx>=2.8 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (3.1)
Requirement already satisfied: imageio>=2.27 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (2.31.1)
Requirement already satisfied: tifffile>=2022.8.12 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (2023.7.18)
Requirement already satisfied: PyWavelets>=1.1.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (1.4.1)
Requirement already satisfied: packaging>=21 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (23.1)
Requirement already satisfied: lazy_loader>=0.2 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (0.3)
Requirement already satisfied: contourpy>=1.0.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (1.1.0)
Requirement already satisfied: cycler>=0.10 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (4.41.1)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (1.4.4)
Requirement already satisfied: pyparsing<3.1,>=2.3.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (3.0.9)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (2.8.2)
Collecting protobuf>=3.20.2 (from onnx->insightface==0.7.3)
Obtaining dependency information for protobuf>=3.20.2 from https://files.pythonhosted.org/packages/5e/46/5b9674a33cbf690ffdd79ab1863767a66461cd06ea7aeb9f90e4e50be7a5/protobuf-4.24.3-cp310-abi3-win_amd64.whl.metadata
Downloading protobuf-4.24.3-cp310-abi3-win_amd64.whl.metadata (540 bytes)
Requirement already satisfied: typing-extensions>=3.6.2.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from onnx->insightface==0.7.3) (4.7.1)
Requirement already satisfied: wcwidth in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from prettytable->insightface==0.7.3) (0.2.6)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from requests->insightface==0.7.3) (3.2.0)
Requirement already satisfied: idna<4,>=2.5 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from requests->insightface==0.7.3) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from requests->insightface==0.7.3) (1.26.16)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from requests->insightface==0.7.3) (2023.7.22)
Requirement already satisfied: joblib>=1.1.1 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-learn->insightface==0.7.3) (1.3.2)
Requirement already satisfied: threadpoolctl>=2.0.0 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from scikit-learn->insightface==0.7.3) (3.2.0)
Requirement already satisfied: colorama in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from tqdm->insightface==0.7.3) (0.4.6)
Requirement already satisfied: six>=1.5 in c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages (from python-dateutil>=2.7->matplotlib->insightface==0.7.3) (1.16.0)
Using cached albumentations-1.3.1-py3-none-any.whl (125 kB)
Using cached onnx-1.14.1-cp310-cp310-win_amd64.whl (13.3 MB)
Using cached prettytable-3.8.0-py3-none-any.whl (27 kB)
Using cached protobuf-4.24.3-cp310-abi3-win_amd64.whl (430 kB)
Building wheels for collected packages: insightface
Building wheel for insightface (pyproject.toml): started
Building wheel for insightface (pyproject.toml): finished with status 'error'
Failed to build insightface

stderr: WARNING: Ignoring invalid distribution -ediapipe (c:\users\admin\documents\stable diffusion\stable-diffusion-webui\venv\lib\site-packages)
error: subprocess-exited-with-error

Building wheel for insightface (pyproject.toml) did not run successfully.
exit code: 1

[214 lines of output]
WARNING: pandoc not enabled
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\insightface
copying insightface_init_.py -> build\lib.win-amd64-cpython-310\insightface
creating build\lib.win-amd64-cpython-310\insightface\app
copying insightface\app\common.py -> build\lib.win-amd64-cpython-310\insightface\app
copying insightface\app\face_analysis.py -> build\lib.win-amd64-cpython-310\insightface\app
copying insightface\app\mask_renderer.py -> build\lib.win-amd64-cpython-310\insightface\app
copying insightface\app_init_.py -> build\lib.win-amd64-cpython-310\insightface\app
creating build\lib.win-amd64-cpython-310\insightface\commands
copying insightface\commands\insightface_cli.py -> build\lib.win-amd64-cpython-310\insightface\commands
copying insightface\commands\model_download.py -> build\lib.win-amd64-cpython-310\insightface\commands
copying insightface\commands\rec_add_mask_param.py -> build\lib.win-amd64-cpython-310\insightface\commands
copying insightface\commands_init_.py -> build\lib.win-amd64-cpython-310\insightface\commands
creating build\lib.win-amd64-cpython-310\insightface\data
copying insightface\data\image.py -> build\lib.win-amd64-cpython-310\insightface\data
copying insightface\data\pickle_object.py -> build\lib.win-amd64-cpython-310\insightface\data
copying insightface\data\rec_builder.py -> build\lib.win-amd64-cpython-310\insightface\data
copying insightface\data_init_.py -> build\lib.win-amd64-cpython-310\insightface\data
creating build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\arcface_onnx.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\attribute.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\inswapper.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\landmark.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\model_store.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\model_zoo.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\retinaface.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo\scrfd.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
copying insightface\model_zoo_init_.py -> build\lib.win-amd64-cpython-310\insightface\model_zoo
creating build\lib.win-amd64-cpython-310\insightface\thirdparty
copying insightface\thirdparty_init_.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty
creating build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils\constant.py -> build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils\download.py -> build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils\face_align.py -> build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils\filesystem.py -> build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils\storage.py -> build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils\transform.py -> build\lib.win-amd64-cpython-310\insightface\utils
copying insightface\utils_init_.py -> build\lib.win-amd64-cpython-310\insightface\utils
creating build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d
copying insightface\thirdparty\face3d_init_.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d
creating build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh
copying insightface\thirdparty\face3d\mesh\io.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh copying insightface\thirdparty\face3d\mesh\light.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh
copying insightface\thirdparty\face3d\mesh\render.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh
copying insightface\thirdparty\face3d\mesh\transform.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh
copying insightface\thirdparty\face3d\mesh\vis.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh
copying insightface\thirdparty\face3d\mesh_init_.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh
creating build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
copying insightface\thirdparty\face3d\mesh_numpy\io.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
copying insightface\thirdparty\face3d\mesh_numpy\light.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
copying insightface\thirdparty\face3d\mesh_numpy\render.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
copying insightface\thirdparty\face3d\mesh_numpy\transform.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
copying insightface\thirdparty\face3d\mesh_numpy\vis.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
copying insightface\thirdparty\face3d\mesh_numpy_init_.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh_numpy
creating build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\morphable_model
copying insightface\thirdparty\face3d\morphable_model\fit.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\morphable_model
copying insightface\thirdparty\face3d\morphable_model\load.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\morphable_model
copying insightface\thirdparty\face3d\morphable_model\morphabel_model.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\morphable_model
copying insightface\thirdparty\face3d\morphable_model_init_.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\morphable_model
running egg_info
writing insightface.egg-info\PKG-INFO
writing dependency_links to insightface.egg-info\dependency_links.txt
writing entry points to insightface.egg-info\entry_points.txt
writing requirements to insightface.egg-info\requires.txt
writing top-level names to insightface.egg-info\top_level.txt
reading manifest file 'insightface.egg-info\SOURCES.txt'
writing manifest file 'insightface.egg-info\SOURCES.txt'
C:\Users\Admin\AppData\Local\Temp\pip-build-env-21vr7lym\overlay\Lib\site-packages\setuptools\command\build_py.py:204: _Warning: Package 'insightface.thirdparty.face3d.mesh.cython' is absent from the packages configuration.
!!

      ********************************************************************************
      ############################
      # Package would be ignored #
      ############################
      Python recognizes 'insightface.thirdparty.face3d.mesh.cython' as an importable package[^1],
      but it is absent from setuptools' `packages` configuration.

      This leads to an ambiguous overall configuration. If you want to distribute this
      package, please make sure that 'insightface.thirdparty.face3d.mesh.cython' is explicitly added
      to the `packages` configuration field.

      Alternatively, you can also rely on setuptools' discovery methods
      (for example by using `find_namespace_packages(...)`/`find_namespace:`
      instead of `find_packages(...)`/`find:`).

      You can read more about "package discovery" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

      If you don't want 'insightface.thirdparty.face3d.mesh.cython' to be distributed and are
      already explicitly excluding 'insightface.thirdparty.face3d.mesh.cython' via
      `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
      you can try to use `exclude_package_data`, or `include-package-data=False` in
      combination with a more fine grained `package-data` configuration.

      You can read more about "package data files" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


      [^1]: For Python, any directory (with suitable naming) can be imported,
            even if it does not contain any `.py` files.
            On the other hand, currently there is no concept of package data
            directory, all directories are treated like packages.
      ********************************************************************************

!!
check.warn(importable)
C:\Users\Admin\AppData\Local\Temp\pip-build-env-21vr7lym\overlay\Lib\site-packages\setuptools\command\build_py.py:204: _Warning: Package 'insightface.data.images' is absent from the packages configuration.
!!

      ********************************************************************************
      ############################
      # Package would be ignored #
      ############################
      Python recognizes 'insightface.data.images' as an importable package[^1],
      but it is absent from setuptools' `packages` configuration.

      This leads to an ambiguous overall configuration. If you want to distribute this
      package, please make sure that 'insightface.data.images' is explicitly added
      to the `packages` configuration field.

      Alternatively, you can also rely on setuptools' discovery methods
      (for example by using `find_namespace_packages(...)`/`find_namespace:`
      instead of `find_packages(...)`/`find:`).

      You can read more about "package discovery" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

      If you don't want 'insightface.data.images' to be distributed and are
      already explicitly excluding 'insightface.data.images' via
      `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
      you can try to use `exclude_package_data`, or `include-package-data=False` in
      combination with a more fine grained `package-data` configuration.

      You can read more about "package data files" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


      [^1]: For Python, any directory (with suitable naming) can be imported,
            even if it does not contain any `.py` files.
            On the other hand, currently there is no concept of package data
            directory, all directories are treated like packages.
      ********************************************************************************

!!
check.warn(importable)
C:\Users\Admin\AppData\Local\Temp\pip-build-env-21vr7lym\overlay\Lib\site-packages\setuptools\command\build_py.py:204: _Warning: Package 'insightface.data.objects' is absent from the packages configuration.
!!

      ********************************************************************************
      ############################
      # Package would be ignored #
      ############################
      Python recognizes 'insightface.data.objects' as an importable package[^1],
      but it is absent from setuptools' `packages` configuration.

      This leads to an ambiguous overall configuration. If you want to distribute this
      package, please make sure that 'insightface.data.objects' is explicitly added
      to the `packages` configuration field.

      Alternatively, you can also rely on setuptools' discovery methods
      (for example by using `find_namespace_packages(...)`/`find_namespace:`
      instead of `find_packages(...)`/`find:`).

      You can read more about "package discovery" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

      If you don't want 'insightface.data.objects' to be distributed and are
      already explicitly excluding 'insightface.data.objects' via
      `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
      you can try to use `exclude_package_data`, or `include-package-data=False` in
      combination with a more fine grained `package-data` configuration.

      You can read more about "package data files" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


      [^1]: For Python, any directory (with suitable naming) can be imported,
            even if it does not contain any `.py` files.
            On the other hand, currently there is no concept of package data
            directory, all directories are treated like packages.
      ********************************************************************************

!!
check.warn(importable)
creating build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
copying insightface\thirdparty\face3d\mesh\cython\mesh_core.cpp -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
copying insightface\thirdparty\face3d\mesh\cython\mesh_core.h -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
copying insightface\thirdparty\face3d\mesh\cython\mesh_core_cython.cpp -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
creating build\lib.win-amd64-cpython-310\insightface\data\images
copying insightface\data\images\Tom_Hanks_54745.png -> build\lib.win-amd64-cpython-310\insightface\data\images
copying insightface\data\images\mask_black.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
copying insightface\data\images\mask_blue.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
copying insightface\data\images\mask_green.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
copying insightface\data\images\mask_white.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
copying insightface\data\images\t1.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
creating build\lib.win-amd64-cpython-310\insightface\data\objects
copying insightface\data\objects\meanshape_68.pkl -> build\lib.win-amd64-cpython-310\insightface\data\objects
copying insightface\thirdparty\face3d\mesh\cython\mesh_core_cython.c -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
copying insightface\thirdparty\face3d\mesh\cython\mesh_core_cython.pyx -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
copying insightface\thirdparty\face3d\mesh\cython\setup.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
running build_ext
building 'insightface.thirdparty.face3d.mesh.cython.mesh_core_cython' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for insightface
ERROR: Could not build wheels for insightface, which is required to install pyproject.toml-based projects

You can try to install dependencies manually by activating venv and installing requirements.txt or requirements-gpu.txt
Launching Web UI with arguments: --xformers
[-] ADetailer initialized. version: 23.9.2, num models: 9
2023-09-10 23:55:42,441 - ControlNet - INFO - ControlNet v1.1.409
ControlNet preprocessor location: C:\Users\Admin\Documents\Stable diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-09-10 23:55:42,503 - ControlNet - INFO - ControlNet v1.1.409
*** Error loading script: faceswaplab.py
Traceback (most recent call last):
File "C:\Users\Admin\Documents\Stable diffusion\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "C:\Users\Admin\Documents\Stable diffusion\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "C:\Users\Admin\Documents\Stable diffusion\stable-diffusion-webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab.py", line 10, in
from scripts.faceswaplab_api import faceswaplab_api
File "C:\Users\Admin\Documents\Stable diffusion\stable-diffusion-webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_api\faceswaplab_api.py", line 12, in
from scripts.faceswaplab_swapping import swapper
File "C:\Users\Admin\Documents\Stable diffusion\stable-diffusion-webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_swapping\swapper.py", line 14, in
import insightface
ModuleNotFoundError: No module named 'insightface'

Thanks

Non target faces altered anyway

Faces that are NOT the target image are still being altered. Checked with img2img and inpaint on latest branch A1111/faceswaplab.

The target face is being changed and this feature works as intended. But there are people in the background and around the scene, there images are not changed like the target image but some small changes happen to them. Its especially obvious in my case because theyre in a depth of field area, not sharp and after faceswap there are small parts around or on them that are being sharpened, though it's NOT a non-intended faceswap.

I tried to circumvent the problem by going to inpainting and masking the face that should be swapped only, but as I expected, this is overriden and the result is the same.

Loading of swapping model failed on MAC M2

Hi, I'm getting this problem when trying to run on a Mac with M2

`preload_extensions_git_metadata for 11 extensions took 0.46s
100%|██████████████████████████████████████████████████████| 45/45 [00:31<00:00,  1.42it/s]
2023-08-01 16:22:15,075 - FaceSwapLab - INFO - Try to use model : /Users/juanmesa/Documents/stable-diffusion-webui/models/faceswaplab/inswapper_128.onnx
2023-08-01 16:22:15,851 - FaceSwapLab - INFO - blend all faces together
2023-08-01 16:22:15,852 - FaceSwapLab - INFO - Load analysis model, will take some time.
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: /Users/juanmesa/Documents/stable-diffusion-webui/models/faceswaplab/analysers/models/buffalo_l/1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: /Users/juanmesa/Documents/stable-diffusion-webui/models/faceswaplab/analysers/models/buffalo_l/2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: /Users/juanmesa/Documents/stable-diffusion-webui/models/faceswaplab/analysers/models/buffalo_l/det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: /Users/juanmesa/Documents/stable-diffusion-webui/models/faceswaplab/analysers/models/buffalo_l/genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: /Users/juanmesa/Documents/stable-diffusion-webui/models/faceswaplab/analysers/models/buffalo_l/w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5
set det-size: (640, 640)
/Users/juanmesa/Documents/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/utils/transform.py:68: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.
  P = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4
set det-size: (640, 640)
set det-size: (640, 640)
set det-size: (640, 640)
2023-08-01 16:22:51,751 - FaceSwapLab - INFO - Process face 0
2023-08-01 16:22:51,752 - FaceSwapLab - INFO - Source Gender 0
2023-08-01 16:22:51,859 - 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.)
2023-08-01 16:22:51,859 - FaceSwapLab - ERROR - Conversion failed Loading of swapping model failed
2023-08-01 16:22:51,860 - FaceSwapLab - ERROR - Failed to swap face in postprocess method : Loading of swapping model failed
Total progress: 100%|██████████████████████████████████████| 45/45 [01:09<00:00,  1.55s/it]
Total progress: 100%|██████████████████████████████████████| 45/45 [01:09<00:00,  1.53it/s]`

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.

Getting this error on automatic webui on colab

Describe the bug
I get this error on webui on colab and it doesn't work:

85% 17/20 [00:05<00:00, 3.98it/s]
90% 18/20 [00:06<00:00, 4.11it/s]
95% 19/20 [00:06<00:00, 3.96it/s]
100% 20/20 [00:06<00:00, 3.01it/s]
2023-08-06 08:47:15,216 - FaceSwapLab - INFO - Try to use model : /content/sdw/models/faceswaplab/inswapper_128.onnx
2023-08-06 08:47:15,272 - FaceSwapLab - INFO - Load analysis model, will take some time. (> 30s)
Loading analysis model (first time is slow): 100% 1/1 [00:08<00:00, 8.49s/model]
2023-08-06 08:47:23,760 - FaceSwapLab - INFO - ("Applied providers: ['CPUExecutionProvider'], with options: "
"{'CPUExecutionProvider': {}}\n"
'find model: '
'/content/sdw/models/faceswaplab/analysers/models/buffalo_l/1k3d68.onnx '
"landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0\n"
"Applied providers: ['CPUExecutionProvider'], with options: "
"{'CPUExecutionProvider': {}}\n"
'find model: '
'/content/sdw/models/faceswaplab/analysers/models/buffalo_l/2d106det.onnx '
"landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0\n"
"Applied providers: ['CPUExecutionProvider'], with options: "
"{'CPUExecutionProvider': {}}\n"
'find model: '
'/content/sdw/models/faceswaplab/analysers/models/buffalo_l/det_10g.onnx '
"detection [1, 3, '?', '?'] 127.5 128.0\n"
"Applied providers: ['CPUExecutionProvider'], with options: "
"{'CPUExecutionProvider': {}}\n"
'find model: '
'/content/sdw/models/faceswaplab/analysers/models/buffalo_l/genderage.onnx '
"genderage ['None', 3, 96, 96] 0.0 1.0\n"
"Applied providers: ['CPUExecutionProvider'], with options: "
"{'CPUExecutionProvider': {}}\n"
'find model: '
'/content/sdw/models/faceswaplab/analysers/models/buffalo_l/w600k_r50.onnx '
"recognition ['None', 3, 112, 112] 127.5 127.5\n")
2023-08-06 08:47:23,761 - FaceSwapLab - ERROR - Failed to swap face in postprocess method : This ORT build has ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'], ...)
Traceback (most recent call last):
File "/content/sdw/extensions/sd-webui-faceswaplab/scripts/faceswaplab.py", line 178, in postprocess
swapped_images = swapper.process_images_units(
File "/content/sdw/extensions/sd-webui-faceswaplab/scripts/faceswaplab_swapping/swapper.py", line 777, in process_images_units
swapped = process_image_unit(model, units[0], image, info, force_blend)
File "/content/sdw/extensions/sd-webui-faceswaplab/scripts/faceswaplab_swapping/swapper.py", line 650, in process_image_unit
faces = get_faces(pil_to_cv2(image))
File "/content/sdw/extensions/sd-webui-faceswaplab/scripts/faceswaplab_swapping/swapper.py", line 372, in get_faces
face_analyser = copy.deepcopy(getAnalysisModel())
File "/usr/lib/python3.10/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/lib/python3.10/copy.py", line 271, in _reconstruct
state = deepcopy(state, memo)
File "/usr/lib/python3.10/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.10/copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.10/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.10/copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.10/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/lib/python3.10/copy.py", line 271, in _reconstruct
state = deepcopy(state, memo)
File "/usr/lib/python3.10/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.10/copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.10/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/lib/python3.10/copy.py", line 273, in _reconstruct
y.setstate(state)
File "/usr/local/lib/python3.10/dist-packages/insightface/model_zoo/model_zoo.py", line 33, in setstate
self.init(model_path)
File "/usr/local/lib/python3.10/dist-packages/insightface/model_zoo/model_zoo.py", line 25, in init
super().init(model_path, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 347, in init
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "/usr/local/lib/python3.10/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 375, in _create_inference_session
raise ValueError(
ValueError: This ORT build has ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'], ...)

Desktop (please complete the following information):

  • google colab free tier Nvidia Tesla T4

Similairty checker no longer seems to run in IMG2IMG

Please remember that the bug report section is not a forum. Before submitting a bug, ensure you have read the FAQ thoroughly. This helps us maintain an efficient bug-tracking process. Thank you for your understanding and cooperation. Use the discussion section for anything else.

Describe the bug
Check and Compute Similarity don't seem to run in the IMg2imgs tab

To Reproduce
enable check similarity, check both compute and check similarity.
2. Adjust slider to to some min of percentages to match image

Expected behavior
In terminal window you should see something like
2023-09-10 07:42:29,924 - FaceSwapLab - INFO - compare face 0
2023-09-10 07:42:29,924 - FaceSwapLab - INFO - similarity {0: 0.7829361}
2023-09-10 07:42:29,924 - FaceSwapLab - INFO - ref similarity {0: 0.7829361}
2023-09-10 07:42:29,924 - FaceSwapLab - INFO - Finished processing image, return 1 images

However while you will get this in txt2img it does not seem to run compare in img2img

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

In version 1.6.0 of sdwebui, a new startup method has been introduced where the default behavior is to automatically open the browser. If you wish to prevent this, you need to add the `--disable-auto-autolaunch` parameter. However, due to the addition of the `--disable-auto-autolaunch` parameter in this plugin, the plugin will encounter startup errors.

Please remember that the bug report section is not a forum. Before submitting a bug, ensure you have read the FAQ thoroughly. This helps us maintain an efficient bug tracking process. Thank you for your understanding and cooperation. Use the discussion section for anything else.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
venv "D:\AI\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Faceswaplab : Use GPU requirements
Checking faceswaplab requirements
0.004919400002108887
Launching Web UI with arguments: --disable-auto-autolaunch --xformers --no-half-vae
usage: launch.py [-h] [--update-all-extensions] [--skip-python-version-check] [--skip-torch-cuda-test]
[--reinstall-xformers] [--reinstall-torch] [--update-check] [--test-server] [--log-startup]
[--skip-prepare-environment] [--skip-install] [--dump-sysinfo] [--loglevel LOGLEVEL]
[--do-not-download-clip] [--data-dir DATA_DIR] [--config CONFIG] [--ckpt CKPT] [--ckpt-dir CKPT_DIR]
[--vae-dir VAE_DIR] [--gfpgan-dir GFPGAN_DIR] [--gfpgan-model GFPGAN_MODEL] [--no-half]
[--no-half-vae] [--no-progressbar-hiding] [--max-batch-count MAX_BATCH_COUNT]
[--embeddings-dir EMBEDDINGS_DIR] [--textual-inversion-templates-dir TEXTUAL_INVERSION_TEMPLATES_DIR]
[--hypernetwork-dir HYPERNETWORK_DIR] [--localizations-dir LOCALIZATIONS_DIR] [--allow-code]
[--medvram] [--medvram-sdxl] [--lowvram] [--lowram] [--always-batch-cond-uncond] [--unload-gfpgan]
[--precision {full,autocast}] [--upcast-sampling] [--share] [--ngrok NGROK]
[--ngrok-region NGROK_REGION] [--ngrok-options NGROK_OPTIONS] [--enable-insecure-extension-access]
[--codeformer-models-path CODEFORMER_MODELS_PATH] [--gfpgan-models-path GFPGAN_MODELS_PATH]
[--esrgan-models-path ESRGAN_MODELS_PATH] [--bsrgan-models-path BSRGAN_MODELS_PATH]
[--realesrgan-models-path REALESRGAN_MODELS_PATH] [--clip-models-path CLIP_MODELS_PATH] [--xformers]
[--force-enable-xformers] [--xformers-flash-attention] [--deepdanbooru] [--opt-split-attention]
[--opt-sub-quad-attention] [--sub-quad-q-chunk-size SUB_QUAD_Q_CHUNK_SIZE]
[--sub-quad-kv-chunk-size SUB_QUAD_KV_CHUNK_SIZE]
[--sub-quad-chunk-threshold SUB_QUAD_CHUNK_THRESHOLD] [--opt-split-attention-invokeai]
[--opt-split-attention-v1] [--opt-sdp-attention] [--opt-sdp-no-mem-attention]
[--disable-opt-split-attention] [--disable-nan-check] [--use-cpu USE_CPU [USE_CPU ...]]
[--disable-model-loading-ram-optimization] [--listen] [--port PORT] [--show-negative-prompt]
[--ui-config-file UI_CONFIG_FILE] [--hide-ui-dir-config] [--freeze-settings]
[--ui-settings-file UI_SETTINGS_FILE] [--gradio-debug] [--gradio-auth GRADIO_AUTH]
[--gradio-auth-path GRADIO_AUTH_PATH] [--gradio-img2img-tool GRADIO_IMG2IMG_TOOL]
[--gradio-inpaint-tool GRADIO_INPAINT_TOOL] [--gradio-allowed-path GRADIO_ALLOWED_PATH]
[--opt-channelslast] [--styles-file STYLES_FILE] [--autolaunch] [--theme THEME] [--use-textbox-seed]
[--disable-console-progressbars] [--enable-console-prompts] [--vae-path VAE_PATH]
[--disable-safe-unpickle] [--api] [--api-auth API_AUTH] [--api-log] [--nowebui] [--ui-debug-mode]
[--device-id DEVICE_ID] [--administrator] [--cors-allow-origins CORS_ALLOW_ORIGINS]
[--cors-allow-origins-regex CORS_ALLOW_ORIGINS_REGEX] [--tls-keyfile TLS_KEYFILE]
[--tls-certfile TLS_CERTFILE] [--disable-tls-verify] [--server-name SERVER_NAME] [--gradio-queue]
[--no-gradio-queue] [--skip-version-check] [--no-hashing] [--no-download-sd-model]
[--subpath SUBPATH] [--add-stop-route] [--api-server-stop] [--timeout-keep-alive TIMEOUT_KEEP_ALIVE]
[--disable-all-extensions] [--disable-extra-extensions] [--ad-no-huggingface]
[--controlnet-dir CONTROLNET_DIR]
[--controlnet-annotator-models-path CONTROLNET_ANNOTATOR_MODELS_PATH] [--no-half-controlnet]
[--controlnet-preprocessor-cache-size CONTROLNET_PREPROCESSOR_CACHE_SIZE]
[--controlnet-loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
[--faceswaplab_loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--disable-openpose-editor-auto-update]
[--ldsr-models-path LDSR_MODELS_PATH] [--lora-dir LORA_DIR]
[--lyco-dir-backcompat LYCO_DIR_BACKCOMPAT] [--scunet-models-path SCUNET_MODELS_PATH]
[--swinir-models-path SWINIR_MODELS_PATH]
launch.py: error: unrecognized arguments: --disable-auto-autolaunch
请按任意键继续. . .

Desktop (please complete the following information):

  • OS: win11
  • Browser [e.g. chrome, safari] edge
  • Version [e.g. 22] v1.2.5

Additional context
Add any other context about the problem here.

Error installing extension on Colab

Tried many times reinstall it but still doesn't work. Also have to update the inswapper_128.onnx link because this https://huggingface.co/deepinsight-unofficial/inswapper is no longer accessible. I'm using https://github.com/TheLastBen/fast-stable-diffusion
Thanks 🙏

*** Error running install.py for extension /content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-faceswaplab
*** Command: "/usr/bin/python3" "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-faceswaplab/install.py"
*** Error code: 1
*** stderr: *** Error verifying pickled file from /content/gdrive/MyDrive/sd/stable-diffusion-webui/cache/hub/checkpoints/checkpoint_liberty_with_aug.pth
*** *** The file may be malicious, so the program is not going to read it.
*** *** You can skip this check with --disable-safe-unpickle commandline argument.
*** Traceback (most recent call last):
*** File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/safe.py", line 136, in load_with_extra
*** if not shared.cmd_opts.disable_safe_unpickle:
*** AttributeError: partially initialized module 'modules.shared' has no attribute 'cmd_opts' (most likely due to a circular import)
*** ---
*** Traceback (most recent call last):
*** File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-faceswaplab/install.py", line 5, in
*** from modules import shared
*** File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/shared.py", line 15, in
*** import modules.interrogate
*** File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/interrogate.py", line 13, in
*** from modules import devices, paths, shared, lowvram, modelloader, errors
*** File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/paths.py", line 61, in
*** import sgm # noqa: F401
*** File "/content/gdrive/MyDrive/sd/stablediffusion/generative-models/sgm/init.py", line 2, in
*** from .models import AutoencodingEngine, DiffusionEngine
*** File "/content/gdrive/MyDrive/sd/stablediffusion/generative-models/sgm/models/init.py", line 1, in
*** from .autoencoder import AutoencodingEngine
*** File "/content/gdrive/MyDrive/sd/stablediffusion/generative-models/sgm/models/autoencoder.py", line 12, in
*** from ..modules.diffusionmodules.model import Decoder, Encoder
*** File "/content/gdrive/MyDrive/sd/stablediffusion/generative-models/sgm/modules/init.py", line 1, in
*** from .encoders.modules import GeneralConditioner
*** File "/content/gdrive/MyDrive/sd/stablediffusion/generative-models/sgm/modules/encoders/modules.py", line 5, in
*** import kornia
*** File "/usr/local/lib/python3.10/dist-packages/kornia/init.py", line 10, in
*** from . import (
*** File "/usr/local/lib/python3.10/dist-packages/kornia/augmentation/init.py", line 43, in
*** from .container import AugmentationSequential, ImageSequential, PatchSequential, VideoSequential
*** File "/usr/local/lib/python3.10/dist-packages/kornia/augmentation/container/init.py", line 1, in
*** from .augment import AugmentationSequential
*** File "/usr/local/lib/python3.10/dist-packages/kornia/augmentation/container/augment.py", line 17, in
*** from .patch import PatchSequential
*** File "/usr/local/lib/python3.10/dist-packages/kornia/augmentation/container/patch.py", line 9, in
*** from kornia.contrib.extract_patches import extract_tensor_patches
*** File "/usr/local/lib/python3.10/dist-packages/kornia/contrib/init.py", line 4, in
*** from .image_stitching import ImageStitcher
*** File "/usr/local/lib/python3.10/dist-packages/kornia/contrib/image_stitching.py", line 7, in
*** from kornia.feature import LocalFeatureMatcher, LoFTR
*** File "/usr/local/lib/python3.10/dist-packages/kornia/feature/init.py", line 4, in
*** from .integrated import (
*** File "/usr/local/lib/python3.10/dist-packages/kornia/feature/integrated.py", line 52, in
*** class LAFDescriptor(nn.Module):
*** File "/usr/local/lib/python3.10/dist-packages/kornia/feature/integrated.py", line 65, in LAFDescriptor
*** patch_descriptor_module: nn.Module = HardNet(True),
*** File "/usr/local/lib/python3.10/dist-packages/kornia/feature/hardnet.py", line 69, in init
*** self.load_state_dict(pretrained_dict['state_dict'], strict=True)
*** TypeError: 'NoneType' object is not subscriptable

Install Errors

Describe the bug
Traceback Errors during install

To Reproduce
Steps to reproduce the behavior:

  1. Install from extensions tab

Expected behavior
Successful install

Desktop (please complete the following information):

  • OS: Win 11
  • Browser Firefox 117.0b1

Additional context
*** Error running install.py for extension C:\AI\stable-diffusion-webui\extensions\sd-webui-faceswaplab.
*** Command: "C:\AI\stable-diffusion-webui\venv\Scripts\python.exe" "C:\AI\stable-diffusion-webui\extensions\sd-webui-faceswaplab\install.py"
*** Error code: 1
*** stdout: Checking faceswaplab requirements
*** Install opencv-python==4.7.0.72
*** Installing sd-webui-faceswaplab requirement: opencv-python==4.7.0.72
*** Install pydantic==1.10.9, 1.10.8 vs 1.10.9
*** Installing sd-webui-faceswaplab requirement: changing pydantic version from 1.10.8 to 1.10.9
*** Couldn't install sd-webui-faceswaplab requirement: changing pydantic version from 1.10.8 to 1.10.9.
*** Command: "C:\AI\stable-diffusion-webui\venv\Scripts\python.exe" -m pip install pydantic==1.10.9 --prefer-binary
*** Error code: 1
*** stdout: Collecting pydantic==1.10.9
*** Using cached pydantic-1.10.9-cp310-cp310-win_amd64.whl (2.1 MB)
*** Requirement already satisfied: typing-extensions>=4.2.0 in c:\ai\stable-diffusion-webui\venv\lib\site-packages (from pydantic==1.10.9) (4.6.2)
*** Installing collected packages: pydantic
*** Attempting uninstall: pydantic
*** Found existing installation: pydantic 1.10.8
*** Uninstalling pydantic-1.10.8:
*** Successfully uninstalled pydantic-1.10.8


*** stderr: WARNING: Ignoring invalid distribution -rotobuf (c:\ai\stable-diffusion-webui\venv\lib\site-packages)
*** WARNING: Ignoring invalid distribution -rotobuf (c:\ai\stable-diffusion-webui\venv\lib\site-packages)
*** ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\AI\stable-diffusion-webui\venv\Lib\site-packages\~ydantic\annotated_types.cp310-win_amd64.pyd'
*** Check the permissions.



*** [notice] A new release of pip is available: 23.1.2 -> 23.2.1
*** [notice] To update, run: C:\AI\stable-diffusion-webui\venv\Scripts\python.exe -m pip install --upgrade pip


*** Warning: Failed to install pydantic==1.10.9, faceswaplab will not work.


*** stderr:
*** Downloading: 0%| | 0.00/529M [00:00<?, ?B/s]
*** Downloading: 0%| | 8.00k/529M [00:00<5:14:09, 29.4kB/s]
--snip--
*** Downloading: 100%|#########9| 528M/529M [02:09<00:00, 4.56MB/s]
*** Downloading: 529MB [02:09, 4.29MB/s]
*** Traceback (most recent call last):
*** File "C:\AI\stable-diffusion-webui\extensions\sd-webui-faceswaplab\install.py", line 66, in
*** raise e
*** File "C:\AI\stable-diffusion-webui\extensions\sd-webui-faceswaplab\install.py", line 58, in
*** launch.run_pip(
*** File "C:\AI\stable-diffusion-webui\modules\launch_utils.py", line 136, in run_pip
*** return run(f'"{python}" -m pip {command} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live)
*** File "C:\AI\stable-diffusion-webui\modules\launch_utils.py", line 113, in run
*** raise RuntimeError("\n".join(error_bits))
*** RuntimeError: Couldn't install sd-webui-faceswaplab requirement: changing pydantic version from 1.10.8 to 1.10.9.
*** Command: "C:\AI\stable-diffusion-webui\venv\Scripts\python.exe" -m pip install pydantic==1.10.9 --prefer-binary
*** Error code: 1
*** stdout: Collecting pydantic==1.10.9
*** Using cached pydantic-1.10.9-cp310-cp310-win_amd64.whl (2.1 MB)
*** Requirement already satisfied: typing-extensions>=4.2.0 in c:\ai\stable-diffusion-webui\venv\lib\site-packages (from pydantic==1.10.9) (4.6.2)
*** Installing collected packages: pydantic
*** Attempting uninstall: pydantic
*** Found existing installation: pydantic 1.10.8
*** Uninstalling pydantic-1.10.8:
*** Successfully uninstalled pydantic-1.10.8


*** stderr: WARNING: Ignoring invalid distribution -rotobuf (c:\ai\stable-diffusion-webui\venv\lib\site-packages)
*** WARNING: Ignoring invalid distribution -rotobuf (c:\ai\stable-diffusion-webui\venv\lib\site-packages)
*** ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\AI\stable-diffusion-webui\venv\Lib\site-packages\~ydantic\annotated_types.cp310-win_amd64.pyd'
*** Check the permissions.


"base64 safetensors" how post via api?

I have trouble with base64 safetensors what i get from api, its look like "data:application/face;base64," how do i send it in post?
i send it to /faceswaplab/swap_face in "source_face": "data:application/face;base64...", but has error in automatic1111 , with reference photo all work fine with only model not, sorry for stupid quastion, I am hope for your help

`API error: POST: http://127.0.0.1:7860/faceswaplab/swap_face {'error': 'Error', 'detail': '', 'body': '', 'errors': 'Incorrect padding'}
Traceback (most recent call last):
File "D:\SD_port\venv\lib\site-packages\anyio\streams\memory.py", line 94, in receive
return self.receive_nowait()
File "D:\SD_port\venv\lib\site-packages\anyio\streams\memory.py", line 89, in receive_nowait
raise WouldBlock
anyio.WouldBlock

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\base.py", line 78, in call_next
    message = await recv_stream.receive()
  File "D:\SD_port\venv\lib\site-packages\anyio\streams\memory.py", line 114, in receive
    raise EndOfStream
anyio.EndOfStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\SD_port\modules\api\api.py", line 152, in exception_handling
    return await call_next(request)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\base.py", line 84, in call_next
    raise app_exc
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\base.py", line 70, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\base.py", line 108, in __call__
    response = await self.dispatch_func(request, call_next)
  File "D:\SD_port\modules\api\api.py", line 116, in log_and_time
    res: Response = await call_next(req)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\base.py", line 84, in call_next
    raise app_exc
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\base.py", line 70, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\cors.py", line 92, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\cors.py", line 147, in simple_response
    await self.app(scope, receive, send)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "D:\SD_port\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__
    raise e
  File "D:\SD_port\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "D:\SD_port\venv\lib\site-packages\starlette\routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "D:\SD_port\venv\lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "D:\SD_port\venv\lib\site-packages\starlette\routing.py", line 66, in app
    response = await func(request)
  File "D:\SD_port\venv\lib\site-packages\fastapi\routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "D:\SD_port\venv\lib\site-packages\fastapi\routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "D:\SD_port\extensions\sd-webui-faceswaplab\scripts\faceswaplab_api\faceswaplab_api.py", line 93, in swap_face
    src_image: Optional[Image.Image] = base64_to_pil(request.image)
  File "D:\SD_port\extensions\sd-webui-faceswaplab\scripts\faceswaplab_utils\imgutils.py", line 287, in base64_to_pil
    img_bytes = base64.b64decode(base64str)
  File "D:\SD_port\python\lib\base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding`

data:application/face;base64 my string from api

data:application/face;base64,uAAAAAAAAAB7ImFnZSI6eyJkdHlwZSI6Ikk2NCIsInNoYXBlIjpbXSwiZGF0YV9vZmZzZXRzIjpbMCw4XX0sImdlbmRlciI6eyJkdHlwZSI6Ikk2NCIsInNoYXBlIjpbXSwiZGF0YV9vZmZzZXRzIjpbOCwxNl19LCJlbWJlZGRpbmciOnsiZHR5cGUiOiJGMzIiLCJzaGFwZSI6WzUxMl0sImRhdGFfb2Zmc2V0cyI6WzE2LDIwNjRdfX0gICAgGQAAAAAAAAAAAAAAAAAAAAj7v75fGxa/etcGPjqG0L7mwZu91q5hP6efCT8yLB6/NXujP8FGiD9Xrze/e6rVP7pF5b4G5CK/UH0iv+Mm+L5Vxiq/Pt2Vv0Zcqr2S4gM+xXJAvhHqbz8vBNG+hsnJv9lAPz/3Il++mdj5v12kIb4ij7g/gl+FP9Ja2b/uZTq9YYDFPmu6yrygiaG+79EHP0nAwrx5lPu+29KMP7eyyT6y+vG/Z9+cPpnGCL9fChNAZ0MCvudtXj4xdNU+24hnP2LUcL/FWjK+r3jfPzkp9T519BI/Qxu9vuFEsL/Q26o+P1sMvwYfg70RJV4/jaqmPieIu78fJkM+NauvPlrpEb+LKcu+sILDv6+UED8j7cE9+TIAPhemvr8y4WI+lW5wP4dUAz9VZeK9OzwcPfM2HD+3r1i/kK8Tv8Ul3j6/IMI+soxMP07cQ7/Jwe8/tUtjv0mUvj7eotu+nrhWv3kemD9AZlC/qaLlPn6ARz1P9ni/IaAhvsJj7j+yU9E/1TPNPrl5jr+iZC+/pqKJPtPtAL6Nbmw/dbiWvnDswj+5xi0/kxdcP+mq2T0IV7q+yx18v1i5dj7eubO+QROHP9HXEL/Sxe+/OdZGv8s+pr4AjAO8Q1MQP+M6JL8QvKi7MyWEv/jOcj71/sI/qXqNv1INUj9Dja0+mmncvvUlB8BrdVY9hetdP4jBUT4x5zI+IvYtvprMaj2wYHk/QDtsP81vUj+KD6c+GyiMP6yygL8Cc2g/idyPv7hLP76tmYA+L3a2vyaJlr/pL28/x37bv3Lx/j4wdBc/69XQPrLh5r5ZdSq/t0cJP6CK5r5dZJQ/QOnTv7Ni8b5a5Bq+F394vkZtY79luUy/4AkYPzI+hz4W57Y+U0aiv9WbuD3yQO8+Gi4wvZH3773LZq2+opjAPxEv1b85sxO/++l0v24z3byZtAm+17civ8Zggr+athy/EY4CPR48iL//mXg/AaJtPyINHj/BVaI/V0TAvSGufj8QCbu+gKELv6mGg78+Zby+hqlav4gpmr7GkyI/8ac0PxXgCT9Fw7G/lRSgPzlPy78Oljy/geGwvjbuhL25H9K/28JJP+eWSj/Dff4/6+VrP/DJDD28ToG+WznnP5IeZj8z2qu9TYniP12brz/P+42+hWaMPytN+78KpFS/hoM7Pk8Jgj8ypJs8YgzaPr2bqz8NpA+/f2Ocv7Wcej/I47A+qAR6v0liwj+XZ3e/ScujvnAQ/j44q4a+qLIKP1eraL/79WK/VUWEvuspL77HtnQ+OioJvnLc8j5LIJk/Sw5ePx0Wkz/mVBfAmC4xvz8Fsr+B9w0/3Qw7vospyL/L/bC/J7wtP+7mYr8SXx2+juQsv3o3Xr/KOjM/232zvXUpIb7XOQ2/fheoPhBe7z6u78g+JXJyPNGDnD6r2l8+zTq5PskpVj6NBdI/65wQPxfVCT0beLG/VpyOPlluT79/AH6+/RYNP02nHb33PiC/nkxhv/kT975lvCM/32DDv8fXnj+m0gS/IGl4P0rQVr8/nyY/8FRePphtLT4ysvq9xbM7vXUEm76y43S/0VkWv7fBwLmPoGs/mc3Qv9H/db8CASE/rmbDPhBy3T7F5AC/Gj3AvuM0iD2pXRS/8QWJvxKxeD/6+xw/4NZ9v/BzLj/XP5Q+dyK5v7CrTb2aaAA/V0HzPsAzrj9gsCg9FVoav97pGj83n/0/iaQjP0VGQr/QOxq/0qPYvkpjqD6x5HY/hWg8PnYhVD15jBe+OhYjPkl9br8OQja/tcwXvuHL2r+YvTa+f1s+P3iGZD8W6cG+xz5gvwlP/r57sJu++vqXv9P+Br960Bm/dSDMvtkbkz5Fxls/Vw6yvFbwtD6VZKI+QsmdPqZDzjwOmas98qG2vmKzS79yttw+uRjCPWn+3L4mPIQ//ZWRP2outj6gC5Y/W35aPuAe5j1HwoA/p4QqvjhxeT5IaLK+8ENcv8ppPL9ZOzs/dQZtP1b8Db9eb1M+33+0vxNbST/2O98/gzTEv3cDIb+ye0M+Lgy8vkqHHT4Judu/Cc74Pt74PD+KFpc+MSbiP50ao75D6uU9smyxPhYsjz5zNom+mc7GPwBplb9RC6+9XUHVP0aLEz8/hug+y0/KvVdKkT/Bf7y9RX4nP/JdcT+3h4O/NxYwP7K/q76mTeQ+Hqsgv8JOvD81Gs4+cNtzP7r72T3HRDs/aNTYPquuJD8BI3k/jjoxvo5ubz+7PaG9z/lfvlvmlL22YE2/diaKPNvUL74wrRM+Yw5LPqt7d7+I68K/HwhOP6nlVb6j38G/pR95P972FL/7Ry8+ggOLP6sNED8XctQ9ZXcswAJ5mb8RXfs/GsDwP2sMAj8yrH++03MKv/BuJ76qHUM/I8MMvw/UOr9rd7e/hYtoP+UaaT+VVmi/mGqgP4AC0jwCdoi9i1LwP4Yz1j5VccU/shTuPpKX1j8X7yK/hWfGvn2bCr/Q0Cq/b8GmPaXPEL+eef08D2Vrv2F2B8CNmHw/hRaKPq7OXb84c3C+idkvvCbz0b61/ne/Jjy+vUErFr0DkKi/Aka+PQ8gkb7vNSA/kyXIPidNyjyYspG+kXasP4GvNz843my+vRD+voVLhT8Pe4m/WgKYvsd3Rz87KAzAYii6va5u7z4ZhHG/sgVfv8nVu77qEwk/ZjImP0BzVr+PCyi+m7p6v/BWQL5ObIW+xZJvPtHnjD9Jv4u/IRK8PlbL6D42+QO/

Exstension install failed while WebUI lanuch.

Describe the bug
Exstension install failed while WebUI lanuch.

To Reproduce
WebUI restart.

Expected behavior
Normal lanuch.

Screenshots

*** Error running install.py for extension webui\extensions\sd-webui-faceswaplab.
*** Installing sd-webui-faceswaplab requirement: ifnude
***
*** stderr: A matching Triton is not available, some optimizations will not be enabled.
*** Error caught was: No module named 'triton'
webui\venv\Lib\site-packages\pytorch_lightning\utilities\distributed.py:258: LightningDeprecationWarning: `pytorch_lightning.utilities.distributed.rank_zero_only` has been deprecated in v1.8.1 and will be removed in v2.0.0. You can import it from `pytorch_lightning.utilities` instead.

*** During handling of the above exception, another exception occurred:
***
*** +--------------------- Traceback (most recent call last) ---------------------+
*** | webui\extensions\sd-webui-faceswaplab\install.py:65 in <module>       |
*** |                                                                             |
*** |   62                 raise e                                                |
*** |   63                                                                        |
*** |   64                                                                        |
*** | > 65 check_install()                                                        |
*** |   66                                                                        |
*** |                                                                             |
*** | webui\extensions\sd-webui-faceswaplab\install.py:58 in check_install  |
*** |                                                                             |
*** |   55                     )                                                  |
*** |   56                                                                        |
*** |   57             except Exception as e:                                     |
*** | > 58                 print(e)                                               |
*** |   59                 print(                                                 |
*** |   60                     f"Warning: Failed to install {package}, faceswapla |
*** |   61                 )                                                      |
*** +-----------------------------------------------------------------------------+
*** UnicodeEncodeError: 'gbk' codec can't encode character '\u073e' in position
*** 3243: illegal multibyte sequence

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: faceswaplab 1.2.1

Web UI takes longer to load

After enabling the extension and restating the UI, it takes stable diffusion awhile to start. It will start to show loading icons on the top areas where the checkpoint dropdown is, and on the clipskip and SDVAE option that i also have there. When that stops "loading" it will start a loading icon on the extensions in the extension tab. Total time takes 71 sec rather 18 seconds with it disabled. Not sure what its loading, or looking through. Or if its a feature im not aware of that i need to disable.

bandicam 2023-08-22 23-55-16-596

Desktop

  • OS: WIN10
  • Browser chrome

what should I do? ->Older versions of gradio may not work ( issubclass() arg 1 must be a class) ?

Error executing callback ui_tabs_callback for C:\picture\Ai\app\stable-diffusion-webui\stable-diffusion-webui-9523\extensions\sd-webui-faceswaplab\scripts\faceswaplab.py
Traceback (most recent call last):
File "C:\picture\Ai\app\stable-diffusion-webui\stable-diffusion-webui-9523\modules\script_callbacks.py", line 134, in ui_tabs_callback
res += c.callback() or []
File "C:\picture\Ai\app\stable-diffusion-webui\stable-diffusion-webui-9523\extensions\sd-webui-faceswaplab\scripts\faceswaplab_ui\faceswaplab_tab.py", line 454, in on_ui_tabs
tools_ui()
File "C:\picture\Ai\app\stable-diffusion-webui\stable-diffusion-webui-9523\extensions\sd-webui-faceswaplab\scripts\faceswaplab_ui\faceswaplab_tab.py", line 433, in tools_ui
extract_btn.click(
File "C:\picture\Ai\app\stable-diffusion-webui\stable-diffusion-webui-9523\venv\lib\site-packages\gradio\events.py", line 132, in call
dep, dep_index = self.trigger.set_event_trigger(
File "C:\picture\Ai\app\stable-diffusion-webui\stable-diffusion-webui-9523\venv\lib\site-packages\gradio\blocks.py", line 217, in set_event_trigger
check_function_inputs_match(fn, inputs, inputs_as_dict)
File "C:\picture\Ai\app\stable-diffusion-webui\stable-diffusion-webui-9523\venv\lib\site-packages\gradio\utils.py", line 869, in check_function_inputs_match
if not is_special_typed_parameter(name):
File "C:\picture\Ai\app\stable-diffusion-webui\stable-diffusion-webui-9523\venv\lib\site-packages\gradio\utils.py", line 858, in is_special_typed_parameter
is_event_data = issubclass(parameter_types.get(name, int), EventData)
TypeError: issubclass() arg 1 must be a class

OutOfMemoryError

i get this error: OutOfMemoryError: CUDA out of memory. Tried to allocate 11.39 GiB (GPU 0; 12.00 GiB total capacity; 14.32 GiB already allocated; 0 bytes free; 14.55 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
Time taken: 3m 56.40sTorch active/reserved: 14769/15466 MiB, Sys VRAM: 12288/12288 MiB (100.0%)

Is 12gb Vram (rtx 3060) and 16 ram not enough to run this extension?

And it would be awesome if there would be some kind of workflow or tutorial as i cant anything like this...

Thank you for any help and your work

update to pydantic 1.10.11

pydantic 1.10.9 is conflicting with the current build of SD.Next

22:42:14-291101 INFO Verifying requirements
22:42:14-302100 WARNING Package wrong version: pydantic 1.10.9 required 1.10.11
22:42:14-303102 INFO Installing package: pydantic==1.10.11
...
22:42:47-324584 INFO Extension installed packages: sd-webui-faceswaplab ['pydantic==1.10.9']

Speedup WebUI launch by improving faceswaplab code

Can you please try to improve the startup time, something is completely not right here if you compare it to the loading time of any other extension.

13.5secs for loading the script (can this be improved?)
and
7sec to run extensions installer (even if it's already completely installed, that shouldn't be necessary?)

So ~20sec of the 50sec are only based on that single extension.

slow_startup

why no use faceswaplab

Try to use model : /tmp-data/workspace/stable-diffusion-webui/models/faceswaplab/inswapper_128.onnx
/tmp-data/workspace/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/utils/transform.py:68: FutureWarning: rcond parameter will change to the default of machine precision times max(M, N) where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass rcond=None, to keep using the old, explicitly pass rcond=-1.
P = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4

Output of batch processing has random filenames

Discussed in #20

Originally posted by Zhincore August 3, 2023
Output of batch processing has random filenames, making it more difficult to match the pictures to the source ones.
Did I set something wrong or is this the current behavior?

FaceSwapLab - **ERROR** - Failed to swap face in postprocess method

2023-08-03 12:43:08,484 - FaceSwapLab - INFO - Try to use model : D:\A1111\stable-diffusion-webui\models\faceswaplab\inswapper_128.onnx█████| 20/20 [00:02<00:00, 9.21it/s]
2023-08-03 12:43:09,410 - FaceSwapLab - INFO - blend all faces together
2023-08-03 12:43:09,413 - FaceSwapLab - INFO - Load analysis model, will take some time.
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: D:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: D:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: D:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: D:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: D:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5
2023-08-03 12:43:10,291 - FaceSwapLab - ERROR - Failed to swap face in postprocess method : This ORT build has ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'], ...)
Total progress: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00, 4.49it/s]
Total progress: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00, 9.21it/s]

To Reproduce
nothing special, just start A1111 with
--medvram --xformers --administrator --api --no-half-vae --theme dark
Once UI loadeded, i prompt "portrait of a woman", i generate with a face to swap (no parameter modified)
i also tried without --medvram i had same result
While roop 0.0.2 (also installed) works each time

Desktop (please complete the following information):

  • OS: Windows 10 with 32gb RAM and Nvidia Geforce RTX 3070 Ti
  • Browser : Edge & Opera GX (tried with both)

Model not found

It looks like the devs for Roop have taken down their link for the model. Following it from the config script throws a bad gateway error.

processed image grid is not saved to output directory (left in temp)

Describe the bug
processed image grid is not saved to output directory .. remains in eg %AppData%\Local\Temp\Gradio

To Reproduce
Steps to reproduce the behavior:

  • run a generaton with a batch size of eg 4 images
  • Observe pre-processed grid is output to correct directory, but the processed grid remains in the temp gradio folder

Expected behavior
Post-process image grid should be output to relevant directory
(Note: ideally pre-processed image grid should only be output if "Keep original image before swapping" is checked)

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Opera GX

thanks

ModuleNotFoundError: No module named <x> : Read this if you have dependencies problem

If you encounter issues with dependencies or during the installation, it's recommended to install the dependencies manually from the root of your directory.

Windows:

.\venv\Scripts\activate
cd .\extensions\sd-webui-faceswaplab\
pip install -r .\requirements.txt

Linux/MacOS:

source venv/bin/activate
cd ./extensions/sd-webui-faceswaplab/
pip install -r ./requirements.txt

Please ensure that you have already set up the virtual environment (venv) before executing these commands.

If you plan on using the GPU, please use requirements-gpu.txt instead of requirements.txt when installing.

There is No Facelab Tab with option to Build

I just installed the facelab extension v.1.2.5. I see the part where I can swap faces, but however there is no Tab with the additional settings to be able to build a checkpoint. I already tried removing all extensions except for this and I tried running with a default webuser bat file with no commandline arguments. Any ideas how to fix?

Untitled

ERROR - Failed to swap face in postprocess method : <urlopen error [Errno 104] Connection reset by peer>

Describe the bug
I am using stable-diffusion-webui-docker and have installed it according to the 'sd webui faceswaplab' document. I am using 'img2img' and checked 'enabled'. The following error occurred :

FaceSwapLab - INFO - Try to use model : /stable-diffusion-webui/models/faceswaplab/inswapper_128.onnx
/usr/local/lib/python3.10/site-packages/insightface/utils/transform.py:68: FutureWarning: rcond parameter will change to the default of machine precision times max(M, N) where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass rcond=None, to keep using the old, explicitly pass rcond=-1.
P = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4
Downloading the detection model to /root/.ifnude/detector.onnx
2023-08-28 14:35:39,353 - FaceSwapLab - ERROR - Failed to swap face in postprocess method : <urlopen error [Errno 104] Connection reset by peer>
Traceback (most recent call last):
File "/usr/local/lib/python3.10/urllib/request.py", line 1348, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/local/lib/python3.10/http/client.py", line 1282, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.10/http/client.py", line 1328, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.10/http/client.py", line 1277, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.10/http/client.py", line 1037, in _send_output
self.send(msg)
File "/usr/local/lib/python3.10/http/client.py", line 975, in send
self.connect()
File "/usr/local/lib/python3.10/http/client.py", line 1454, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/usr/local/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/usr/local/lib/python3.10/ssl.py", line 1071, in _create
self.do_handshake()
File "/usr/local/lib/python3.10/ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab.py", line 187, in postprocess
swapped_images = swapper.process_images_units(
File "/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab_swapping/swapper.py", line 832, in process_images_units
swapped = process_image_unit(model, units[0], image, info, force_blend)
File "/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab_swapping/swapper.py", line 707, in process_image_unit
if check_against_nsfw(image):
File "/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab_utils/imgutils.py", line 33, in check_against_nsfw
from ifnude import detect
File "/usr/local/lib/python3.10/site-packages/ifnude/init.py", line 1, in
from .detector import detect
File "/usr/local/lib/python3.10/site-packages/ifnude/detector.py", line 36, in
download(model_url, model_path)
File "/usr/local/lib/python3.10/site-packages/ifnude/detector.py", line 16, in download
request = urllib.request.urlopen(url)
File "/usr/local/lib/python3.10/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.10/urllib/request.py", line 519, in open
response = self._open(req, data)
File "/usr/local/lib/python3.10/urllib/request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/local/lib/python3.10/urllib/request.py", line 496, in _call_chain

result = func(*args)

File "/usr/local/lib/python3.10/urllib/request.py", line 1391, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/usr/local/lib/python3.10/urllib/request.py", line 1351, in do_open
raise URLError(err)
Total progress: 100%|██████████| 1/1 [00:00<00:00, 1.30it/s]reset by peer>
c^H^C progress: 100%|██████████| 1/1 [00:00<00:00, 1.30it/s]

To Reproduce
Steps to reproduce the behavior:

  1. select tab for img2img
  2. Click on 'generate
  3. See error

Expected behavior
I hope I can successfully replace my face through img2img

Screenshots
1693272802761

Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • Browser chrome
  • Version 116

Additional context
Why do I need to send another network request to the outside world after I have already configured the ONNX model through the document

Inpaint with only masked downscale the original image

When i go to inpaint and choose only masked instead of whole picture, it should preserve resolution of original imave even if its 4k image, and it does when this extension is not in use, but when i enable this extension, it will downscale all images to pixelater versions , its pretty weird and its a serious pipeline bug that degrades all images i run through it .
You can test it with images with text, choose onlyu masked and face swap with this extension, resulting image will have pixelated text which is clearly much lower resolution.
So default behaviour should be - when i dont mask anything and i use hires picture, faceswaplab should be able to isolate the face from that image , then inpaint just the face, then paste face back into the image without degrading resolution, it does work like this when we mask only the face but it would be much better if faceswaplab did it on its own since it can recognize the face .

Masking artifacts (small white squares) when using improved segmented mask

Recently my images have been generating masking artifacts around the face. These appear as random, small, overexposed squares around the face in the final image. After some troubleshooting, I found that the only way I can resolve the issue is by disabling "Default Use improved segmented mask (use pastenet to mask only the face) (requires restart)" in the settings.

I'm not sure the exact version, but the issue started for me on 8/6/2023. Issue happens with and without any post-processing.

Desktop (please complete the following information):

  • OS: Windows 11 (22H2)
  • Browser: Microsoft Edge
  • FaceSwapLab: v1.2.1
  • GPU: Nvidia RTX 3080 FE (10GB)
  • Driver: v531.41

A1111 Info:

  • A1111: v1.5.1
  • Args: --xformers --autolaunch --medvram --update-check
  • python: 3.10.6
  • torch: 2.0.1+cu118
  • xformers: 0.0.20
  • gradio: 3.32.0

Additional context
2023-08-07 15:02:45,535 - FaceSwapLab - INFO - Try to use model : C:\A1111\stable-diffusion-webui\models\faceswaplab\inswapper_128.onnx
2023-08-07 15:02:45,540 - FaceSwapLab - INFO - Load analysis model det_size=(640, 640), det_thresh=0.5, providers = ['CUDAExecutionProvider'], will take some time. (> 30s)
Loading (640, 640) analysis model (first time is slow): 100%|█████████████████████████| 1/1 [00:00<00:00, 1.04model/s]
2023-08-07 15:02:46,502 - FaceSwapLab - INFO - ("Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with "
"options: {'CUDAExecutionProvider': {'do_copy_in_default_stream': '1', "
"'cudnn_conv_algo_search': 'EXHAUSTIVE', 'device_id': '0', "
"'gpu_external_alloc': '0', 'enable_cuda_graph': '0', 'gpu_mem_limit': "
"'18446744073709551615', 'gpu_external_free': '0', "
"'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', "
"'cudnn_conv_use_max_workspace': '1', 'cudnn_conv1d_pad_to_nc1d': '0', "
"'tunable_op_enable': '0', 'tunable_op_tuning_enable': '0', "
"'enable_skip_layer_norm_strict_mode': '0'}, 'CPUExecutionProvider': {}}\n"
'find model: '
'C:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\1k3d68.onnx '
"landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0\n"
"Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with "
"options: {'CUDAExecutionProvider': {'do_copy_in_default_stream': '1', "
"'cudnn_conv_algo_search': 'EXHAUSTIVE', 'device_id': '0', "
"'gpu_external_alloc': '0', 'enable_cuda_graph': '0', 'gpu_mem_limit': "
"'18446744073709551615', 'gpu_external_free': '0', "
"'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', "
"'cudnn_conv_use_max_workspace': '1', 'cudnn_conv1d_pad_to_nc1d': '0', "
"'tunable_op_enable': '0', 'tunable_op_tuning_enable': '0', "
"'enable_skip_layer_norm_strict_mode': '0'}, 'CPUExecutionProvider': {}}\n"
'find model: '
'C:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\2d106det.onnx '
"landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0\n"
"Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with "
"options: {'CUDAExecutionProvider': {'do_copy_in_default_stream': '1', "
"'cudnn_conv_algo_search': 'EXHAUSTIVE', 'device_id': '0', "
"'gpu_external_alloc': '0', 'enable_cuda_graph': '0', 'gpu_mem_limit': "
"'18446744073709551615', 'gpu_external_free': '0', "
"'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', "
"'cudnn_conv_use_max_workspace': '1', 'cudnn_conv1d_pad_to_nc1d': '0', "
"'tunable_op_enable': '0', 'tunable_op_tuning_enable': '0', "
"'enable_skip_layer_norm_strict_mode': '0'}, 'CPUExecutionProvider': {}}\n"
'find model: '
'C:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\det_10g.onnx '
"detection [1, 3, '?', '?'] 127.5 128.0\n"
"Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with "
"options: {'CUDAExecutionProvider': {'do_copy_in_default_stream': '1', "
"'cudnn_conv_algo_search': 'EXHAUSTIVE', 'device_id': '0', "
"'gpu_external_alloc': '0', 'enable_cuda_graph': '0', 'gpu_mem_limit': "
"'18446744073709551615', 'gpu_external_free': '0', "
"'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', "
"'cudnn_conv_use_max_workspace': '1', 'cudnn_conv1d_pad_to_nc1d': '0', "
"'tunable_op_enable': '0', 'tunable_op_tuning_enable': '0', "
"'enable_skip_layer_norm_strict_mode': '0'}, 'CPUExecutionProvider': {}}\n"
'find model: '
'C:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\genderage.onnx '
"genderage ['None', 3, 96, 96] 0.0 1.0\n"
"Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with "
"options: {'CUDAExecutionProvider': {'do_copy_in_default_stream': '1', "
"'cudnn_conv_algo_search': 'EXHAUSTIVE', 'device_id': '0', "
"'gpu_external_alloc': '0', 'enable_cuda_graph': '0', 'gpu_mem_limit': "
"'18446744073709551615', 'gpu_external_free': '0', "
"'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', "
"'cudnn_conv_use_max_workspace': '1', 'cudnn_conv1d_pad_to_nc1d': '0', "
"'tunable_op_enable': '0', 'tunable_op_tuning_enable': '0', "
"'enable_skip_layer_norm_strict_mode': '0'}, 'CPUExecutionProvider': {}}\n"
'find model: '
'C:\A1111\stable-diffusion-webui\models\faceswaplab\analysers\models\buffalo_l\w600k_r50.onnx '
"recognition ['None', 3, 112, 112] 127.5 127.5\n"
'set det-size: (640, 640)\n')
C:\A1111\stable-diffusion-webui\venv\lib\site-packages\insightface\utils\transform.py:68: FutureWarning: rcond parameter will change to the default of machine precision times max(M, N) where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass rcond=None, to keep using the old, explicitly pass rcond=-1.
P = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4
2023-08-07 15:02:52,674 - FaceSwapLab - INFO - blend all faces together
2023-08-07 15:02:52,674 - FaceSwapLab - INFO - loading face Shelley.safetensors
2023-08-07 15:02:52,676 - FaceSwapLab - INFO - Process face 0
2023-08-07 15:02:52,681 - FaceSwapLab - INFO - Source Gender 0
Loading swap model: 100%|█████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.43model/s]
2023-08-07 15:02:53,381 - FaceSwapLab - INFO - ("Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with "
"options: {'CUDAExecutionProvider': {'do_copy_in_default_stream': '1', "
"'cudnn_conv_algo_search': 'EXHAUSTIVE', 'device_id': '0', "
"'gpu_external_alloc': '0', 'enable_cuda_graph': '0', 'gpu_mem_limit': "
"'18446744073709551615', 'gpu_external_free': '0', "
"'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', "
"'cudnn_conv_use_max_workspace': '1', 'cudnn_conv1d_pad_to_nc1d': '0', "
"'tunable_op_enable': '0', 'tunable_op_tuning_enable': '0', "
"'enable_skip_layer_norm_strict_mode': '0'}, 'CPUExecutionProvider': {}}\n"
'inswapper-shape: [1, 3, 128, 128]\n')
2023-08-07 15:02:53,381 - FaceSwapLab - INFO - Target faces count : 1
2023-08-07 15:02:53,381 - FaceSwapLab - INFO - swap face 0
2023-08-07 15:02:56,468 - FaceSwapLab - INFO - ********************************************************************************
2023-08-07 15:02:56,468 - FaceSwapLab - INFO - Inswapper
2023-08-07 15:02:56,469 - FaceSwapLab - WARNING - Please note that improved mask does not work well without upscaling. Set upscaling to Lanczos at least if you want speed and want to use improved mask.
2023-08-07 15:02:56,469 - FaceSwapLab - INFO - improved_mask
2023-08-07 15:02:56,877 - FaceSwapLab - INFO - ********************************************************************************
2023-08-07 15:02:57,052 - FaceSwapLab - INFO - Finished processing image, return 1 images
2023-08-07 15:02:57,053 - FaceSwapLab - INFO - 1 images swapped
2023-08-07 15:02:57,054 - FaceSwapLab - INFO - Upscale with TGHQFace8x_500k scale = 1
2023-08-07 15:03:13,789 - FaceSwapLab - INFO - Restore face with GFPGAN
2023-08-07 15:03:16,034 - FaceSwapLab - INFO - Inpainting face
Sampler : DPM++ 2M SDE Karras
inpainting_denoising_strength : 0.03
inpainting_steps : 20

2023-08-07 15:03:16,034 - FaceSwapLab - INFO - send faces to image to image
2023-08-07 15:03:16,336 - FaceSwapLab - INFO - Denoising prompt : Portrait of a woman
2023-08-07 15:03:16,337 - FaceSwapLab - INFO - Denoising strenght : 0.03
0%| | 0/1 [00:01<?, ?it/s]
2023-08-07 15:03:18,239 - FaceSwapLab - ERROR - Failed to apply inpainting to face : local variable 'h' referenced before assignment
Traceback (most recent call last):

File "C:\A1111\stable-diffusion-webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_inpainting\i2i_pp.py", line 83, in img2img_diffusion
i2i_processed = processing.process_images(i2i_p)
File "C:\A1111\stable-diffusion-webui\modules\processing.py", line 677, in process_images
res = process_images_inner(p)
File "C:\A1111\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack
return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
File "C:\A1111\stable-diffusion-webui\modules\processing.py", line 794, in process_images_inner
samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
File "C:\A1111\stable-diffusion-webui\modules\processing.py", line 1381, in sample
samples = self.sampler.sample_img2img(self, self.init_latent, x, conditioning, unconditional_conditioning, image_conditioning=self.image_conditioning)
File "C:\A1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 434, in sample_img2img
samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "C:\A1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 303, in launch_sampling
return func()
File "C:\A1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 434, in
samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "C:\A1111\stable-diffusion-webui\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\A1111\stable-diffusion-webui\repositories\k-diffusion\k_diffusion\sampling.py", line 650, in sample_dpmpp_2m_sde
h_last = h
UnboundLocalError: local variable 'h' referenced before assignment
2023-08-07 15:03:18,241 - FaceSwapLab - ERROR - Failed to post-process local variable 'h' referenced before assignment
Traceback (most recent call last):

File "C:\A1111\stable-diffusion-webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_postprocessing\postprocessing.py", line 44, in enhance_image
result_image = img2img_diffusion(
File "C:\A1111\stable-diffusion-webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_inpainting\i2i_pp.py", line 97, in img2img_diffusion
raise e
File "C:\A1111\stable-diffusion-webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_inpainting\i2i_pp.py", line 83, in img2img_diffusion
i2i_processed = processing.process_images(i2i_p)
File "C:\A1111\stable-diffusion-webui\modules\processing.py", line 677, in process_images
res = process_images_inner(p)
File "C:\A1111\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack
return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
File "C:\A1111\stable-diffusion-webui\modules\processing.py", line 794, in process_images_inner
samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
File "C:\A1111\stable-diffusion-webui\modules\processing.py", line 1381, in sample
samples = self.sampler.sample_img2img(self, self.init_latent, x, conditioning, unconditional_conditioning, image_conditioning=self.image_conditioning)
File "C:\A1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 434, in sample_img2img
samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "C:\A1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 303, in launch_sampling
return func()
File "C:\A1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 434, in
samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "C:\A1111\stable-diffusion-webui\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\A1111\stable-diffusion-webui\repositories\k-diffusion\k_diffusion\sampling.py", line 650, in sample_dpmpp_2m_sde
h_last = h
UnboundLocalError: local variable 'h' referenced before assignment
2023-08-07 15:03:18,244 - FaceSwapLab - INFO - Add swp image to processed

Failed to build checkpoint list index out of range (solved : Check the model is in webui/models/faceswaplab)

Describe the bug
03:38:12-387230 ERROR Failed to build checkpoint list index out of range

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'FaceSwapLab, Tools, Build'
  2. Upload images
  3. Click save
  4. See error

Expected behavior
Successfully created checkpoint

Screenshots
image

Desktop (please complete the following information):

  • OS: [Windows 11 22H2]
  • Browser [MS Edge]

Additional context

Full error:
{'age': 33,
 'embedding': array([-1.98095843e-01,  8.57419819e-02,  5.11084259e-01, -1.04482412e-01,
        1.46759242e-01, -1.12602484e+00,  5.65003455e-02,  5.25855660e-01,
        2.71218538e-01, -2.76865400e-02, -1.06601477e-01,  1.30306125e+00,
        1.48285165e-01,  1.45907149e-01,  1.31163329e-01, -4.27121609e-01,
        8.96135792e-02,  4.33682203e-01, -2.46634886e-01,  3.71705383e-01,
        3.76718313e-01, -3.20548773e-01,  1.14868492e-01,  2.39762813e-01,
       -5.97749114e-01, -3.51954550e-01,  3.78686666e-01, -7.02905953e-02,
       -5.80739081e-01,  8.31370115e-01,  1.31022108e+00, -6.08228445e-01,
       -1.30046701e+00, -1.79233745e-01, -1.03804970e+00,  6.56417161e-02,
        6.78947449e-01, -3.33971828e-01,  2.38950074e-01, -9.20263231e-02,
       -7.83191845e-02,  1.91710484e+00,  2.93380022e-01, -5.95407009e-01,
        3.61057729e-01, -1.20585477e+00, -7.94019341e-01,  1.89984307e-01,
        7.50316262e-01, -1.62362352e-01, -7.29720891e-01,  2.14329168e-01,
        2.63072029e-02, -1.32853702e-01,  4.49805856e-01,  8.18586424e-02,
       -8.09526622e-01, -4.24041510e-01, -3.34787458e-01, -3.10510397e-01,
       -5.78550696e-01, -4.12792057e-01, -2.42356405e-01, -5.31892776e-01,
       -4.25981522e-01,  4.42634583e-01,  7.87668049e-01,  6.25603437e-01,
        7.45414555e-01, -9.13057208e-01,  5.56308687e-01,  6.38233662e-01,
        3.53708923e-01, -7.70793140e-01,  7.69021809e-01, -1.59396172e-01,
       -3.43858927e-01,  9.65723932e-01, -3.89188230e-01,  4.09514576e-01,
       -3.31487507e-01, -1.71912685e-01,  7.44856149e-02,  3.59337121e-01,
       -5.43792129e-01, -4.78190333e-01, -1.54813242e+00, -2.17523035e-02,
       -7.17357635e-01,  6.26982391e-01,  2.07812667e-01,  8.94111335e-01,
       -6.80955231e-01,  3.60444456e-01, -3.50414515e-01, -4.68807667e-01,
        1.57277554e-01,  6.47533715e-01,  3.71628791e-01,  4.66852576e-01,
        2.59801173e+00, -3.17930222e-01,  5.25439441e-01, -6.51129961e-01,
       -1.35577297e+00,  1.45542979e-01, -3.90664667e-01, -5.65808773e-01,
        6.52999580e-01,  1.88484538e+00,  8.19815457e-01, -2.07825169e-01,
        1.41002929e+00, -2.58818895e-01,  4.83071983e-01, -1.17679751e+00,
        5.50224423e-01,  2.77771592e-01,  1.69476882e-01,  1.72046702e-02,
        8.91880155e-01,  1.34944177e+00,  3.55900377e-01,  5.42203724e-01,
        3.84140164e-01,  3.93937528e-01,  1.49957538e-01,  6.37551472e-02,
       -6.43686831e-01, -1.38701573e-02,  5.90985835e-01, -8.57911766e-01,
        1.31762505e+00,  9.40620244e-01, -1.08752474e-01,  4.16389704e-01,
        1.30097818e+00,  7.40811229e-01,  6.38283640e-02,  1.08044517e+00,
        4.88240600e-01, -1.45539784e+00,  1.16197675e-01, -7.49037385e-01,
        1.22194147e+00, -4.04944569e-01, -9.43418026e-01, -1.15350008e+00,
        8.89921963e-01, -7.49506891e-01,  1.94906962e+00,  9.70449150e-01,
       -1.44246709e+00, -7.63473213e-01,  4.76886451e-01, -1.68565226e+00,
        2.38962144e-01, -4.14389372e-01, -1.07838380e+00, -9.50035155e-02,
        3.23131323e-01,  3.09829582e-02, -3.54273528e-01,  5.25098026e-01,
        6.76840663e-01, -4.80793804e-01, -1.78584111e+00,  1.85085192e-01,
       -5.65778255e-01,  2.68699259e-01, -1.97828099e-01,  5.16587019e-01,
       -1.96685410e+00, -5.57920277e-01, -1.24273241e-01,  8.09673443e-02,
        5.17660379e-01,  4.63572800e-01, -2.77064860e-01,  7.34318018e-01,
       -5.93745232e-01, -1.89287841e-01, -5.00726521e-01, -4.44019169e-01,
        1.34223139e+00, -7.93004036e-01, -2.79056597e+00,  2.78951496e-01,
        2.79402554e-01,  4.73076731e-01,  2.84397364e-01,  2.58352812e-02,
       -8.26023996e-01,  2.90921301e-01,  4.98885512e-01, -4.82910067e-01,
        8.65817428e-01, -4.80928384e-02, -3.56852025e-01,  4.41974550e-01,
        2.52185680e-04,  5.71554661e-01, -3.08114678e-01,  8.15543950e-01,
       -4.58165258e-01,  8.08404267e-01,  7.74363577e-01, -8.79077494e-01,
       -6.20397329e-01,  7.06088126e-01,  5.29134154e-01,  1.20438300e-01,
       -1.23457290e-01,  2.08530471e-01,  1.99606466e+00, -5.22882342e-01,
       -3.43405068e-01, -2.88744241e-01, -6.95623875e-01, -9.20819104e-01,
        3.47390413e-01,  9.36604291e-02,  1.94906339e-01,  1.72356546e-01,
       -1.08848369e+00, -6.45346269e-02, -7.31357396e-01,  4.75855827e-01,
        1.46123052e-01, -3.67924720e-01,  1.28538692e+00, -9.41856980e-01,
       -8.85583237e-02,  7.96136260e-02, -4.47643489e-01,  1.26129580e+00,
       -4.17390823e-01, -9.58796978e-01, -6.02452219e-01,  2.53524363e-01,
       -1.75174057e-01, -8.22754383e-01, -3.41782659e-01, -3.99128705e-01,
        1.74402267e-01,  9.19964612e-01, -1.96303248e-01,  8.99717331e-01,
       -2.78171115e-02,  8.15492451e-01,  1.10119653e+00,  5.89331567e-01,
       -2.05206588e-01,  6.95804536e-01, -5.22458434e-01, -1.27437425e+00,
       -7.63668776e-01,  8.93525898e-01, -3.17586511e-01,  8.73156309e-01,
       -1.24181293e-01,  1.67453632e-01, -1.72812688e+00, -2.21082762e-01,
       -1.35465372e+00, -1.15213037e+00,  4.34072495e-01, -4.76166338e-01,
       -7.35176682e-01,  1.63013041e-01, -8.53289247e-01, -3.33258390e-01,
        1.80498540e-01,  2.20089674e+00,  9.22801852e-01,  1.32396400e+00,
       -8.30184102e-01,  1.88267216e-01, -1.66415155e-01,  3.32440734e-01,
        6.22780561e-01,  2.35340223e-01, -2.12411150e-01, -1.32452130e-01,
       -4.65169668e-01, -9.76161182e-01,  6.04598522e-01,  5.92035770e-01,
       -1.39878646e-01,  4.50434327e-01,  3.14672887e-01, -5.80712140e-01,
       -8.75466764e-02,  9.36419010e-01,  1.08462524e+00, -1.32347631e+00,
       -8.36683750e-01,  8.17096114e-01, -1.18694603e+00,  4.80279118e-01,
       -1.73243165e-01,  5.78095376e-01, -5.90843618e-01, -8.83057535e-01,
        5.43224812e-01, -3.12741131e-01, -8.53154123e-01,  3.27666759e-01,
        5.98344624e-01, -1.46306825e+00, -1.77034829e-02,  5.57493567e-01,
       -8.70936453e-01,  8.70006979e-01, -1.00870836e+00,  6.92985833e-01,
       -3.92617583e-02, -6.25964761e-01,  3.38024825e-01,  7.00047135e-01,
       -9.06218469e-01, -7.05851436e-01, -5.94763495e-02, -2.49292567e-01,
       -6.95182681e-01,  2.23615021e-02,  3.71578783e-01,  4.56831567e-02,
        4.78772402e-01,  1.12045503e+00,  4.24251914e-01,  1.43821788e+00,
       -2.91753620e-01, -7.89857209e-01,  4.21857327e-01, -4.42033023e-01,
        1.22084033e+00,  2.36857384e-01,  1.82472747e-02,  1.07308447e+00,
        2.48365477e-01, -1.32199061e+00, -1.31877649e+00,  8.81731808e-01,
        2.52610534e-01,  2.59365410e-01, -4.71343845e-01,  6.82543755e-01,
       -3.60667288e-01, -5.72288215e-01,  2.51356006e-01,  3.68884504e-02,
       -9.69492178e-03,  3.60786259e-01,  7.12686479e-02,  3.10870379e-01,
        7.37577498e-01,  8.29828203e-01, -2.37491488e-01,  6.77580535e-02,
       -1.17823887e+00,  4.23468888e-01, -1.31367743e+00, -4.37606238e-02,
       -1.55824885e-01,  1.14254189e+00, -2.59627432e-01, -2.27638543e-01,
        1.29635847e+00, -6.66724384e-01, -1.04579914e+00, -1.23574831e-01,
        4.21379089e-01, -6.79141700e-01,  1.05886197e+00,  8.61444950e-01,
        9.46896911e-01,  4.62024540e-01,  2.40616903e-01, -1.92693308e-01,
        9.59028423e-01, -6.06339574e-01, -3.56682688e-01, -5.00818729e-01,
        3.37091923e-01,  6.82711601e-02,  7.39933252e-01,  1.66518867e+00,
       -2.80452091e-02, -7.71207452e-01,  7.26041019e-01, -8.22354317e-01,
        2.67282575e-01,  9.69297886e-01,  6.33447468e-01,  2.13868022e+00,
        6.23088419e-01,  1.54185188e+00, -2.86420792e-01, -9.53051031e-01,
       -1.37920523e+00,  1.23338938e-01,  5.19704998e-01, -5.39764225e-01,
        7.10156932e-02,  3.97083730e-01, -1.29998326e-01,  1.17280390e-02,
        7.00607181e-01,  1.44474363e+00, -6.98847115e-01,  2.77548939e-01,
       -7.53482342e-01, -4.78482991e-01,  5.64425468e-01, -5.30632615e-01,
       -9.93413508e-01,  2.36042142e-01,  1.13796055e+00, -1.54483885e-01,
       -5.17767787e-01, -1.26728284e+00, -2.28314605e-02, -1.82609379e-01,
        1.10257196e+00,  3.40071529e-01,  1.62014544e+00,  9.67467070e-01,
       -8.12644482e-01, -4.55618799e-01, -2.04983130e-01, -2.10284561e-01,
       -8.80014300e-01,  6.18717313e-01, -4.28777523e-02,  8.94034803e-02,
       -6.40965819e-01, -5.91588795e-01, -2.48515252e-02, -2.97658533e-01,
       -3.60326856e-01, -5.13339698e-01,  2.95412451e-01,  9.05253366e-02,
        7.82390296e-01, -2.38825884e-02,  4.38579857e-01, -1.59976855e-02,
       -1.23613477e+00,  4.93151516e-01,  1.72606464e-02,  2.23822087e-01,
        1.76842466e-01, -1.89223245e-01, -5.30380428e-01, -7.05080032e-01,
       -6.40930772e-01,  8.69440258e-01,  6.89755082e-01,  9.97707248e-01,
        3.01049352e-02,  1.26208985e+00,  4.10589278e-01,  7.05745757e-01,
        6.55546546e-01,  1.09116614e+00,  4.72230673e-01,  3.49424303e-01,
        3.55938345e-01, -7.82030404e-01, -6.20575905e-01, -1.30519009e+00,
        1.53471339e+00,  3.28236252e-01,  1.10598469e+00,  6.73336625e-01,
        5.31317770e-01,  1.51782110e-01,  1.34559083e+00,  9.47234333e-01,
       -2.08910942e-01, -6.93111897e-01,  1.24585402e+00, -8.08868051e-01,
        5.95568419e-01,  5.51985264e-01,  1.00488627e+00, -1.17247608e-02,
       -1.03121705e-01,  9.05231297e-01, -7.87826419e-01,  6.79148495e-01,
        8.98920953e-01,  9.72523019e-02, -6.55541062e-01,  1.03379405e+00,
        2.31501722e+00,  3.78584415e-01,  1.74309641e-01, -1.68061411e+00,
        8.08922887e-01,  5.75915933e-01, -2.56312937e-01,  5.11307895e-01,
       -5.34317255e-01,  7.06703722e-01,  1.27909616e-01,  7.59080291e-01,
       -1.00043023e+00,  7.75793850e-01, -1.13898385e+00,  1.53326437e-01],
      dtype=float32),
 'gender': 0}
03:40:29-709926 ERROR    Failed to build checkpoint list index out of range

Request for improvement in inpaint function

Thank you from the bottom of my heart for providing us with a great extension.

Inpainting must always be done at a size of 512x512, no matter what the original image size is, or the result will be corrupted.
Perhaps the current inpainting is always done at the image size, so if the original image size is larger than 512x512, the result will be deformed beyond the learned range.
Especially when Lora is specified at the prompt with an image size of 1024 or larger, it produces a noticeably worse image than expected.
This is the same behavior as when inpainting with img2img's inpaint function for sizes larger than 512.

It would be perfect if you could fix the inpaint width and height to 512x512 no matter what size the source image is, like ADetailer does.

Therefore, currently, using this inpainting function will produce unexpected results when using img2img for large size finishing, when using Hires.fix to improve quality, or when generating images in non-square sizes such as 512x768.

Pre-Inpainting (before swapping), Post-Inpainting (After swapping), and Global-Inpainting (all faces) all give the same result.

--
It would be more complete if the size of Inpaint mask blur and Inpaint only masked padding, pixels could also be changed for the ADetailer.

Confused about the basic usage of this extension

Hi!

I’m so sorry for asking such a basic/novice question. I am not new to SD, Automatic1111 or extensions, and yet, I can’t get FaceSwap to work despite reading the doc multiple times.

I guess one way to frame my question is: I have a reference image and an image sequence. How do I use the extension to swap the face found in my image sequence with the provided reference image?

Since my image sequence wasn’t generated by SD, I guess I shouldn’t use the extension within the Text2Img and Img2Img tabs, but use the FaceSwapLab tab? But in this tab, unless I’m missing something, there is no button to trigger the swapping (i.e. "Generate")?

Again, my apologies for asking such a basic question. Beyond this, the advanced settings make sense and I’m excited to batch-swap once I can get past this admittedly simple issue.

Thanks!

"[Errno 13] Permission denied" build safetensors via api /faceswaplab/build

Hello, thankyou for greate job, but i have some trouble with api, when i build safetensors via /faceswaplab/build server, send me error
"[Errno 13] Permission denied" model has created but not save, only save preview PNG file with swaped face in D:\SD_port\tmp\ folder

I use portable version of automatic1111 can you help me?

there are error code from automatic console
`2023-08-31 06:33:15,525 - FaceSwapLab - STATUS - Build api_ckpt with 7 images
2023-08-31 06:33:18,487 - FaceSwapLab - STATUS - Source Gender 0
2023-08-31 06:33:18,496 - FaceSwapLab - STATUS - Target faces count : 1
2023-08-31 06:33:18,497 - FaceSwapLab - STATUS - swap face 0
2023-08-31 06:33:19,019 - FaceSwapLab - STATUS - ********************************************************************************
2023-08-31 06:33:19,029 - FaceSwapLab - STATUS - Inswapper
2023-08-31 06:33:19,033 - FaceSwapLab - STATUS - Upscale with Lanczos scale = 4
2023-08-31 06:33:19,039 - FaceSwapLab - STATUS - Restore face with CodeFormer
2023-08-31 06:33:19,508 - FaceSwapLab - STATUS - sharpen
2023-08-31 06:33:19,511 - FaceSwapLab - STATUS - improved_mask
2023-08-31 06:33:19,577 - FaceSwapLab - STATUS - ********************************************************************************
2023-08-31 06:33:19,716 - FaceSwapLab - ERROR - Error loading checkpoint, after creation could not open file <D:\SD_port\tmp\tmp4gpb3bvj.safetensors> in read-only mode; error code: <32>
Traceback (most recent call last):
File "D:\SD_port\extensions\sd-webui-faceswaplab\scripts\faceswaplab_swapping\face_checkpoints.py", line 129, in build_face_checkpoint_and_save
data = load_face(file_path)
File "D:\SD_port\extensions\sd-webui-faceswaplab\scripts\faceswaplab_swapping\face_checkpoints.py", line 194, in load_face
with safe_open(filename, framework="pt", device="cpu") as f:
RuntimeError: could not open file <D:\SD_port\tmp\tmp4gpb3bvj.safetensors> in read-only mode; error code: <32>
D:\SD_port\tmp\tmp4gpb3bvj.safetensors
*** API error: POST: http://127.0.0.1:7860/faceswaplab/build {'error': 'PermissionError', 'detail': '', 'body': '', 'errors': "[Errno 13] Permission denied: 'D:\\SD_port\\tmp\\tmp4gpb3bvj.safetensors'"}
Traceback (most recent call last):
File "D:\SD_port\venv\lib\site-packages\anyio\streams\memory.py", line 94, in receive
return self.receive_nowait()
File "D:\SD_port\venv\lib\site-packages\anyio\streams\memory.py", line 89, in receive_nowait
raise WouldBlock
anyio.WouldBlock

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\base.py", line 78, in call_next
    message = await recv_stream.receive()
  File "D:\SD_port\venv\lib\site-packages\anyio\streams\memory.py", line 114, in receive
    raise EndOfStream
anyio.EndOfStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\SD_port\modules\api\api.py", line 152, in exception_handling
    return await call_next(request)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\base.py", line 84, in call_next
    raise app_exc
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\base.py", line 70, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\base.py", line 108, in __call__
    response = await self.dispatch_func(request, call_next)
  File "D:\SD_port\modules\api\api.py", line 116, in log_and_time
    res: Response = await call_next(req)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\base.py", line 84, in call_next
    raise app_exc
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\base.py", line 70, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "D:\SD_port\venv\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "D:\SD_port\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__
    raise e
  File "D:\SD_port\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "D:\SD_port\venv\lib\site-packages\starlette\routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "D:\SD_port\venv\lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "D:\SD_port\venv\lib\site-packages\starlette\routing.py", line 66, in app
    response = await func(request)
  File "D:\SD_port\venv\lib\site-packages\fastapi\routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "D:\SD_port\venv\lib\site-packages\fastapi\routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "D:\SD_port\extensions\sd-webui-faceswaplab\scripts\faceswaplab_api\faceswaplab_api.py", line 161, in build
    return api_utils.safetensors_to_base64(temp_file.name)
  File "D:\SD_port\extensions\sd-webui-faceswaplab\client_api\api_utils.py", line 275, in safetensors_to_base64
    file_bytes = file.read()
PermissionError: [Errno 13] Permission denied: 'D:\\SD_port\\tmp\\tmp4gpb3bvj.safetensors'`

Replace Face based on size binning

Is your feature request related to a problem? Please describe.
Often a face that is detected isn't the face that I'd like to replace. Face Similarity/Filtering helps, but often I want to replace a face given the actual face size.

Often times a subject face I'd like to swap is the subject, and thus in the foreground, and large. Secondary faces appear in the background, and are smaller.

Describe the solution you'd like
Given a small/medium/large 'Size' setting on a Face Swap Unit, Loop through the detected faces in the generated image. Create a histogram of these faces. Bin the faces into small/medium/large bins. Swap the face in the specified size bin at the specified index.

An optional Face Swap Unit setting would sort each bin by either the detected generated face age or the face's euclidean distance from the generated image center.

Psudocode:

# Calculate the width of the image and determine the image center
image_height, image_width = img_data.shape[:2]
image_center = (image_width // 2, image_height // 2)

# Calculate areas and categorize bounding boxes
areas = [(face.bbox[2] - face.bbox[0]) * (face.bbox[3] - face.bbox[1]) for face in gender_faces]
 
# Use numpy histogram to categorize into 3 bins
_, bin_edges = np.histogram(areas, bins=3)

# Place the faces in bins
bins = {'small': [], 'medium': [], 'large': []}
for face in gender_faces:
    area = (face.bbox[2] - face.bbox[0]) * (face.bbox[3] - face.bbox[1])
    if area < bin_edges[1]:
        bins['small'].append(face)
    elif area < bin_edges[2]:
        bins['medium'].append(face)
    else:
        bins['large'].append(face)

# Sort bins by setting
sorted_bins = {}
for size in ['large', 'medium', 'small']:
    if (sort = "center")
    # sort by distance from center
      sorted_bins[size] = sorted(
        bins[size], key=lambda face: ((face.bbox[2] + face.bbox[0]) / 2 - image_center[0]) ** 2 + ((face.bbox[3] + face.bbox[1]) / 2 - image_center[1]) ** 2
    # )
    else (sort = "age")
    # sort by age ascending
      sorted_bins[size] = sorted(bins[size], key=lambda face: face.age)

Describe alternatives you've considered
Face similarity, however this doesn't work on novel faces. Adding a named person, e.g. Albert Einstein, sometimes skews the generated image to contain particulars of that person/training that are undesirable in some instances or make it difficult to combine with other aspects contained in the prompt.

Additional context
Upon request.

Face Swap does not trigger consistently (solved : NSFW filtering too strong -> increase nsfw threshold)

Please remember that the bug report section is not a forum. Before submitting a bug, ensure you have read the FAQ thoroughly. This helps us maintain an efficient bug tracking process. Thank you for your understanding and cooperation. Use the discussion section for anything else.

Describe the bug
I will be generating image after image with successful face swap using this plugin. But then suddenly the next image does not get the face swapped. After generating a few more images or switching the face model, it will work again for a while but eventually stops working again.

To Reproduce
Steps to reproduce the behavior:

  1. Train a Face Checkpoint using the FaceSwapLab tab, Batch Source Images and name it whatever you like
  2. Use Txt2Img or Img2Img to generate a new image with your trained face checkpoint listed in the FaceSwapLab section and Enabled
  3. Repeat Generation without changing any settings or prompt
  4. Eventually the generated images will not get the face swapped

Expected behavior
The Face Checkpoint should continue to be applied as long as it is set and enabled.

Screenshots
Here you can see console output where Inswapper was triggered for the first image generation, but then the second one did not trigger Inswapper, so the face did not get swapped:
image

Here is the First Image with has my face
00012-1806140301-swapped

And the second which doesn't.
00013-357905843-swapped

Desktop (please complete the following information):
image

Firefox 116.0.3

Fixed model seed for face inpainting

Hello there, maybe I'm missing something but when I use Post-Inpainting (After swapping) or even pre, if I set a fixed seed in the img to img tab, the seed inside the extension still changes everytime for the face. Any way to use the same seed as the one define in the main setting? Or at least not have it change at every generation? Maybe it's possible to define the seed in the face Inpainting prompt tab already?

Great extension by the way!

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

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'

TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Downloading inswapper model: 529MB [00:20, 26.6MB/s]
2023-09-04 02:30:39,516 - FaceSwapLab - INFO - Try to use model : None
*** Error loading script: faceswaplab.py
    Traceback (most recent call last):
      File "C:\Users\ZeroCool22\Desktop\AutoRespaldo\modules\scripts.py", line 274, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "C:\Users\ZeroCool22\Desktop\AutoRespaldo\modules\script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "C:\Users\ZeroCool22\Desktop\AutoRespaldo\extensions\sd-webui-faceswaplab\scripts\faceswaplab.py", line 4, in <module>
        check_configuration()
      File "C:\Users\ZeroCool22\Desktop\AutoRespaldo\extensions\sd-webui-faceswaplab\scripts\configure.py", line 50, in check_configuration
        check_model()
      File "C:\Users\ZeroCool22\Desktop\AutoRespaldo\extensions\sd-webui-faceswaplab\scripts\faceswaplab_utils\models_utils.py", line 33, in check_model
        model_path = get_current_swap_model()
      File "C:\Users\ZeroCool22\Desktop\AutoRespaldo\extensions\sd-webui-faceswaplab\scripts\faceswaplab_utils\models_utils.py", line 75, in get_current_swap_model
        if not os.path.isfile(model):  # type: ignore
      File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\genericpath.py", line 30, in isfile
        st = os.stat(path)
    TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

---
2023-09-04 02:30:41,978 - roop - INFO - roop v0.0.2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Win. 10 x64
  • Browser FireFox
  • Version 116.0.3

Additional context
Add any other context about the problem here.

'NoneType' object is not iterable (Inpainting automatic dev version)

Describe the bug
Faceswaplab breaks when I enable either preinpainting or postinpainting. With either (or both) enabled Faceswaplab errors with a 'NoneType' object is not iterable error.

Automatic1111 version: v1.6.0-RC-21-gc0f9821c  •  python: 3.10.10  •  torch: 2.0.1

FSL settings
Screenshot 2023-08-28 at 22 21 25

Screenshot 2023-08-28 at 22 24 37

The error:

2023-08-28 22:28:53,169 - FaceSwapLab - INFO - Try to use model : /Users/s/stable-diffusion-webui/models/faceswaplab/inswapper_128.onnx
2023-08-28 22:28:53,451 - FaceSwapLab - INFO - blend all faces together
2023-08-28 22:28:53,451 - FaceSwapLab - INFO - loading face test.safetensors
2023-08-28 22:28:53,451 - FaceSwapLab - INFO - Process face 0
2023-08-28 22:28:53,455 - FaceSwapLab - INFO - Source Gender 0
2023-08-28 22:28:53,455 - FaceSwapLab - INFO - Target faces count : 1
2023-08-28 22:28:53,456 - FaceSwapLab - INFO - swap face 0
2023-08-28 22:28:54,638 - FaceSwapLab - INFO - ********************************************************************************
2023-08-28 22:28:54,638 - FaceSwapLab - INFO - Inswapper
2023-08-28 22:28:54,640 - FaceSwapLab - INFO - Upscale with LDSR scale = 4
Loading model from /Users/s/stable-diffusion-webui/models/LDSR/model.ckpt
LatentDiffusionV1: Running in eps-prediction mode
Keeping EMAs of 308.
Applying attention optimization: sub-quadratic... done.
Down sample rate is 1 from 4 / 4 (Not downsampling)
Plotting: Switched to EMA weights
Sampling with eta = 1.0; steps: 200
Data shape for DDIM sampling is (1, 3, 128, 128), eta 1.0
Running DDIM Sampling with 200 timesteps
DDIM Sampler: 100%|███████████████████████████| 200/200 [00:16<00:00, 12.32it/s]
Plotting: Restored training weights
2023-08-28 22:29:30,160 - FaceSwapLab - INFO - Restore face with CodeFormer
2023-08-28 22:29:31,010 - FaceSwapLab - INFO - sharpen
2023-08-28 22:29:31,013 - FaceSwapLab - INFO - color correction
2023-08-28 22:29:31,155 - FaceSwapLab - INFO - improved_mask
2023-08-28 22:29:31,388 - FaceSwapLab - INFO - ********************************************************************************
2023-08-28 22:29:31,474 - FaceSwapLab - INFO - Inpainting face
Sampler : DPM++ 2M Karras
inpainting_denoising_strength : 0.2
inpainting_steps : 20

2023-08-28 22:29:31,474 - FaceSwapLab - INFO - send faces to image to image
2023-08-28 22:29:31,517 - FaceSwapLab - INFO - Denoising prompt : Portrait of a woman, natural skin
2023-08-28 22:29:31,517 - FaceSwapLab - INFO - Denoising strenght : 0.2
2023-08-28 22:29:31,542 - FaceSwapLab - ERROR - Failed to apply inpainting to face : 'NoneType' object is not iterable
Traceback (most recent call last):
  File "/Users/s/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab_inpainting/i2i_pp.py", line 86, in img2img_diffusion
    i2i_processed = processing.process_images(i2i_p)
  File "/Users/s/stable-diffusion-webui/modules/processing.py", line 732, in process_images
    res = process_images_inner(p)
  File "/Users/s/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 42, in processing_process_images_hijack
    return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
  File "/Users/s/stable-diffusion-webui/modules/processing.py", line 803, in process_images_inner
    p.init(p.all_prompts, p.all_seeds, p.all_subseeds)
  File "/Users/s/stable-diffusion-webui/modules/processing.py", line 1447, in init
    for img in self.init_images:
TypeError: 'NoneType' object is not iterable
2023-08-28 22:29:31,543 - FaceSwapLab - ERROR - Failed to swap face in postprocess method : 'NoneType' object is not iterable
Traceback (most recent call last):
  File "/Users/s/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab.py", line 187, in postprocess
    swapped_images = swapper.process_images_units(
  File "/Users/s/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab_swapping/swapper.py", line 832, in process_images_units
    swapped = process_image_unit(model, units[0], image, info, force_blend)
  File "/Users/s/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab_swapping/swapper.py", line 752, in process_image_unit
    result.image = img2img_diffusion(
  File "/Users/s/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab_inpainting/i2i_pp.py", line 100, in img2img_diffusion
    raise e
  File "/Users/s/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab_inpainting/i2i_pp.py", line 86, in img2img_diffusion
    i2i_processed = processing.process_images(i2i_p)
  File "/Users/s/stable-diffusion-webui/modules/processing.py", line 732, in process_images
    res = process_images_inner(p)
  File "/Users/s/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 42, in processing_process_images_hijack
    return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
  File "/Users/s/stable-diffusion-webui/modules/processing.py", line 803, in process_images_inner
    p.init(p.all_prompts, p.all_seeds, p.all_subseeds)
  File "/Users/s/stable-diffusion-webui/modules/processing.py", line 1447, in init
    for img in self.init_images:
TypeError: 'NoneType' object is not iterable

List of extensions:

Stable-Diffusion-Webui-Civitai-Helper
a1111-sd-webui-tagcomplete
adetailer
embedding-inspector
multidiffusion-upscaler-for-automatic1111
sd-civitai-browser-plus
sd-dynamic-prompts
sd-extension-system-info
sd-webui-agent-scheduler
sd-webui-aspect-ratio-helper
sd-webui-controlnet
sd-webui-faceswaplab
sd-webui-llul
sd-webui-supermerger
sd_delete_button
stable-diffusion-webui-embedding-editor
stable-diffusion-webui-embedding-merge
stable-diffusion-webui-images-browser
stable-diffusion-webui-model-toolkit
stable-diffusion-webui-wildcards
ultimate-upscale-for-automatic1111

Expected behavior
Faceswaplab to do pre or post inpainting as expected.

Additional context
It used to work but has randomly broken and I can't work out why. I've tried reinstallation of FSL and automatic1111 but the problem persists. The rest of Automatic1111 and other extensions work as expected. Have also tried removing ControlNet, due to seeing it's name in the error, but that made no difference.

img2img : Failed to process : tuple index out of range

Thanks, trying option one now and it's working pretty well...
However, @glucauze, in lieu of creating a new discussion, how do I effectively use the tab in img2img? I have a 'classic' image of three people that I am trying to keep everything in tact with and replace all three faces (with face checkpoints) and it's just not working like it does in txt2img. Denoising set at .1 (but have tried every stage) and tried all "Configure swapping. Swapping can occur before img2img, after or both" options – though I cannot lie and say I really get the difference between when to use "Swap in source image (blended face)" and/or "Swap in generated image" in img2img.

I'm primarily getting these two errors:

2023-08-09 22:02:55,942 - FaceSwapLab - INFO - Failed to process : tuple index out of range
Traceback (most recent call last):
  File "/Users/jet/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab.py", line 141, in process
	self.read_config(p, *components)
  File "/Users/jet/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab.py", line 121, in read_config
	classes: List[Any] = dataclasses_from_flat_list(
  File "/Users/jet/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab_utils/ui_utils.py", line 33, in dataclasses_from_flat_list
	instance = dataclass_from_flat_list(cls, values[idx : idx + num_fields])
  File "/Users/jet/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab_utils/ui_utils.py", line 17, in dataclass_from_flat_list
	value = values[idx]
IndexError: tuple index out of range

and

2023-08-09 21:51:25,640 - FaceSwapLab - ERROR - Failed to swap face in postprocess method : 'FaceSwapScript' object has no attribute 'units'
Traceback (most recent call last):
  File "/Users/jet/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab.py", line 166, in postprocess
	if self.enabled:
  File "/Users/jet/stable-diffusion-webui/extensions/sd-webui-faceswaplab/scripts/faceswaplab.py", line 84, in enabled
	return any([u.enable for u in self.units]) and not shared.state.interrupted
AttributeError: 'FaceSwapScript' object has no attribute 'units'

Thanks!

Originally posted by @jet3004 in #32 (reply in thread)

settings are not taken into account since v1.2.3

Problem : Settings are not taken into account when modified.

Reason :
This is due to the way settings are no manage. Instead of using a lambda to load the settings (which takes a lot of time), i removed the settings from ui-config.json. This allows to manage the settings a lot more quickly.

Solution :
Migration : YOU NEED TO recreate ui-config.json (delete and restart sd) OR at least remove any faceswaplab reference in the ui-config.json file to be able to use default settings again.

See this for explainations : AUTOMATIC1111/stable-diffusion-webui#6109

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.