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

[REQUEST] Input an image of the face we want to use as replace. #38

Open
ZeroCool22 opened this issue Apr 1, 2023 · 11 comments
Open

[REQUEST] Input an image of the face we want to use as replace. #38

ZeroCool22 opened this issue Apr 1, 2023 · 11 comments

Comments

@ZeroCool22
Copy link

Instead, just using a prompt give us the option to use a face/picture we want to use as base to be replaced on the output pictures.

I saw a web some time ago hat does it, and was excellent.
So we can do faceswap not only for famous ppl.

@Echolink50
Copy link

I am looking for the same thing

@kex0
Copy link
Owner

kex0 commented Apr 1, 2023

I’m sorry but using pictures as a face replacement is out of scope of this project. This project is an extension for stable diffusion and is focused on generating faces with stable diffusion so if you want it to generate unique faces that it doesn't know, you should train it.

@Echolink50
Copy link

I’m sorry but using pictures as a face replacement is out of scope of this project. This project is an extension for stable diffusion and is focused on generating faces with stable diffusion so if you want it to generate unique faces that it doesn't know, you should train it.

I'm not sure what Zerocool22 is trying to do but I would just like a way to specify a folder of cropped faces to be used just like you can specify a folder of images you watch to have the face swapped on. Seems simple enough. Even if you can tell us the part of the code that tells the automatic1111 where to get the prompt generated face it could probably be modified to point to an existing directory instead of where ever the prompted face is stored before being swapped on to the image. Thanks

@kex0
Copy link
Owner

kex0 commented Apr 1, 2023

I just don't see how this would work. How would it select the right face from the folder that would fit the image. Assuming you even have the right picture. You would have to have a massive library of the face with all the different angles and lighting conditions otherwise it would not fit the rest of the image. At that point you can just train the SD model.

@Echolink50
Copy link

I just don't see how this would work. How would it select the right face from the folder that would fit the image. Assuming you even have the right picture. You would have to have a massive library of the face with all the different angles and lighting conditions otherwise it would not fit the rest of the image. At that point you can just train the SD model.

Same way the mask works. Just have the same name 0001.jpg face on 0001.jpg image

@kex0
Copy link
Owner

kex0 commented Apr 1, 2023

Oh gotcha. I'll think about it.

Still it would somehow have to do automatic color correction

@Echolink50
Copy link

In my use case the faces would already be cropped and color matched. I think trying to make the extension do all that is definitely asking to much. I only ask for this small feature because it seemed like it would be relatively easy to implement. Just a folder of faces the extension can look to if you don't want the text generated face.

@kex0
Copy link
Owner

kex0 commented Apr 1, 2023

Here try this branch:
https://github.com/kex0/batch-face-swap/tree/existing_face

A very rough piece of code that maybe does what you want. I have no way to test it.

image (2)

@Echolink50
Copy link

Will try it out this evening. Thanks my friend

@Echolink50
Copy link

Here try this branch: https://github.com/kex0/batch-face-swap/tree/existing_face

A very rough piece of code that maybe does what you want. I have no way to test it.

image (2)

The branch functions as expected. Additional settings for masks and things would be a welcomed addition. Thank you for your efforts

@2blackbar
Copy link

The existing face things is interesting idea, a code that detects closest face angle and tries to match them and paste onto image could be interesting or a fail cause light wouldnt match , but if its from same photshoot, who knows

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

4 participants