sd-webui-roop
sd-webui-roop copied to clipboard
bug in faceswap.py
in past days I used this extension without problems, today I am having this issue:
Error running process: /media/gm/ext/stable-diffusion-webui/extensions/sd-webui-roop/scripts/faceswap.py Traceback (most recent call last): File "/media/gm/ext/stable-diffusion-webui/modules/scripts.py", line 451, in process script.process(p, *script_args) File "/media/gm/ext/stable-diffusion-webui/extensions/sd-webui-roop/scripts/faceswap.py", line 153, in process int(x) for x in faces_index.strip(",").split(",") if x.isnumeric() AttributeError: 'bool' object has no attribute 'strip'
I try to remove the folder and to reinstall the extension from automatic1111 extension tab but it didnt worked.
Any idea to fix this?
It doesnt work only in txt2img but it works well in img2img
@GianlucaMattei Did you change anything in the code?
I have been using this extension for more than a week and I have never encountered this error. Moreover, I check and found out that its not possible for the variable face_index to be a boolean. I don't whats wrong on your end.
@s0md3v The same thing is happening to me. It was working well, but I updated roop with the extension tab, and stop working on Text to Img.
"Swap in source image" and "Swap in generated image" text and checkboxes are not showing on Text to Img, but showing on img to img.
I just reinstall Stable Difussion from 0 and roop extension again and still the same. I'm sure it was an update that caused this bug.
@ramnnv I read your comment, deleted the ext and reinstalled it. It works for me.
Maybe your webui version is old, idk.
Although I have no error, I can see Roop in UI. I see that extension loads, but enabling it makes no effect.
I had to revert to ccca35e43a40ba4ff078d4667d09cc3402db31af, roop no longer works with text2img after changes in commits on Jun 22, 2023
I'll do some additional tests later.
automatic1111: commit baf6946e06249c5af9851c60171692c44ef633e0 (HEAD -> master, tag: v1.3.2, origin/master, origin/HEAD)
UPDATE:
Works after updating all the other extensions first and then updating roop.
The only warning in my console is from ControlNet, even if it is not enabled.
ControlNet - WARNING - No ControlNetUnit detected in args. It is very likely that you are having an extension conflict.Here are args passed to ControlNet: (<scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x170916f50>,).
Maybe related, maybe not, who knows.
Looking through the code I noticed that swapper.py uses the variable fn, and the extension ControlNet also uses the same variable for some of its functions. As a test I changed fn to fnn, since I couldn't find that variable in use, and both ControlNet and Roop started working with txt2img.
My Python level of understanding is about as low as it gets, but hopefully that points someone in the right direction.
@GianlucaMattei Did you change anything in the code?
I have been using this extension for more than a week and I have never encountered this error. Moreover, I check and found out that its not possible for the variable face_index to be a boolean. I don't whats wrong on your end.
Absolutely not :-(
EDIT: updating a1111 fixed the problem
Error running postprocess_batch: E:\sd-webui-aki-v4\extensions\sd-webui-roop\scripts\faceswap.py Traceback (most recent call last): File "E:\sd-webui-aki-v4\modules\scripts.py", line 496, in postprocess_image script.postprocess_image(p, pp, *script_args) File "E:\sd-webui-aki-v4\extensions\sd-webui-roop\scripts\faceswap.py", line 183, in postprocess_image result: ImageResult = swap_face( File "E:\sd-webui-aki-v4\extensions\sd-webui-roop\scripts\swapper.py", line 109, in swap_face converted = convert_to_sd(target_img) File "E:\sd-webui-aki-v4\extensions\sd-webui-roop\scripts\cimage.py", line 6, in convert_to_sd chunks = detect(img) File "E:\sd-webui-aki-v4\py310\lib\site-packages\ifnude\detector.py", line 46, in detect detection_model = onnxruntime.InferenceSession(model_path, providers=["CPUExecutionProvider"]) File "E:\sd-webui-aki-v4\py310\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 383, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "E:\sd-webui-aki-v4\py310\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\Administrator.ifnude/detector.onnx failed:Protobuf parsing failed.
ERROR Module load: D:\AI\seait_installers_version\automatic\extensions\sd-webui-roop\scripts\faceswap.py: SyntaxError Module load: D:\AI\seait_installers_version\automatic\extensions\sd-webui-roop\scripts\faceswap.py: SyntaxError ╭───────────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────────╮ │ D:\AI\seait_installers_version\automatic\modules\script_loading.py:13 in load_module │ │ │ │ 12 │ try: │ │ ❱ 13 │ │ module_spec.loader.exec_module(module) │ │ 14 │ except Exception as e: │ │ in exec_module:879 │ │ │ │ ... 1 frames hidden ... │ │ in source_to_code:947 │ │ in _call_with_frames_removed:241 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ D:\AI\seait_installers_version\automatic\extensions\sd-webui-roop\scripts\faceswap.py:23 │ │ <<<<<<< Updated upstream │ │ ▲ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ SyntaxError: invalid syntax
Please use the latest version of webui.
I tried with ImgtoImg but Face doesn't swap with uploaded reference face instead I get random faces including females which not making any sense
I even tried with inpaint but there no Faceswap
I am also having no luck in txt2img, but I have found that for inpainting turning the Denoising Strength down to .01 gives the desired result.
Hopefully this can help the previous poster (if nobody else).
the problem is still in happening, please reopen the issue, it doesn't have any effect on the result, using up-to-date with git pull sd.next