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.56k stars 278 forks source link

[Feature]: Simswap support. #261

Open nDman opened 11 months ago

nDman commented 11 months ago

Feature description

Can you add support for Simswap models?

Gourieff commented 11 months ago

Yes, but the inswapper model has much better accuracy

nDman commented 11 months ago

Really? 128 inswapper is better than 512 simswap? I really don't have experience with simswap, I just saw some people saying it has better quality. That's why I am asking for, but if there is not much improvement by it don't bother yourself I'm fine and grateful for you amazing extension.

Gourieff commented 11 months ago

All of these models need additional face enhancement to provide really good results, therefore the resulting quality is almost the same - but Inswapper has better accuracy and the resulted face turns out much more similar to the original

Just a quick test of SimSwap512+CodeFormer vs Inswapper128+CodeFormer

изображение Untitled-1

nDman commented 11 months ago

This is amazing, thanks for explaining this.

thezveroboy commented 11 months ago

May I assume that the comparison examples are made in Reactor? And there are no problem adding support for other models besides inswapper_128 to the Reactor?

I have a set of models for changing faces from Simswap, Ghost, Inswapper and others. But they do not start automatically, apparently code changes are needed

The reason I'm asking this is because the owners of the rights to the inswapper model are currently being very aggressive towards those who use their model

jnpatrick99 commented 9 months ago

Simswap512 is not accurate, but Simswap256 is accurate and produces better quality than inswapper_128. I tested with facefusion. Would be really cool if you could support those models.

TaiTair commented 6 months ago

It has been months and still no progress on this. So I took it in my own hands and did a "dirty" implementation of simswap using @Gourieff's code and the official simswap repo. Find it here: https://github.com/TaiTair/comfyui-simswap

I did not figure out the difference in tensors between the models that reactor uses and the models that simswap uses so I had to copy a bunch of the simswap code and integrate it into reactor. AFAIK it works and might even work with Ghost(untested). I tested it succesfully with simswap and uniface. I'm not planning to maintain my implementation so if anyone wants to get the repo from me feel free to reach out.