Files
facefusion/facefusion/conda.py
T
Henry Ruhs 57fcb86b82 3.6.0 (#1062)
* mark as next

* add fran model

* add support for corridor key (#1060)

* introduce despill color

* simplify the apply dispill color

* finalize naming for both fill and despill

* follow vision_frame convension

* patch fran model

* adjust fran urls

* Feat/dynamic env setup (#1061)

* dynamic environment setup

* dynamic environment setup

* fix fran model

* prevent directml using incompatible corridor_key model

* fix environment setup for windows

* switch to corridor_key_1024 and corridor_key_2048

* switch to corridor_key_1024 and corridor_key_2048

* mark it as 3.6.0

* rename environment to conda

* rename environment to conda

* fix testing for face analyser

* some background remove cosmetics

* some background remove cosmetics

* some background remove cosmetics

* update preview

---------

Co-authored-by: harisreedhar <h4harisreedhar.s.s@gmail.com>
2026-03-16 15:08:43 +01:00

42 lines
1.2 KiB
Python

import os
import sys
from typing import List
from facefusion.common_helper import is_linux, is_windows
def setup() -> None:
conda_prefix = os.getenv('CONDA_PREFIX')
conda_ready = os.getenv('CONDA_READY')
if conda_prefix and not conda_ready:
if is_linux():
python_id = 'python' + str(sys.version_info.major) + '.' + str(sys.version_info.minor)
library_paths : List[str] =\
[
os.path.join(conda_prefix, 'lib'),
os.path.join(conda_prefix, 'lib', python_id, 'site-packages', 'tensorrt_libs')
]
library_paths = list(filter(os.path.exists, library_paths))
if library_paths:
if os.getenv('LD_LIBRARY_PATH'):
library_paths.append(os.getenv('LD_LIBRARY_PATH'))
os.environ['LD_LIBRARY_PATH'] = os.pathsep.join(library_paths)
os.environ['CONDA_READY'] = '1'
os.execv(sys.executable, [ sys.executable ] + sys.argv)
if is_windows():
library_paths =\
[
os.path.join(conda_prefix, 'Lib'),
os.path.join(conda_prefix, 'Lib', 'site-packages', 'tensorrt_libs')
]
library_paths = list(filter(os.path.exists, library_paths))
if library_paths:
if os.getenv('PATH'):
library_paths.append(os.getenv('PATH'))
os.environ['PATH'] = os.pathsep.join(library_paths)
os.environ['CONDA_READY'] = '1'