Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with the newer version of Stable Diffusion Forge #197

Open
kriimakt opened this issue Sep 3, 2024 · 10 comments
Open

Not working with the newer version of Stable Diffusion Forge #197

kriimakt opened this issue Sep 3, 2024 · 10 comments

Comments

@kriimakt
Copy link

kriimakt commented Sep 3, 2024

Mostly due to Gradio deprecated options (mostly Placeholder and file type) the extension doesn't work with Stable Diffusion Forge.

I managed, with my limited knowledge, to make it work with SDXL models, by changing "file" to "filepath". There still are many errors, but it works, most of the time.

When I try with Flux AI models, I only get a black square where the face is though. Any clue about how to fix this ? :)

@kriimakt
Copy link
Author

kriimakt commented Sep 3, 2024

I tried again, actually, everything works, except for auto inpainting after face swap. Can do it manually in img2img tab, but it doesn't work in extension :)

@Phantoxium
Copy link

I just transferred to Forge coming from A1111, where FaceSwapLab is working perfectly. However, I cannot get it installed properly in Forge. When I click on the arrow for FaceSwapLab in Txt2img or Img2img, the extension will not open up. I get the following error messages:

G:\Forge\webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_ui\faceswaplab_unit_ui.py:115: GradioDeprecationWarning: unexpected argument for File: optional
  batch_files = gr.components.File(
*** Error calling: G:\Forge\webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab.py/ui
    Traceback (most recent call last):
      File "G:\Forge\webui\modules\scripts.py", line 545, in wrap_call
        return func(*args, **kwargs)
      File "G:\Forge\webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab.py", line 109, in ui
        components += faceswaplab_unit_ui.faceswap_unit_ui(is_img2img, i)
      File "G:\Forge\webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_ui\faceswaplab_unit_ui.py", line 115, in faceswap_unit_ui
        batch_files = gr.components.File(
      File "G:\Forge\webui\modules\gradio_extensions.py", line 147, in __repaired_init__
        original(self, *args, **fixed_kwargs)
      File "G:\Forge\system\python\lib\site-packages\gradio\component_meta.py", line 163, in wrapper
        return fn(self, **kwargs)
      File "G:\Forge\system\python\lib\site-packages\gradio\components\file.py", line 98, in __init__
        raise ValueError(
    ValueError: Invalid value for parameter `type`: file. Please choose from one of: ['filepath', 'binary']

Any clue what the problem is and how to fix it?

@kriimakt
Copy link
Author

kriimakt commented Sep 4, 2024

You can fix it by looking for all the type="file" occurences in the extension scripts, and replacing them with type="filepath". There will be other errors, but most of the extension will work, except for inpainting. Can't help much for the rest, my Python skills are limited Considering the author hasn't worked on the extension for a year now, I guess it's your best course of action.

@GunnyNinja
Copy link

GunnyNinja commented Sep 4, 2024

You can fix it by looking for all the type="file" occurences in the extension scripts, and replacing them with type="filepath". There will be other errors, but most of the extension will work, except for inpainting. Can't help much for the rest, my Python skills are limited Considering the author hasn't worked on the extension for a year now, I guess it's your best course of action.

Can you specify the files you altered? Or even better, create a fork with your changes?

@Phantoxium
Copy link

@kriimakt: Thank you very much for your help! After reading your 1st post, I was not sure if we even had the same problem and which files exactly to change.

@GunnyNinja: You need to change the py-files in the sub-folders of "webui\extensions\sd-webui-faceswaplab\scripts". It's definitely "webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_ui\faceswaplab_unit_ui.py" and 1 or 2 others. Just open them in an editor, search for "type="file"", and replace with "type="filepath"". It will take you just a few minutes... There will be new error messages appearing, just like @kriimakt pointed out, but it works for me as well now. At least in Txt2img, I have not tested every function yet....

@kriimakt
Copy link
Author

kriimakt commented Sep 5, 2024

You can also try ReActor, another similar extension for A1111, it works fine with Forge. I prefer Faceswaplabs, but at least ReActor works 100%.

@Musigreg
Copy link

Musigreg commented Sep 9, 2024

I tried Kriimakt methods and it gives me a whole other pack of errors.
After that, no faceswap, and no saving the image either. It's stuck as a tmp file and doesn't produce the png.

Edit : I didn't have an upscaler selected... No issue.

@jandrop
Copy link

jandrop commented Sep 16, 2024

@GunnyNinja
Copy link

This fork works for me https://github.com/Ethereum-John/sd-webui-forge-faceswaplab

It works the same as one of the other forks I found, but just like with A1111, it does not output img2img to the folder.

@LucianoDaluz
Copy link

LucianoDaluz commented Oct 22, 2024

This fork works for me https://github.com/Ethereum-John/sd-webui-forge-faceswaplab

It works the same as one of the other forks I found, but just like with A1111, it does not output img2img to the folder.

It work with Flux as well, but Flux for people are not good. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants