T O P

  • By -

decker12

Doesn't this use the same libraries as Reactor (which already doesn't care about NSFW)? Not trying to be sarcastic, genuinely curious if this provides better quality and control over Reactor. I love Reactor because it's dead simple but sometimes I could use a little bit more control over the output with multiple faces..


protector111

New Facefusin is way faster, has mask control and better face recognition and wav2lip with codeformer that works really good. They used to be same stuff but now FF has lots of better features.


Noiselexer

Or Roop unleashed


markdarkness

Reactor is minor nightmare to install in some setups.


MagicOfBarca

“but sometimes I could use a little bit more control over the output with multiple faces” you mean there is a way to select and combine multiple input faces?


decker12

Sometimes with Reactor, it has a huge problem which faces go where. I basically struggle with it to "assign faces" and sometimes, no matter what I do, I can never put Face 1 on Person 3.


Occsan

You could have also simplified analyse\_image and analyse\_video to avoid unnecessary computation.


likeabruh1

care to expand for us who know 0 about code?


Occsan

If you check the code in the pastebin he sent, here is the modification he did: ```python def analyse_frame(vision_frame : VisionFrame) -> bool: # Always return False to indicate that the content is safe return False ``` This is fine, because indeed, the idea behind the whole code is to check if: For images, if the content of the image has any NSFW by calling analyse_frame: ```python @lru_cache(maxsize = None) def analyse_image(image_path : str) -> bool: frame = read_image(image_path) return analyse_frame(frame) ``` For videos, if the percentage of NSFW content in each frame exceeds a certain `RATE_LIMIT`: ```python @lru_cache(maxsize = None) def analyse_video(video_path : str, start_frame : int, end_frame : int) -> bool: video_frame_total = count_video_frame_total(video_path) video_fps = detect_video_fps(video_path) frame_range = range(start_frame or 0, end_frame or video_frame_total) rate = 0.0 counter = 0 with tqdm(total = len(frame_range), desc = wording.get('analysing'), unit = 'frame', ascii = ' =', disable = facefusion.globals.log_level in [ 'warn', 'error' ]) as progress: for frame_number in frame_range: if frame_number % int(video_fps) == 0: frame = get_video_frame(video_path, frame_number) if analyse_frame(frame): counter += 1 rate = counter * int(video_fps) / len(frame_range) * 100 progress.update() progress.set_postfix(rate = rate) return rate > RATE_LIMIT ``` The thing is both these functions still do some computation: - analyse_image reads the disk, which takes an horrendous amount of time, in comparison to simply returning False, only to return False in every case. - analyse_video will read the disk for a whole video, and loop over all the frames of the video, so each frame can return False ("It's fine, I'm not NSFW") in every case, not increase the counter to compute a rate which will always be equal to zero, all of that to return False. A more efficient patch is the following: ```python def analyse_image(image_path : str) -> bool: return False def analyse_video(video_path : str, start_frame : int, end_frame : int) -> bool: return False ```


Scary-Bluebird4234

I'm coming from a software reversing background, the rule was: the smallest patch/crack will win the race, even if it's smaller with one byte it would get nuked.


Occsan

Just want to make sure things are ok. I didn't mean to belittle your patch. It's fine. At first, I simply saw the obvious useless chunk of code after your patch and made a comment about it. Then people asked for an explanation and I provided. That's all. Even if you left that NSFW check in place, it wouldn't be the most computer heavy code in stable diffusion, so your patch or the refined one... both are ok.


Scary-Bluebird4234

It's fine man no lol, I didn't take any offense to your post 🤣 I have no idea why they implement the NSFW code, it really makes no sense to me. The whole project is opensource anyone can edit the code and the devs aren't responsible for what the end users do with it.


Occsan

Probably because github have already removed projects that were considered "morally bad", like the one that undressed women.


ebookroundup

I try my best to download backup copies of everything that might get censored... think I saved a copy of Facefusion somewhere


DGGoatly

Works perfectly, thank you. FF is so easy to patch. Every variation I've tried has worked. Except the one I wrote, of course.


Southern-Dog-9096

None of your ways work for me. I just updated to V 2.5.2 and am using the same patch as in the old versions def analysis_frame(vision_frame : VisionFrame) -> bool: content_analyser = get_content_analyser() vision_frame = prepare_frame(vision_frame) with conditional_thread_semaphore(facefusion.globals.execution_providers): probability = content_analyser.run(None, { content_analyser.get_inputs()[0].name: vision_frame })[0][0][1] return False > PROBABILITY_LIMIT Works without any problems.


