sd-webui-roop icon indicating copy to clipboard operation
sd-webui-roop copied to clipboard

Protobuf parsing failed

Open ltceducation opened this issue 2 years ago • 18 comments

Error running postprocess_batch: G:\SD\stable-diffusion-webui\extensions\sd-webui-roop\scripts\faceswap.py0, 4.14it/s] Traceback (most recent call last): File "G:\SD\stable-diffusion-webui\modules\scripts.py", line 496, in postprocess_image script.postprocess_image(p, pp, *script_args) File "G:\SD\stable-diffusion-webui\extensions\sd-webui-roop\scripts\faceswap.py", line 187, in postprocess_image result: ImageResult = swap_face( File "G:\SD\stable-diffusion-webui\extensions\sd-webui-roop\scripts\swapper.py", line 111, in swap_face converted = convert_to_sd(target_img) File "G:\SD\stable-diffusion-webui\extensions\sd-webui-roop\scripts\cimage.py", line 6, in convert_to_sd chunks = detect(img) File "G:\SD\stable-diffusion-webui\venv\lib\site-packages\ifnude\detector.py", line 46, in detect detection_model = onnxruntime.InferenceSession(model_path, providers=["CPUExecutionProvider"]) File "G:\SD\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 "G:\SD\stable-diffusion-webui\venv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 424, in _create_inference_session sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model) onnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from C:\Users\LTC.ifnude/detector.onnx failed:Protobuf parsing failed.

ltceducation avatar Jun 21 '23 08:06 ltceducation

I also have a similar issue roop final error

gokuchiku avatar Jun 21 '23 09:06 gokuchiku

same problem,

Error running postprocess_batch: D:\sd-webui-aki-v4.1\extensions\sd-webui-roop\scripts\faceswap.py Traceback (most recent call last): File "D:\sd-webui-aki-v4.1\modules\scripts.py", line 496, in postprocess_image script.postprocess_image(p, pp, *script_args) File "D:\sd-webui-aki-v4.1\extensions\sd-webui-roop\scripts\faceswap.py", line 183, in postprocess_image result: ImageResult = swap_face( File "D:\sd-webui-aki-v4.1\extensions\sd-webui-roop\scripts\swapper.py", line 109, in swap_face converted = convert_to_sd(target_img) File "D:\sd-webui-aki-v4.1\extensions\sd-webui-roop\scripts\cimage.py", line 6, in convert_to_sd chunks = detect(img) File "D:\sd-webui-aki-v4.1\python\lib\site-packages\ifnude\detector.py", line 46, in detect detection_model = onnxruntime.InferenceSession(model_path, providers=["CPUExecutionProvider"]) File "D:\sd-webui-aki-v4.1\python\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 383, in __init__ self._create_inference_session(providers, provider_options, disabled_optimizers) File "D:\sd-webui-aki-v4.1\python\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 424, in _create_inference_session sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model) onnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from C:\Users\Admin\.ifnude/detector.onnx failed:Protobuf parsing failed.

xueqing0622 avatar Jun 23 '23 08:06 xueqing0622

same error

Forevercyj avatar Jun 24 '23 05:06 Forevercyj

same error

download the onnx file from the updated readme file and do as it says in there

gokuchiku avatar Jun 24 '23 12:06 gokuchiku

same error

download the onnx file from the updated readme file and do as it says in there

hi, gokuchiku, do you fixed it. which onnx file we should download, the "inswapper_128.onnx"I download as readme, but still same error download the inswapper_128.onnx model and put it inside <webui_dir>/models/roop/ directory.

xueqing0622 avatar Jun 24 '23 13:06 xueqing0622

I found that it was caused by an error in the process of downloading the model. Make sure there are these models under the three paths below. If you don't have these folders, you can first create related folders according to the path below.

  1. C:\ Users\ directory where the user resides\ .ifnude

There are detector.onnx and classes models under this path, and the model of detector.onnx is about 139mb. If the model under this path is not the right size, please delete the model in the directory, restart sd webui ,It will download automatically.

  1. C:\ Users\ directory where the user resides\ .insightface\ models\ buffalo_l

There are five models in the buffalo_l folder directory. You can download them from the link below and extract them to the buffalo_l directory.

Https://github.com/deepinsight/insightface/releases/download/v0.7/buffalo_l.zip

  1. download the inswapper_128.onnx model and put it inside <webui_dir>/models/roop/ directory.

klossm avatar Jun 24 '23 15:06 klossm

I found that it was caused by an error in the process of downloading the model. Make sure there are these models under the three paths below. If you don't have these folders, you can first create related folders according to the path below.

  1. C:\ Users\ directory where the user resides\ .ifnude.

There are detector.onnx and classes models under this path, and the model of detector.onnx is about 139mb. If the model under this path is not the right size, please delete the model in the directory, restart sd webui ,It will download automatically.

  1. C:\ Users\ directory where the user resides\ .insightface\ models\ buffalo_l.

There are five models in the buffalo_l folder directory. You can download them from the link below and extract them to the buffalo_l directory.

Https://github.com/deepinsight/insightface/releases/download/v0.7/buffalo_l.zip

  1. download the inswapper_128.onnx model and put it inside <webui_dir>/models/roop/ directory.

Additional information on step 1, Many people has network issue especially in China, here is the direct-donwload-link: https://huggingface.co/s0md3v/nudity-checker/resolve/main/detector.onnx After downloaded, put it into ~/.ifnude/detector.onnx

