Skip to content

Commit

Permalink
Next (#544)
Browse files Browse the repository at this point in the history
* Modernize CI

* Modernize CI

* Modernize CI

* Implement dynamic config (#518)

* Implement dynamic config

* Fix apply config

* Move config to general

* Move config to general

* Move config to general

* Add Windows installer

* Add --open-browser

* Add Windows installer part2

* Use non-commercial license for the installer

* Fix create environment in installer

* Fix openvino for installer

* Fix conda for installer

* Fix conda for installer, Remove python and pip as it is part of conda

* Improve installer - guess the path

* Fix CI

* Add missing accept-source-agreements to installer

* Install WinGet

* Improve WinGet installation steps

* Use absolute path for winget

* More installer polishing

* Add final page to installer, disable version check for Gradio

* Remove finish page again

* Use NEXT for metadata

* Support for /S mode

* Use winget-less approach

* Improve Conda uninstall

* Improve code using platform helpers (#529)

* Update dependencies

* Feat/fix windows unicode paths (#531)

* Fix the Windows unicode path dilemma

* Update dependencies

* Fix the Windows unicode path dilemma part2

* Remove conda environment on uninstall

* Fix uninstall command

* Install apps for local user only

* Add ultra sharp

* Add clear reality

* Update README and FUNDING

* Update FUNDING.yml

* Prevent preview of large videos in Gradio (#540)

* Fix order

* Refactor temporary file management, Use temporary file for image processing (#542)

* Allow webm on target component

* Reduce mosaic effect for frame processors

* clear static faces on trim frame changes

* Fix trim frame component

* Downgrade openvino dependency

* Prepare next release

* Move get_short_path to filesystem, Add/Improve some testing

* Prepare installer, Prevent infinite loop for sanitize_path_for_windows

* Introduce execution device id

* Introduce execution device id

* Seems like device id can be a string

* Seems like device id can be a string

* Make Intel Arc work with OpenVINOExecution

* Use latest Git

* Update wording

* Fix create_float_range

* Update preview

* Fix Git link
  • Loading branch information
henryruhs committed May 19, 2024
1 parent 6ff3596 commit 319e3f9
Show file tree
Hide file tree
Showing 46 changed files with 555 additions and 213 deletions.
Binary file modified .github/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: pip install flake8
Expand All @@ -23,11 +23,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v2
uses: actions/checkout@v4
- name: Set up FFMpeg
uses: FedericoCarboni/setup-ffmpeg@v3
- name: Set up Python 3.10
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: python install.py --onnxruntime default --skip-conda
Expand Down
3 changes: 3 additions & 0 deletions .install/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CC-BY-4.0 license

Copyright (c) 2024 Henry Ruhs
Binary file added .install/facefusion.ico
Binary file not shown.
177 changes: 177 additions & 0 deletions .install/facefusion.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
!include MUI2.nsh
!include nsDialogs.nsh
!include LogicLib.nsh

RequestExecutionLevel admin

Name 'FaceFusion 2.6.0'
OutFile 'FaceFusion_2.6.0.exe'

!define MUI_ICON 'facefusion.ico'

!insertmacro MUI_PAGE_DIRECTORY
Page custom InstallPage PostInstallPage
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE English

Var UseDefault
Var UseCuda
Var UseDirectMl
Var UseOpenVino

Function .onInit
StrCpy $INSTDIR 'C:\FaceFusion'
FunctionEnd

Function InstallPage
nsDialogs::Create 1018
!insertmacro MUI_HEADER_TEXT 'Choose Your Accelerator' 'Choose your accelerator based on the graphics card.'

${NSD_CreateRadioButton} 0 40u 100% 10u 'Default'
Pop $UseDefault

${NSD_CreateRadioButton} 0 55u 100% 10u 'CUDA (NVIDIA)'
Pop $UseCuda

${NSD_CreateRadioButton} 0 70u 100% 10u 'DirectML (AMD, Intel, NVIDIA)'
Pop $UseDirectMl

${NSD_CreateRadioButton} 0 85u 100% 10u 'OpenVINO (Intel)'
Pop $UseOpenVino

${NSD_Check} $UseDefault

nsDialogs::Show
FunctionEnd

Function PostInstallPage
${NSD_GetState} $UseDefault $UseDefault
${NSD_GetState} $UseCuda $UseCuda
${NSD_GetState} $UseDirectMl $UseDirectMl
${NSD_GetState} $UseOpenVino $UseOpenVino
FunctionEnd

Function Destroy
${If} ${Silent}
Quit
${Else}
Abort
${EndIf}
FunctionEnd

Section 'Prepare Your Platform'
DetailPrint 'Install GIT'
inetc::get 'https://github.com/git-for-windows/git/releases/download/v2.45.1.windows.1/Git-2.45.1-64-bit.exe' '$TEMP\Git.exe'
ExecWait '$TEMP\Git.exe /CURRENTUSER /VERYSILENT /DIR=$LOCALAPPDATA\Programs\Git' $0
Delete '$TEMP\Git.exe'

${If} $0 > 0
DetailPrint 'Git installation aborted with error code $0'
Call Destroy
${EndIf}

DetailPrint 'Uninstall Conda'
ExecWait '$LOCALAPPDATA\Programs\Miniconda3\Uninstall-Miniconda3.exe /S _?=$LOCALAPPDATA\Programs\Miniconda3'
RMDir /r '$LOCALAPPDATA\Programs\Miniconda3'

DetailPrint 'Install Conda'
inetc::get 'https://repo.anaconda.com/miniconda/Miniconda3-py310_24.3.0-0-Windows-x86_64.exe' '$TEMP\Miniconda3.exe'
ExecWait '$TEMP\Miniconda3.exe /InstallationType=JustMe /AddToPath=1 /S /D=$LOCALAPPDATA\Programs\Miniconda3' $1
Delete '$TEMP\Miniconda3.exe'

${If} $1 > 0
DetailPrint 'Conda installation aborted with error code $1'
Call Destroy
${EndIf}
SectionEnd

Section 'Download Your Copy'
SetOutPath $INSTDIR

DetailPrint 'Download Your Copy'
RMDir /r $INSTDIR
nsExec::Exec '$LOCALAPPDATA\Programs\Git\cmd\git.exe clone https://github.com/facefusion/facefusion --branch 2.6.0 .'
SectionEnd

Section 'Setup Your Environment'
DetailPrint 'Setup Your Environment'
nsExec::Exec '$LOCALAPPDATA\Programs\Miniconda3\Scripts\conda.exe init --all'
nsExec::Exec '$LOCALAPPDATA\Programs\Miniconda3\Scripts\conda.exe create --name facefusion python=3.10 --yes'
SectionEnd

Section 'Create Install Batch'
SetOutPath $INSTDIR

FileOpen $0 install-ffmpeg.bat w
FileOpen $1 install-accelerator.bat w
FileOpen $2 install-application.bat w

FileWrite $0 '@echo off && conda activate facefusion && conda install conda-forge::ffmpeg=7.0.0 --yes'
${If} $UseCuda == 1
FileWrite $1 '@echo off && conda activate facefusion && conda install cudatoolkit=11.8 cudnn=8.9.2.26 conda-forge::gputil=1.4.0 conda-forge::zlib-wapi --yes'
FileWrite $2 '@echo off && conda activate facefusion && python install.py --onnxruntime cuda-11.8'
${ElseIf} $UseDirectMl == 1
FileWrite $2 '@echo off && conda activate facefusion && python install.py --onnxruntime directml'
${ElseIf} $UseOpenVino == 1
FileWrite $1 '@echo off && conda activate facefusion && conda install conda-forge::openvino=2023.1.0 --yes'
FileWrite $2 '@echo off && conda activate facefusion && python install.py --onnxruntime openvino'
${Else}
FileWrite $2 '@echo off && conda activate facefusion && python install.py --onnxruntime default'
${EndIf}

FileClose $0
FileClose $1
FileClose $2
SectionEnd

Section 'Install Your FFmpeg'
SetOutPath $INSTDIR

DetailPrint 'Install Your FFmpeg'
nsExec::ExecToLog 'install-ffmpeg.bat'
SectionEnd

Section 'Install Your Accelerator'
SetOutPath $INSTDIR

DetailPrint 'Install Your Accelerator'
nsExec::ExecToLog 'install-accelerator.bat'
SectionEnd

Section 'Install The Application'
SetOutPath $INSTDIR

DetailPrint 'Install The Application'
nsExec::ExecToLog 'install-application.bat'
SectionEnd

Section 'Create Run Batch'
SetOutPath $INSTDIR
FileOpen $0 run.bat w
FileWrite $0 '@echo off && conda activate facefusion && python run.py --open-browser'
FileClose $0
SectionEnd

Section 'Register The Application'
DetailPrint 'Register The Application'
CreateDirectory $SMPROGRAMS\FaceFusion
CreateShortcut $SMPROGRAMS\FaceFusion\FaceFusion.lnk $INSTDIR\run.bat '' $INSTDIR\.install\facefusion.ico
CreateShortcut $DESKTOP\FaceFusion.lnk $INSTDIR\run.bat '' $INSTDIR\.install\facefusion.ico
WriteUninstaller $INSTDIR\Uninstall.exe

WriteRegStr HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FaceFusion DisplayName 'FaceFusion'
WriteRegStr HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FaceFusion DisplayVersion '2.6.0'
WriteRegStr HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FaceFusion Publisher 'Henry Ruhs'
WriteRegStr HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FaceFusion InstallLocation $INSTDIR
WriteRegStr HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FaceFusion UninstallString $INSTDIR\uninstall.exe
SectionEnd

Section 'Uninstall'
nsExec::Exec '$LOCALAPPDATA\Programs\Miniconda3\Scripts\conda.exe env remove --name facefusion --yes'

Delete $DESKTOP\FaceFusion.lnk
RMDir /r $SMPROGRAMS\FaceFusion
RMDir /r $INSTDIR

DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FaceFusion
SectionEnd
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
MIT license

Copyright (c) 2023 Henry Ruhs
Copyright (c) 2024 Henry Ruhs
Loading

0 comments on commit 319e3f9

Please sign in to comment.