新一代开源 免费 AI换脸神器 FaceFusion 2.6.1支持AMD显卡+N卡 速度更快,效果更惊艳 操作更简单 附视频演示

视频处理  人工智能  AI  换脸  人脸替换
开源 2458 150692

其实我一直有个想法,想单独把这个facefusion整合一下,想法已久但是一直都没有付诸于行动。这次算是补上了。

最新facefusion是2.6.1。本来万能君已经整合了这个工具,但是我觉得他的那个工具有点臃肿了。虽然好用,但是我这个人貌似有点强迫症。所以才有了这个单独出来的整合包了,估计还是有不少小伙伴可能会有跟我一样的想法?其实整合包越来越大主要是模型文件越来越多也越来越大。

这个整合包我早段时间就做好了,又自己测试了几天,按理来说应该没什么问题了,如果各位小伙伴在玩的时候有什么问题 可以留言告知一下。

先看演示吧,为了不侵犯他人的肖像之类的东西,我就只放换脸后的视频。各位参考参考,下图是AI生成的2个小姐姐,替换视频的里面的脸


下面来讲下 详细操作 点击启动后就是这么一个黑洞洞的窗口

PixPin_2024-04-25_07-26-16.png

然后打开一个链接

http://127.0.0.1:7860 这个链接在黑窗口那里复制即可

需要手动复制在浏览器里面打开

然后出来这样一个界面

PixPin_2024-04-25_07-25-45.png

经群里网友提示 简单从万能君那里复制了下翻译

PixPin_2024-04-25_07-27-44.png

其实我个人觉得这些都是简单的英文单词,一般都认识如果实在是不认识也可以用浏览器翻译下

完全没有必要去单独做汉化了

下面已经就是正经开始操作

点这里选择你要换的脸

这里选择你要换的视频,然后输出质量选100

PixPin_2024-04-25_07-29-55.png

PixPin_2024-04-25_07-31-22.png

比如我换的这个小姐姐的视频 其他都不要动。点最下面的开始

看到开始读秒就说明开始了,在黑洞洞那个窗口也会有各种文字滚动

1714001520633478.png

等完成以后 会有提示Processing to video succeed

PixPin_2024-04-25_07-38-04.png

点击如图所示的地方 把视频保存到你要保存的地方

PixPin_2024-04-25_07-39-06.png

视频也会自动保存在整合包里面的output目录下。

操作就是这么简单。其他参数都默认即可 不要动。第一次运行会慢一些,因为会自动下载一些对应的模型,请耐心等待,下载好后以后再运行就速度很快了。

下面是我使用了这个工具几天的一点心得。

首先 换脸的文件 不要有中文名字和中文路径,否则很容易报错

其次 电脑的用户名 一定要是英文,否则也会报错

再次 换脸的图片 必须是正面 而且要高清一点点,如我上面的小姐姐所示,可以参考下

否则就会提示这个错误

因为我的显卡是A卡,又是比较老旧的A卡 rx580了 所以不支持用显卡来跑,只能用cpu慢慢跑。但是效率也还可以。


 现在已经已经支持了A卡,显卡效率远超CPU。

下面是进阶教程。

这个工具启动后有很多默认的参数,如果你想修改这些参数,可以用记事本打开运行.bat这个文件,记得先备份好这个文件

call py310\python.exe run.py --skip-download --temp-frame-format png --output-video-quality 100 -o output --system-memory-limit 24 --output-video-preset superfast --frame-processors face_swapper face_enhancer --face-enhancer-model restoreformer_plus_plus --face-swapper-model uniface_256 --execution-thread-count 8 --face-detector-model retinaface --face-detector-size 160x160,320x320

找到如上一段代码,下面是这段代码的解释

--skip-download: 这个参数可能表示跳过下载某些资源或数据。

--temp-frame-format png: 临时帧的格式设置为PNG。

--output-video-quality 100: 输出视频的质量设置为100(通常是最高质量)。

-o output: 设置输出目录或文件名为 output。

--system-memory-limit 24: 系统内存限制设置为24GB(或可能是其他单位,具体取决于脚本如何实现)。

--output-video-preset superfast: 输出视频的预设设置为“superfast”,这通常与视频编码速度有关,可能牺牲了一些质量以获得更快的编码速度。

--frame-processors face_swapper face_enhancer: 指定两个帧处理器:face_swapper 和 face_enhancer,它们可能分别用于人脸交换和人脸增强。

--face-enhancer-model restoreformer_plus_plus: 为 face_enhancer 帧处理器指定模型为 restoreformer_plus_plus。

--face-swapper-model uniface_256: 为 face_swapper 帧处理器指定模型为 uniface_256。

