{"id":15496,"date":"2024-06-08T21:59:07","date_gmt":"2024-06-08T13:59:07","guid":{"rendered":"https:\/\/92it.top\/?p=15496"},"modified":"2024-06-12T11:11:21","modified_gmt":"2024-06-12T03:11:21","slug":"facefusion-2-6-0","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=15496","title":{"rendered":"FaceFusion 2.6.0 \u66f4\u65b0 Tips"},"content":{"rendered":"\n<p>FaceFusion\u7248\u672c\u66f4\u65b0\u5230\u4e862.6.0\uff0c\u4e0b\u9762\u662f\u5b89\u88c5\u7684\u4e00\u4e9btips\u3002<\/p>\n\n\n\n<p><strong>\u5b89\u88c5Conda<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>FaceFusion\u820d\u5f03\u4e86python \u865a\u62df\u73af\u5883\uff0c\u7528\u4e86Conda\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl -LO https:\/\/repo.anaconda.com\/miniconda\/Miniconda3-latest-Linux-x86_64.sh\n\nbash Miniconda3-latest-Linux-x86_64.sh<\/pre>\n\n\n\n<p><strong>\u521d\u59cb\u5316Conda\u73af\u5883<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">conda init --all\n\nconda create --name facefusion python=3.10\n\nconda activate facefusion<\/pre>\n\n\n\n<p><strong>\u4e0b\u8f7d\u4ee3\u7801<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">git clone https:\/\/github.com\/facefusion\/facefusion\n\ncd facefusion<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"598\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-14-1024x598.png\" alt=\"\" class=\"wp-image-15498\" style=\"width:472px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-14-1024x598.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-14-300x175.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-14-768x449.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-14-1536x897.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-14-830x485.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-14-230x134.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-14-350x204.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-14-480x280.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-14.png 1630w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u4fee\u6539requirements.txt\uff0c\u56e0\u4e3a\u6211\u7684Centos\u73af\u5883 onnxruntime\u53ea\u80fd\u5b89\u88c5\u52301.16.3<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">filetype==1.2.0\ngradio==3.50.2\nnumpy==1.26.2\nonnx==1.15.0\nonnxruntime==1.16.3\nopencv-python==4.9.0.80\npsutil==5.9.6\ntqdm==4.66.1\nscipy==1.13.0\n<\/pre>\n\n\n\n<p>\u4fee\u6539 facefusion\/installer.py<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"747\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-16-1024x747.png\" alt=\"\" class=\"wp-image-15500\" style=\"width:462px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-16-1024x747.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-16-300x219.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-16-768x560.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-16-1536x1120.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-16-830x605.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-16-550x400.png 550w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-16-230x168.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-16-350x255.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-16-480x350.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-16.png 2046w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from typing import Dict, Tuple\nimport sys\nimport os\nimport tempfile\nimport subprocess\nimport inquirer\nfrom argparse import ArgumentParser, HelpFormatter\n\nfrom facefusion import metadata, wording\nfrom facefusion.common_helper import is_linux, is_macos, is_windows\n\nif is_macos():\n\tos.environ['SYSTEM_VERSION_COMPAT'] = '0'\n\nONNXRUNTIMES : Dict[str, Tuple[str, str]] = {}\n\nif is_macos():\n\tONNXRUNTIMES['default'] = ('onnxruntime', '1.16.3')\nelse:\n\tONNXRUNTIMES['default'] = ('onnxruntime', '1.16.3')\n\tONNXRUNTIMES['cuda-12.2'] = ('onnxruntime-gpu', '1.17.1')\n\tONNXRUNTIMES['cuda-11.8'] = ('onnxruntime-gpu', '1.17.1')\n\tONNXRUNTIMES['openvino'] = ('onnxruntime-openvino', '1.15.0')\nif is_linux():\n\tONNXRUNTIMES['rocm-5.4.2'] = ('onnxruntime-rocm', '1.16.3')\n\tONNXRUNTIMES['rocm-5.6'] = ('onnxruntime-rocm', '1.16.3')\nif is_windows():\n\tONNXRUNTIMES['directml'] = ('onnxruntime-directml', '1.16.3')\n\n\ndef cli() -> None:\n\tprogram = ArgumentParser(formatter_class = lambda prog: HelpFormatter(prog, max_help_position = 200))\n\tprogram.add_argument('--onnxruntime', help = wording.get('help.install_dependency').format(dependency = 'onnxruntime'), choices = ONNXRUNTIMES.keys())\n\tprogram.add_argument('--skip-conda', help = wording.get('help.skip_conda'), action = 'store_true')\n\tprogram.add_argument('-v', '--version', version = metadata.get('name') + ' ' + metadata.get('version'), action = 'version')\n\trun(program)\n\n\ndef run(program : ArgumentParser) -> None:\n\targs = program.parse_args()\n\tpython_id = 'cp' + str(sys.version_info.major) + str(sys.version_info.minor)\n\n\tif not args.skip_conda and 'CONDA_PREFIX' not in os.environ:\n\t\tsys.stdout.write(wording.get('conda_not_activated') + os.linesep)\n\t\tsys.exit(1)\n\tif args.onnxruntime:\n\t\tanswers =\\\n\t\t{\n\t\t\t'onnxruntime': args.onnxruntime\n\t\t}\n\telse:\n\t\tanswers = inquirer.prompt(\n\t\t[\n\t\t\tinquirer.List('onnxruntime', message = wording.get('help.install_dependency').format(dependency = 'onnxruntime'), choices = list(ONNXRUNTIMES.keys()))\n\t\t])\n\tif answers:\n\t\tonnxruntime = answers['onnxruntime']\n\t\tonnxruntime_name, onnxruntime_version = ONNXRUNTIMES[onnxruntime]\n\n\t\tsubprocess.call([ 'pip', 'install', '-r', 'requirements.txt', '--force-reinstall' ])\n\t\tif onnxruntime == 'rocm-5.4.2' or onnxruntime == 'rocm-5.6':\n\t\t\tif python_id in [ 'cp39', 'cp310', 'cp311' ]:\n\t\t\t\trocm_version = onnxruntime.replace('-', '')\n\t\t\t\trocm_version = rocm_version.replace('.', '')\n\t\t\t\twheel_name = 'onnxruntime_training-' + onnxruntime_version + '+' + rocm_version + '-' + python_id + '-' + python_id + '-manylinux_2_17_x86_64.manylinux2014_x86_64.whl'\n\t\t\t\twheel_path = os.path.join(tempfile.gettempdir(), wheel_name)\n\t\t\t\twheel_url = 'https:\/\/download.onnxruntime.ai\/' + wheel_name\n\t\t\t\tsubprocess.call([ 'curl', '--silent', '--location', '--continue-at', '-', '--output', wheel_path, wheel_url ])\n\t\t\t\tsubprocess.call([ 'pip', 'uninstall', wheel_path, '-y', '-q' ])\n\t\t\t\tsubprocess.call([ 'pip', 'install', wheel_path, '--force-reinstall' ])\n\t\t\t\tos.remove(wheel_path)\n\t\telse:\n\t\t\tsubprocess.call([ 'pip', 'uninstall', 'onnxruntime', onnxruntime_name, '-y', '-q' ])\n\t\t\tif onnxruntime == 'cuda-12.2':\n\t\t\t\tsubprocess.call([ 'pip', 'install', onnxruntime_name + '==' + onnxruntime_version, '--extra-index-url', 'https:\/\/aiinfra.pkgs.visualstudio.com\/PublicPackages\/_packaging\/onnxruntime-cuda-12\/pypi\/simple', '--force-reinstall' ])\n\t\t\telse:\n\t\t\t\tsubprocess.call([ 'pip', 'install', onnxruntime_name + '==' + onnxruntime_version, '--force-reinstall' ])\n<\/pre>\n\n\n\n<p><strong>\u5b89\u88c5\u4f9d\u8d56<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">python install.py\n\npython run.py<\/pre>\n\n\n\n<p><strong>\u66f4\u65b0\u6a21\u578b\uff08\u91cd\u8981\uff09<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u56e0\u4e3a\u7528\u4e86Conda\uff0c\u6a21\u578b\u4e5f\u66f4\u65b0\u4e86<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/facefusion\/facefusion-assets\">https:\/\/github.com\/facefusion\/facefusion-assets<\/a><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"706\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-17-1024x706.png\" alt=\"\" class=\"wp-image-15501\" style=\"width:420px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-17-1024x706.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-17-300x207.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-17-768x530.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-17-1536x1059.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-17-830x572.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-17-230x159.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-17-350x241.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-17-480x331.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-17.png 1566w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u6bd4\u5982\u6362\u8138\u6a21\u578b<a href=\"https:\/\/github.com\/facefusion\/facefusion-assets\/releases\/download\/models\/inswapper_128_fp16.onnx\">inswapper_128_fp16.onnx<\/a>\uff0c \u522b\u770b\u540d\u5b57\u4e00\u6837\uff0c\u5176\u5b9e\u5185\u5bb9\u5df2\u7ecf\u53d1\u751f\u4e86\u53d8\u5316\uff0c\u9700\u8981\u4ece\u7f51\u7ad9\u4e0b\u8f7d\uff0c\u5e76\u4e14\u66f4\u65b0\u5230\/mnt\/facefusion\/.assets \u4e2d\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"724\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-18-1024x724.png\" alt=\"\" class=\"wp-image-15502\" style=\"width:434px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-18-1024x724.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-18-300x212.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-18-768x543.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-18-1536x1086.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-18-830x587.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-18-230x163.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-18-350x247.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-18-480x339.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2024\/06\/\u56fe\u7247-18.png 1686w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p><strong>\u542f\u52a8<code>Gradio<\/code>\u5185\u7f51\u7a7f\u900f<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Gradio\u662f\u4e00\u4e2a\u7528\u4e8e\u521b\u5efa\u673a\u5668\u5b66\u4e60\u6a21\u578b\u4ea4\u4e92\u5f0f\u754c\u9762\u7684Python\u5e93\u3002\u901a\u8fc7Gradio\uff0c\u4f60\u53ef\u4ee5\u4e3a\u4f60\u7684\u6a21\u578b\u5feb\u901f\u6784\u5efa\u4e00\u4e2a\u53ef\u89c6\u5316\u7684\u3001\u6613\u4e8e\u4f7f\u7528\u7684Web\u754c\u9762\uff0c\u65e0\u9700\u7f16\u5199\u4efb\u4f55\u524d\u7aef\u4ee3\u7801\u3002\u6211\u4eec\u5c06\u901a\u8fc7Gradio\u5c06\u5185\u7f51\u7aef\u53e37860\u6620\u5c04\u5230\u516c\u7f51\u4e0a\u3002<\/p>\n\n\n\n<p>\u5728<code>facefusion\/uis\/layouts\/<\/code>\u76ee\u5f55\u4e0b\u65b0\u5efa\u6587\u4ef6<code>share.py<\/code><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import gradio\n\nfrom facefusion.uis.layouts import default\n\n\ndef pre_check() -> bool:\n    return default.pre_check()\n\n\ndef pre_render() -> bool:\n    return default.pre_render()\n\n\ndef render() -> gradio.Blocks:\n    return default.render()\n\n\ndef listen() -> None:\n    default.listen()\n\n\ndef run(ui : gradio.Blocks) -> None:\n    ui.launch(show_api = False, share = True)<\/pre>\n\n\n\n<p>\u8fd4\u56de\u5230<code>facefusion<\/code>\u76ee\u5f55\u4e0b\uff0c\u91cd\u65b0\u542f\u52a8<code>run.py<\/code><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">python run.py --ui-layouts share<\/pre>\n\n\n\n<p>\u5b8c\u6210\u540e\uff0c\u4f60\u4f1a\u770b\u5230\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Running on local URL: http:\/\/127.0.0.1:7860\nRunning on public URL: https:\/\/e41b4898c4fad7cc83.gradio.live\n\nThis share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https:\/\/huggingface.co\/spaces)<\/pre>\n\n\n\n<p>\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4f60\u7684\u72ec\u7279\u7684URL\u8fde\u63a5\u8bbf\u95ee<strong>Facefusion<\/strong>\u754c\u9762\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FaceFusion\u7248\u672c\u66f4\u65b0\u5230\u4e862.6.0\uff0c\u4e0b\u9762\u662f\u5b89\u88c5\u7684\u4e00\u4e9btips\u3002 \u5b89\u88c5Conda FaceFusion\u820d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/15496"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15496"}],"version-history":[{"count":5,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/15496\/revisions"}],"predecessor-version":[{"id":15530,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/15496\/revisions\/15530"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}