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.17k stars 235 forks source link

[Feature]: API | Faceswap on person with transparent background #394

Closed Dutch77 closed 2 months ago

Dutch77 commented 2 months ago

Feature description

Currently there is no way of swap face on cropped people because transparent colors become black.

Can we somehow achieve faceswap image with transparent background?

This would be super useful for working with masks.

Gourieff commented 2 months ago

Sorry if I got it wrong, but as I mentioned here https://github.com/Gourieff/sd-webui-reactor/issues/382 this is not the issue of ReActor, it can handle RGBA in Extras, but it's the Issue of SD WebUI because it cuts Alpha channel for images provided via the Extras Tab But if you try to apply this fix (https://github.com/Gourieff/stable-diffusion-webui-forge/compare/main...Gourieff:stable-diffusion-webui-forge:extras--allow-png-rgba) - you'll achieve this result: https://github.com/Gourieff/sd-webui-reactor/issues/382#issuecomment-1986727354 And btw you can work with RGBA via ComfyUI by creating the pipeline with ReActor + Masking (cut what ReActor swapped by masking the face and past into the original transparent image)

Dutch77 commented 2 months ago

I'm using API and it produces same result. Is webui also to blame?

Gourieff commented 2 months ago

No, ReActor's API needs to be improved to support RGBA I will implement this soon