selfuppen avatar Jun 24 '23 16:06 selfuppen

I redownload the https://huggingface.co/s0md3v/nudity-checker/resolve/main/detector.onnx to the error path: C:\Users\Admin.ifnude/detector.onnx(find yours path in command.exe) This is where you block the location needed to download the file, the rest can be downloaded according to the command line prompts if the download is slow

xueqing0622 avatar Jun 25 '23 01:06 xueqing0622

Thanks, it works!!! the file "detector.onnx" in folder ".ifnude" is about 138MB, replace it by https://huggingface.co/s0md3v/nudity-checker/resolve/main/detector.onnx (139MB!!).

wakakmomo avatar Jun 29 '23 10:06 wakakmomo

我发现是下载模型过程中出现错误导致的。 确保下面三个路径下有这些模型。如果没有这些文件夹,可以先按照下面的路径创建相关文件夹。

  1. C:\Users\用户所在目录.ifnude

该路径下有Detector.onnx和classes模型,Detector.onnx的模型约为139mb。如果该路径下的模型大小不合适,请删除该目录下的模型,重新启动 sd webui ,就会自动下载。

  1. C:\Users\用户所在目录.insightface\models\buffalo_l

buffalo_l文件夹目录下有五个模型。您可以从下面的链接下载它们并将它们解压到 buffalo_l 目录中。

https://github.com/deepinsight/insightface/releases/download/v0.7/buffalo_l.zip

  1. 下载inswapper_128.onnx模型并将其放入 <webui_dir>/models/roop/ 目录中。

感谢,很有用,总算解决了这个问题

lindiny avatar Jul 06 '23 04:07 lindiny

This file https://huggingface.co/s0md3v/nudity-checker/resolve/main/detector.onnx was the same size as the one i already got. Still if i put it in the right folder, still most of my nsfw images are blocked by ROOP.

777Awesomesun avatar Jul 20 '23 21:07 777Awesomesun

Apparently there is a NSFW version for ROOP i'm downloading to try now. https://github.com/Gourieff/sd-webui-roop-nsfw

777Awesomesun avatar Jul 20 '23 21:07 777Awesomesun

I found that it was caused by an error in the process of downloading the model. Make sure there are these models under the three paths below. If you don't have these folders, you can first create related folders according to the path below.

  1. C:\ Users\ directory where the user resides\ .ifnude

There are detector.onnx and classes models under this path, and the model of detector.onnx is about 139mb. If the model under this path is not the right size, please delete the model in the directory, restart sd webui ,It will download automatically.

  1. C:\ Users\ directory where the user resides\ .insightface\ models\ buffalo_l

There are five models in the buffalo_l folder directory. You can download them from the link below and extract them to the buffalo_l directory.

Https://github.com/deepinsight/insightface/releases/download/v0.7/buffalo_l.zip

  1. download the inswapper_128.onnx model and put it inside <webui_dir>/models/roop/ directory.

Thank You, ITs WORK,

yzufardiansyah avatar Jul 30 '23 08:07 yzufardiansyah

I found that it was caused by an error in the process of downloading the model. Make sure there are these models under the three paths below. If you don't have these folders, you can first create related folders according to the path below.

  1. C:\ Users\ directory where the user resides\ .ifnude

There are detector.onnx and classes models under this path, and the model of detector.onnx is about 139mb. If the model under this path is not the right size, please delete the model in the directory, restart sd webui ,It will download automatically.

  1. C:\ Users\ directory where the user resides\ .insightface\ models\ buffalo_l

There are five models in the buffalo_l folder directory. You can download them from the link below and extract them to the buffalo_l directory.

Https://github.com/deepinsight/insightface/releases/download/v0.7/buffalo_l.zip

  1. download the inswapper_128.onnx model and put it inside <webui_dir>/models/roop/ directory.

Thank you very much! It is working!!

raiyan22 avatar Aug 06 '23 21:08 raiyan22

Thanks, unfortunately i cannot find the inswapper_128.onnx

tolinescu avatar Aug 22 '23 08:08 tolinescu

https://huggingface.co/s0md3v/nudity-checker/resolve/main/ detector.onnx 重新下载到错误路径: C:\Users\Admin.ifnude/ detector.onnx

太感谢了!!!!解决了,这是我第一次从这上面解决了问题

niubiwang avatar Sep 25 '23 12:09 niubiwang

@tolinescu same, i cannot find the inswapper_128.onnx too.

iielse avatar Mar 18 '24 09:03 iielse

大家检查一下pretrained_models的模型大小对不对,如果.onnx模型大小单位为byte,那就是git下来的模型有问题,正常应该是几十M,建议创建python文件,从modelscope下载模型。you should check the size of pretrained_models,if .onnx's size is kb,it means the size is not right,you can delete the pretrained_models fold and dowload it by followed in python

SDK模型下载

from modelscope import snapshot_download snapshot_download('iic/CosyVoice-300M', local_dir='pretrained_models/CosyVoice-300M') snapshot_download('iic/CosyVoice-300M-SFT', local_dir='pretrained_models/CosyVoice-300M-SFT') snapshot_download('iic/CosyVoice-300M-Instruct', local_dir='pretrained_models/CosyVoice-300M-Instruct') snapshot_download('iic/CosyVoice-ttsfrd', local_dir='pretrained_models/CosyVoice-ttsfrd')

Lu7-H avatar Aug 03 '24 09:08 Lu7-H