Gourieff / sd-webui-reactor

Fast and Simple Face Swap Extension for StableDiffusion WebUI (A1111 SD WebUI, SD WebUI Forge, SD.Next, Cagliostro)
GNU Affero General Public License v3.0
2.57k stars 281 forks source link

[SOLVED] Always got *** Error running postprocess_image #196

Closed Blackstylez83 closed 1 year ago

Blackstylez83 commented 1 year ago

First, confirm

What happened?

I try generate with ReACtor but still got this error

Steps to reproduce the problem

Img2img --> upload pic with 1 face ---> denoise strength 0,2 --> upload face to reActor ( enabled) then click generate

Sysinfo

sysinfo-2023-11-14-15-58.txt

Relevant console log

venv "D:\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
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': {}}
model ignore: C:\Users\agusc/.insightface\models\buffalo_l\1k3d68.onnx landmark_3d_68
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': {}}
model ignore: C:\Users\agusc/.insightface\models\buffalo_l\2d106det.onnx landmark_2d_106
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': {}}
find model: C:\Users\agusc/.insightface\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
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': {}}
find model: C:\Users\agusc/.insightface\models\buffalo_l\genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0
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': {}}
model ignore: C:\Users\agusc/.insightface\models\buffalo_l\w600k_r50.onnx recognition
set det-size: (640, 640)
Installing requirements for Face Editor
Faceswaplab : Use GPU requirements
Checking faceswaplab requirements
0.00477600000158418
Requirement already satisfied: onnxruntime-gpu in d:\stable-diffusion-webui\venv\lib\site-packages (1.15.1)
Requirement already satisfied: coloredlogs in d:\stable-diffusion-webui\venv\lib\site-packages (from onnxruntime-gpu) (15.0.1)
Requirement already satisfied: flatbuffers in d:\stable-diffusion-webui\venv\lib\site-packages (from onnxruntime-gpu) (23.5.26)
Requirement already satisfied: numpy>=1.21.6 in d:\stable-diffusion-webui\venv\lib\site-packages (from onnxruntime-gpu) (1.23.5)
Requirement already satisfied: packaging in d:\stable-diffusion-webui\venv\lib\site-packages (from onnxruntime-gpu) (23.1)
Requirement already satisfied: protobuf in d:\stable-diffusion-webui\venv\lib\site-packages (from onnxruntime-gpu) (3.20.3)
Requirement already satisfied: sympy in d:\stable-diffusion-webui\venv\lib\site-packages (from onnxruntime-gpu) (1.11.1)
Requirement already satisfied: humanfriendly>=9.1 in d:\stable-diffusion-webui\venv\lib\site-packages (from coloredlogs->onnxruntime-gpu) (10.0)
Requirement already satisfied: mpmath>=0.19 in d:\stable-diffusion-webui\venv\lib\site-packages (from sympy->onnxruntime-gpu) (1.2.1)
Requirement already satisfied: pyreadline3 in d:\stable-diffusion-webui\venv\lib\site-packages (from humanfriendly>=9.1->coloredlogs->onnxruntime-gpu) (3.4.1)
ReActor preheating... Device: CUDA

        +---------------------------------+
        --- PLEASE, RESTART the Server! ---
        +---------------------------------+
