C0untFloyd / roop-unleashed

Evolved Fork of roop with Web Server and lots of additions
GNU Affero General Public License v3.0
2.13k stars 495 forks source link

Select different Source Face image = Not update to the selected face when Refresh Preview #98

Closed AlonDan closed 1 year ago

AlonDan commented 1 year ago

Describe the bug When loading 1 source face to and press Preview it works, The moment you add extra faces and SELECT different face via the Face Swap section when pressing Refresh it will NOT change to the selected face but remain on the first face that loaded.

The only way to make it work at the moment is to REMOVE any other faces and leave the one that you want, only then REFRESH PREVIEW will work fine.

To Reproduce Steps to reproduce the behavior:

  1. Load 1 Source Face image
  2. Load a target image or video
  3. Enable "Face Swap frames"
  4. Press Refresh, you will see the source face on the target (so far so good 👍)
  5. ADD 1 or more Source Face images (by drag and drop more faces)
  6. SELECT a any other face you just loaded
  7. Press Refresh, the preview will NOT use the selected face, but only the first one ❌

Details What OS are you using?

Are you using a GPU?

Which version of roop unleashed are you using? Latest main 2.7.2

C0untFloyd commented 1 year ago

Currently the source face selection really is just for being able to remove it. If you want to preview a specific face with a specific source face you would have to select them all and change swapping mode to "selected". However your idea would be nice to have for the "first" swapping mode and the live cam.

AlonDan commented 1 year ago

It just feel that the Preview is not working with other faces (not updated) unless I have one face (in any mode, it's a Preview after all, helps to test before commit to a long render of many frames within a video). Nice example is the original non-Gradio (beside the fact that the preview window used to be closed) but it updates the source face, not to compare but I believe that in ROPE it's also the case (without refreshing) it just update the face or multi-faces the moment you change selection.

Suggestion (not fully related) It will be nice also if "Swap Face" will be on by default, it make sense and toggle it off to test original just in case. but that could be added to setting in general to keep DEFAULT of any parameter by default which is nice.

Maybe also allow to save Main preset of all settings such as source faces (already load automatically if you use the same in many tests, etc..)

I never tried the live camera yet, but it could be interesting I should try it :)

C0untFloyd commented 1 year ago

You should definitely update to 2.7.3, as there is a checkbox now if you want to have the faceswap always on in preview. Also some hours ago I implemented your idea with the selected input face being used in swap mode 'first'. Didn't have time to implement it for the real swapping but will certainly do.

Always on by default would kill my machine with everything turned on, that's why I want it on demand.

Presets? Perhaps not for stuff like face distance but faces/biometrics is intriguing. There is a certain SD roop extension which saves faces (the landmarks) and even mixed, blended faces into a very small tensor checkpoint. Didn't try it though but definitely interesting.

AlonDan commented 1 year ago

Thanks for the update I will check it out! ❤

This is a bit off-topic, I didn't want to open a new thread for it but I'm wondering if there is something you can do about it:

In the latest old NONE-Gradio (Windows GUI) of Roop-Unleashed I got so much faster results than the Gradio one. that's why I still use the latest GUI one on my machine as my favorite.

Is it because it extract the frames first and then start processing? while Gradio do 1 frame by 1 or anything different?

I wonder if there is a way to make the Gradio one as FAST as the Windows GUI latest version.

C0untFloyd commented 1 year ago

There's sort of a discussion here #103

AlonDan commented 1 year ago

I just tried the latest version 2.7.5 This is still not working, if I have 2 or more faces loaded on the Face Swap section.

When I select any of them, and Refresh or Disable then Enable "Face Swap Frames" it still only use the very first LOADED (or drag & drop) Source Face.

The only way to make it change a face is by REMOVE all other faces, so it have no choice to use the only once exist face.

A good example how it's done with many faces is what they do on ROPE, whenever you select ANY of the loaded source faces it immediately refresh the preview.

At the moment it is very weird to REMOVE all faces beside of the one I need, or remove all and drag & drop the one I want, I hope that you'll consider to improve this, thanks ahead! 🙏