glucauze / sd-webui-faceswaplab

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

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

Closed luojiong closed 11 months ago

luojiong commented 11 months ago

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):

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

luojiong commented 11 months ago

im resolve this problem https://github.com/s0md3v/sd-webui-roop/issues/98