Launching Web UI with arguments: --xformers --api --no-half-vae --autolaunch
Civitai Helper: Get Custom Model Folder
[-] ADetailer initialized. version: 23.8.1, num models: 10
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': {}}
model ignore: C:\Users\agusc/.insightface\models\buffalo_l\1k3d68.onnx landmark_3d_68
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': {}}
model ignore: C:\Users\agusc/.insightface\models\buffalo_l\2d106det.onnx landmark_2d_106
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': {}}
find model: C:\Users\agusc/.insightface\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
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': {}}
find model: C:\Users\agusc/.insightface\models\buffalo_l\genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0
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': {}}
model ignore: C:\Users\agusc/.insightface\models\buffalo_l\w600k_r50.onnx recognition
set det-size: (640, 640)
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': {}}
model ignore: C:\Users\agusc/.insightface\models\buffalo_l\1k3d68.onnx landmark_3d_68
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': {}}
find model: C:\Users\agusc/.insightface\models\buffalo_l\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0
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': {}}
find model: C:\Users\agusc/.insightface\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
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': {}}
model ignore: C:\Users\agusc/.insightface\models\buffalo_l\genderage.onnx genderage
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': {}}
model ignore: C:\Users\agusc/.insightface\models\buffalo_l\w600k_r50.onnx recognition
set det-size: (640, 640)
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
2023-11-14 23:03:55,986 - ControlNet - INFO - ControlNet v1.1.417
ControlNet preprocessor location: D:\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-11-14 23:03:56,310 - ControlNet - INFO - ControlNet v1.1.417
23:03:57 - ReActor - STATUS - Running v0.5.0-b1
Loading weights [15012c538f] from D:\stable-diffusion-webui\models\Stable-diffusion\realisticVisionV51_v51VAE.safetensors
2023-11-14 23:03:57,667 - AnimateDiff - INFO - Hacking i2i-batch.
Civitai Helper: Settings:
Civitai Helper: max_size_preview: True
Civitai Helper: skip_nsfw_preview: False
Civitai Helper: open_url_with_js: True
Civitai Helper: proxy:
Creating model from config: D:\stable-diffusion-webui\configs\v1-inference.yaml
Civitai Shortcut: v1.6.7
Civitai Shortcut: shortcut update start
Loading VAE weights specified in settings: D:\stable-diffusion-webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: xformers... done.
Model loaded in 2.7s (load weights from disk: 0.6s, create model: 0.5s, apply weights to model: 1.2s, load VAE: 0.2s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 40.6s (prepare environment: 20.8s, import torch: 5.3s, import gradio: 0.6s, setup paths: 0.7s, initialize shared: 0.2s, other imports: 0.5s, setup codeformer: 0.1s, load scripts: 8.3s, create ui: 3.3s, gradio launch: 0.3s, add APIs: 0.4s).
Civitai Shortcut: shortcut update end
100%|████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:01<00:00,  3.51it/s]
23:04:50 - ReActor - STATUS - Working: source face index [0], target face index [0]██████| 5/5 [00:00<00:00,  4.64it/s]
23:04:50 - ReActor - STATUS - Analyzing Source Image...
*** Error running postprocess_image: D:\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_faceswap.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui\modules\scripts.py", line 675, in postprocess_image
        script.postprocess_image(p, pp, *script_args)
      File "D:\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_faceswap.py", line 433, in postprocess_image
        result, output, swapped = swap_face(
      File "D:\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 333, in swap_face
        source_faces = analyze_faces(source_img)
      File "D:\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 225, in analyze_faces
        face_analyser = copy.deepcopy(getAnalysisModel())
      File "C:\Users\agusc\AppData\Local\Programs\Python\Python310\lib\copy.py", line 172, in deepcopy
        y = _reconstruct(x, memo, *rv)
      File "C:\Users\agusc\AppData\Local\Programs\Python\Python310\lib\copy.py", line 271, in _reconstruct
        state = deepcopy(state, memo)
      File "C:\Users\agusc\AppData\Local\Programs\Python\Python310\lib\copy.py", line 146, in deepcopy
        y = copier(x, memo)
      File "C:\Users\agusc\AppData\Local\Programs\Python\Python310\lib\copy.py", line 231, in _deepcopy_dict
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "C:\Users\agusc\AppData\Local\Programs\Python\Python310\lib\copy.py", line 146, in deepcopy
        y = copier(x, memo)
      File "C:\Users\agusc\AppData\Local\Programs\Python\Python310\lib\copy.py", line 231, in _deepcopy_dict
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "C:\Users\agusc\AppData\Local\Programs\Python\Python310\lib\copy.py", line 172, in deepcopy
        y = _reconstruct(x, memo, *rv)
      File "C:\Users\agusc\AppData\Local\Programs\Python\Python310\lib\copy.py", line 271, in _reconstruct
        state = deepcopy(state, memo)
      File "C:\Users\agusc\AppData\Local\Programs\Python\Python310\lib\copy.py", line 146, in deepcopy
        y = copier(x, memo)
      File "C:\Users\agusc\AppData\Local\Programs\Python\Python310\lib\copy.py", line 231, in _deepcopy_dict
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "C:\Users\agusc\AppData\Local\Programs\Python\Python310\lib\copy.py", line 172, in deepcopy
        y = _reconstruct(x, memo, *rv)
      File "C:\Users\agusc\AppData\Local\Programs\Python\Python310\lib\copy.py", line 273, in _reconstruct
        y.__setstate__(state)
      File "D:\stable-diffusion-webui\venv\lib\site-packages\insightface\model_zoo\model_zoo.py", line 33, in __setstate__
        self.__init__(model_path)
      File "D:\stable-diffusion-webui\venv\lib\site-packages\insightface\model_zoo\model_zoo.py", line 25, in __init__
        super().__init__(model_path, **kwargs)
      File "D:\stable-diffusion-webui\venv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 396, in __init__
        raise e
      File "D:\stable-diffusion-webui\venv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 383, in __init__
        self._create_inference_session(providers, provider_options, disabled_optimizers)
      File "D:\stable-diffusion-webui\venv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 415, 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'], ...)

---
Total progress: 100%|████████████████████████████████████████████████████████████████████| 5/5 [00:02<00:00,  1.85it/s]
Total progress: 100%|████████████████████████████████████████████████████████████████████| 5/5 [00:02<00:00,  4.64it/s]

Additional information

No response

Gourieff commented 1 year ago

Installing requirements for Face Editor Faceswaplab : Use GPU requirements Checking faceswaplab requirements 0.00477600000158418 Requirement already satisfied: onnxruntime-gpu in d:\stable-diffusion-webui\venv\lib\site-packages (1.15.1)

You need onnxruntime-gpu 1.16.1 or higher to run ReActor

From d:\stable-diffusion-webui open CMD:

 .\venv\Scripts\activate

pip install onnxruntime-gpu==1.16.1

Blackstylez83 commented 1 year ago

Yess.. now it works, many thanks .. that \activate i really missed it.. many thanks.