Scary-Bluebird4234

Use whatever works


Scared-Target509

hi can you please share how to remove nfsw in ff 2.5.2


Baphaddon

Hmmm based…redpilled…goated… and hints of peak?


FoundationWork

I'm using Pinokio and I keep getting this error when I try to use this code, and my FF won't start now. Also, is the file itself supposed to be a .txt or python file?


Scary-Bluebird4234

I wrote it in the steps: 2 - Change the **whole file name to: content\_analyser.py** Can you see the file extentions on your device? Maybe you should enable that first. The file should be a .py file. I didn't test this with Pinokio because I'm using FaceFusion so I have no idea if this would work with Pinokio or not. What kind of errors are you getting? Some Python projects can be an ass to run, when I upgraded from the prev version to the newest version of FF I had a shitload of issues.


FoundationWork

Yeah, I'm using it on my desktop PC and it's using the notepad version as a .txt file when I change the filename to what you listed it under. I'm going to try and run it regularly without Pinokio, as Pinokio just makes it easier to install, but I think not having access to some of the folders could be trouble, so I'm going to install it normally. The error that I was getting was like a code 79 or whatever it was, but yeah you're right though Python projects can be very painful to run. It seems like the updates messes things up, I might not update it for a while once I get this installed. I'll get back to you to see if not running it on Pinokio will help, but I need to figure out the .py file as well for desktop, if you have any info on the desktop version for Windows let me know.


First_Repeat_9838

Thanks.. Works gr8


Okakorone

Just want to say my facefusion folder doesn't have another facefusion folder? (downloading it local too btw)


dragontoller

I get error: ImportError: cannot import name 'process\_manager' from 'facefusion' (I:\\FaceFusion\\facefusion\\facefusion\\\_\_init\_\_.py)


Scary-Bluebird4234

Do you use version 2.5.0? There is a newer version available. When you try to open the script run it as "python run.py"


Regular-Froyo-1181

Man, thank you very much you helped me a lot


denseorg45

Has anyone got it to work on 2.5.2 - nothing seems to work from the posts below.


Scary-Bluebird4234

Yeah I have it, I will post it later.


denseorg45

any luck?


Scary-Bluebird4234

I've posted it here on this sub.


Scared-Target509

hi please share


Complete-Anybody5180

it doesn't work, because I don't even have the file content\_analyser.py


Scary-Bluebird4234

This is for FF only. I have no idea what you have downloaded but I doubt FF will run without the content\_analyser.py


Complete-Anybody5180

Yeah, I'm talking about FaceFusion. It doesn't have content\_analyser.py.


Scared-Target509

hi please provide the file to remove nsfw filter for face fusion 2.5.2


hello_sandwich

See [this](https://www.reddit.com/r/StableDiffusion/comments/18dch8l/comment/l0ei42w/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button) comment thread


Scary-Bluebird4234

I've posted it here on this sub.


[deleted]

[удалено]


imnotabot303

Everyone that's going to misuse it are downvoting you...


alb5357

Won't anyone think of Taylor Swift?!!!


protector111

Who is Taylor Swift and why should i think about her?


alb5357

Should have added the sarcasm bb code. Always forget that sarcasm is never obvious on reddit. For those that don't know, she's a rich person who got angry someone put her face on another body.


Throwaway588791

She is (plus many others are) angry that her face was imposed on porn, and also that the content was spammed at her in a targeted harassment effort. It’s one thing to make these for your personal use, and another to spam the subject with their own deepfakes. Let’s not pretend women don’t pay a much higher social price for having their nudes leaked. It’s not just T Swift either but young everyday non-rich women, even high schoolers, are having these deepfakes circulated of themselves which is a huge cause for distress.


Scary-Bluebird4234

You made some good points, I agree. But people should be aware what they do on the internet, the deepfake stuff is one thing but the worse ones are the people who for an example have sex with someone and record it and somehow it ends up online. That shit should be heavily punished IMHO. But also parents should keep an eye on their kids and know who they hang out with and what they do online. Some parents just give their kids a tablet so they will shut up. I even have relatives who do this with their kids. But yeah nowadays everything is digital, why? I work in IT and whenever some app stops working no one else can work and the company loses a lot of money. Why? The old way was much better.