--execution-thread-count 8: 执行线程数设置为8,这意味着脚本将使用8个线程来并行处理。

--face-detector-model retinaface: 指定人脸检测模型为 retinaface。

--face-detector-size 160x160,320x320: 人脸检测器的大小或分辨率设置为160x160和320x320两种尺寸。

这些注释我懒得去手动打字了,用AI帮我注释的,我大致看了下没什么大问题,估计各位小伙伴都能看明白就行了,更改这些参数就可以更改facefusion启动后的默认参数

我举个例子 你们就明白了

--face-swapper-model uniface_256 如果想改一个默认的模型 可以改成

--face-swapper-model inswapper_128 这样启动后的默认模型就改了

其他就看你们自由发挥了,想获取更详细的参数说明可以去看官方开源项目那里看看了。

请勿将该工具用于任何非法行为,由此产生的一切后果自负

视频演示点击这里

 facefusion A卡版下载地址

facefusion N卡版下载地址 请20240625之前下载N卡的小伙伴重新下载即可避免各种错误

有疑问 先看下面的教程

https://www.myhelen.cn/helen/240.htm

https://www.myhelen.cn/helen/242.htm

https://www.myhelen.cn/helen/246.htm

https://www.myhelen.cn/helen/250.htm 最新N卡教程

有问题 需要解答,请先告知自己的显卡参数以及下载的是哪个版本,我没有未卜先知的能力,上面的教程麻烦先看看再问!

下面是几个必须要安装的软件否则运行不了

运行库不管是什么卡都要安装

https://www.jian27.com/html/2290.html

AMD显卡 AMD HIP SDK必须安装

下载地址

https://pan.quark.cn/s/f5f86d769394

https://drive.uc.cn/s/eab589fe1a1d4

https://pan.baidu.com/s/1c65OrFR18AuHOvTH56Yu7Q?pwd=6666



下载有疑问看下这里

相关推荐:

我要评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

已有 2458 条评论

  1. 钢笔老迟到 钢笔老迟到

    挺不错的,谢谢

  2. 黑裤威武 黑裤威武

    66

  3. 画笔务实 画笔务实

    希望能打开

  4. 盼望多情 盼望多情

    6666

  5. 丰富用红牛 丰富用红牛

    798hi

    1. 苗条的美女 苗条的美女

      很好

  6. 标致等于白猫 标致等于白猫

    感谢分享

  7. 花瓣辛勤 花瓣辛勤

    77777777777777777

  8. 刻苦踢嚓茶 刻苦踢嚓茶

    来了来了

  9. 丰富踢背包 丰富踢背包

    666

  10. 苗条喜悦 苗条喜悦

    66666

  11. 蓝天天真 蓝天天真

    6666

  12. 犹豫用御姐 犹豫用御姐

    感谢分享~~~~~~~~~~~~~

  13. 棒棒糖称心 棒棒糖称心

    非常感谢大佬分享

  14. 玩命与戒指 玩命与戒指

    来了来了

  15. 手套害羞 手套害羞

    楼主好人一生平安

  16. 笑点低方荷花 笑点低方荷花

    真的很牛逼感谢!!!

  17. 巴巴拉拉 巴巴拉拉

    大佬谢谢了

  18. 粗心扯眼神 粗心扯眼神

    迅雷云盘呢?

  19. 粗心扯眼神 粗心扯眼神

    牛逼格拉斯

  20. 乐曲受伤 乐曲受伤

    66666666666666666

  21. 唇膏舒心 唇膏舒心

    谢谢分享

  22. 高兴闻镜子 高兴闻镜子

    66666666666666666666666

  23. 聪慧踢机器猫 聪慧踢机器猫

    我的GPU是4070S,安装的文章附件提供的12.2CUDA,但是还是提示我CUDA和CUDNN版本不正确

    2024-06-23 09:19:42.0390428 [E:onnxruntime:Default, provider_bridge_ort.cc:1548 onnxruntime::TryGetProviderInfo_CUDA] D:\a\_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1209 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "D:\facefusion2.6.1N\jian27\lib\site-packages\onnxruntime\capi\onnxruntime_providers_cuda.dll"
    
    *************** EP Error ***************
    EP Error D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:857 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.
    when using [('CUDAExecutionProvider', {'device_id': '0', 'cudnn_conv_algo_search': 'DEFAULT'})]
    Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying.
    ****************************************
    2024-06-23 09:19:42.0649528 [E:onnxruntime:Default, provider_bridge_ort.cc:1548 onnxruntime::TryGetProviderInfo_CUDA] D:\a\_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1209 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "D:\facefusion2.6.1N\jian27\lib\site-packages\onnxruntime\capi\onnxruntime_providers_cuda.dll"
    
    Traceback (most recent call last):
    File "D:\facefusion2.6.1N\jian27\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 419, in __init__
    self._create_inference_session(providers, provider_options, disabled_optimizers)
    File "D:\facefusion2.6.1N\jian27\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 483, in _create_inference_session
    sess.initialize_session(providers, provider_options, disabled_optimizers)
    RuntimeError: D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:857 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.
    

    1. 剑心 剑心

      我没有N卡,无法给你答案。你可以下载文中的N卡链接试试另外一个工具

  24. 聪慧踢机器猫 聪慧踢机器猫

    大部分顺利安装了,只有最后提示这个

    ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    gradio 3.50.2 requires numpy~=1.0, but you have numpy 2.0.0 which is incompatible.

  25. 称心保卫茉莉 称心保卫茉莉

    66666666

  26. 漂亮踢樱桃 漂亮踢樱桃

    感谢分享

  27. 明理保卫啤酒 明理保卫啤酒

    5555555555555555555555

  28. 聪慧踢机器猫 聪慧踢机器猫

    CUDA12.2已经安装成功,但还是运行错误

    [E:onnxruntime:Default, provider_bridge_ort.cc:1548 onnxruntime::TryGetProviderInfo_CUDA] D:\a\_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1209 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "D:\facefusion2.6.1N\jian27\lib\site-packages\onnxruntime\capi\onnxruntime_providers_cuda.dll"

    *************** EP Error ***************
    EP Error D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:857 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.
    when using [('CUDAExecutionProvider', {'device_id': '0', 'cudnn_conv_algo_search': 'DEFAULT'})]
    Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying.

  29. 小伙单薄 小伙单薄

    感谢大佬分享!

  30. 聪慧踢机器猫 聪慧踢机器猫

    感谢,不知道这个是换五官还是脸型一起换呢

  31. 过客现实 过客现实

    5465123156410跪谢大佬!

  32. 笑点低爱大山 笑点低爱大山

    ganxiefenxiang

  33. 煎饼会撒娇 煎饼会撒娇

    感谢大佬的分享

  34. 高挑演变鸡翅 高挑演变鸡翅

    感谢大佬

  35. 黑米纯真 黑米纯真

    6666666

  36. 刺猬笑点低 刺猬笑点低

    牛逼

  37. 靓丽扯枫叶 靓丽扯枫叶

    挺不错啊

  38. 明理笑白猫 明理笑白猫

    请问这种报错是啥原因导致的,谢谢
    File "C:\AI\facefusion2.6.0A\facefusion\content_analyser.py", line 107, in analyse_video
    if analyse_frame(frame):
    File "C:\AI\facefusion2.6.0A\facefusion\content_analyser.py", line 75, in analyse_frame
    probability = content_analyser.run(None,
    File "C:\AI\facefusion2.6.0A\env\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 220, in run
    return self._sess.run(output_names, input_feed, run_options)
    onnxruntime.capi.onnxruntime_pybind11_state.Fail

    1. 剑心 剑心

      安装一下cuda试试

      1. 明理笑白猫 明理笑白猫

        哦哦,我的是集显,下载的A卡版本,选了dml和CPU,是不是跟CUDA没啥关系?谢谢

        1. 剑心 剑心

          只能选cpu

  39. 冷傲爱指甲油 冷傲爱指甲油

    666

  40. 毛衣微笑 毛衣微笑

    2 0 2 4 - 0 6 - 2 2 2 1 : 1 8 : 5 0 . 8 6 2 9 7 6 2 [ E : o n n x r u n t i m e : D e f a u l t , p r o v d e r _ b r i d g e _ o r t . c c : 1 5 4 8 o n n x r u n t i m e : : T r y G e t P r o v i d e r I n f o _ C U D A ] D : \ a \ _ w o r k \ 1 \ s \ o n n x r u n t i m e \ c o r e \ s e s s i o n \ p r o v i d e r _ b r i d g e _ o r t . c c : 1 2 0 9 o n n x r u n t i m e : : P r o v i d e r L i b r a r y : : G e t [ O N N X R u n t i m e E r r o r ] : 1 : F A I L : L o a d L i b r a r y f a i l e d w i t h e r r o r 1 2 6 " " w h e n t r y i n g t o l o a d " D : \ f a c e f u s i o n 2 . 6 . 1 \ j i a n 2 7 \ l i b \ s i t e - p a c k a g e s \ o n n x r u n t i m e \ c a p i \ o n n x r u n t i m e _ p r o v i d e r s _ c u d a . d l l "

    *************** EP Error ***************
    EP Error D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:857 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.
    when using [('CUDAExecutionProvider', {'device_id': '0', 'cudnn_conv_algo_search': 'DEFAULT'})]
    Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying.
    ****************************************
    2 0 2 4 - 0 6 - 2 2 2 1 : 1 8 : 5 1 . 0 9 7 0 6 7 3 [ E : o n n x r u n t i m e : D e f a u l t , p r o v d e r _ b r i d g e _ o r t . c c : 1 5 4 8 o n n x r u n t i m e : : T r y G e t P r o v i d e r I n f o _ C U D A ] D : \ a \ _ w o r k \ 1 \ s \ o n n x r u n t i m e \ c o r e \ s e s s i o n \ p r o v i d e r _ b r i d g e _ o r t . c c : 1 2 0 9 o n n x r u n t i m e : : P r o v i d e r L i b r a r y : : G e t [ O N N X R u n t i m e E r r o r ] : 1 : F A I L : L o a d L i b r a r y f a i l e d w i t h e r r o r 1 2 6 " " w h e n t r y i n g t o l o a d " D : \ f a c e f u s i o n 2 . 6 . 1 \ j i a n 2 7 \ l i b \ s i t e - p a c k a g e s \ o n n x r u n t i m e \ c a p i \ o n n x r u n t i m e _ p r o v i d e r s _ c u d a . d l l "

    Traceback (most recent call last):
    File "D:\facefusion2.6.1\jian27\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 419, in __init__
    self._create_inference_session(providers, provider_options, disabled_optimizers)
    File "D:\facefusion2.6.1\jian27\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 483, in _create_inference_session
    sess.initialize_session(providers, provider_options, disabled_optimizers)
    RuntimeError: D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:857 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
    File "D:\facefusion2.6.1\run.py", line 6, in
    core.cli()
    File "D:\facefusion2.6.1\facefusion\core.py", line 112, in cli
    run(program)
    File "D:\facefusion2.6.1\facefusion\core.py", line 234, in run
    ui.launch()
    File "D:\facefusion2.6.1\facefusion\uis\core.py", line 88, in launch
    ui_layout_module.render()
    File "D:\facefusion2.6.1\facefusion\uis\layouts\default.py", line 45, in render
    preview.render()
    File "D:\facefusion2.6.1\facefusion\uis\components\preview.py", line 42, in render
    conditional_append_reference_faces()
    File "D:\facefusion2.6.1\facefusion\core.py", line 280, in conditional_append_reference_faces
    reference_face = get_one_face(reference_frame, facefusion.globals.reference_face_position)
    File "D:\facefusion2.6.1\facefusion\face_analyser.py", line 447, in get_one_face
    many_faces = get_many_faces(vision_frame)
    File "D:\facefusion2.6.1\facefusion\face_analyser.py", line 494, in get_many_faces
    bounding_box_list_retinaface, face_landmark_5_list_retinaface, score_list_retinaface = detect_with_retinaface(vision_frame, facefusion.globals.face_detector_size)
    File "D:\facefusion2.6.1\facefusion\face_analyser.py", line 173, in detect_with_retinaface
    face_detector = get_face_analyser().get('face_detectors').get('retinaface')
    File "D:\facefusion2.6.1\facefusion\face_analyser.py", line 91, in get_face_analyser
    face_detectors['retinaface'] = onnxruntime.InferenceSession(MODELS.get('face_detector_retinaface').get('path'), providers = apply_execution_provider_options(facefusion.globals.execution_device_id, facefusion.globals.execution_providers))
    File "D:\facefusion2.6.1\jian27\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 432, in __init__
    raise fallback_error from e
    File "D:\facefusion2.6.1\jian27\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 427, in __init__
    self._create_inference_session(self._fallback_providers, None)
    File "D:\facefusion2.6.1\jian27\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 483, in _create_inference_session
    sess.initialize_session(providers, provider_options, disabled_optimizers)
    RuntimeError: D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:857 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.

    Press any key to continue . . .
    打开后网页显示走丢

    1. 剑心 剑心

      安装一下cuda试试

  41. 任性用盼望 任性用盼望

    感谢分享

  42. 能干迎毛豆 能干迎毛豆

    感谢大佬的分享

  43. 康乃馨沉默 康乃馨沉默

    感谢大佬的分享

    感谢大佬的分享

  44. 雨搞怪 雨搞怪

    感谢大佬的分享

  45. 项链悦耳 项链悦耳

    wow666666666666666666666666666666

  46. 树叶眯眯眼 树叶眯眯眼

    感谢分享!

  47. 大气踢铅笔 大气踢铅笔

    6666666

  48. 白羊震动 白羊震动

    学习下

  49. 西装年轻 西装年轻

    666666

  50. 大雁高挑 大雁高挑

    感谢分享