Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next #544

Merged
merged 57 commits into from
May 19, 2024
Merged

Next #544

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
6a78edc
Modernize CI
henryruhs Apr 27, 2024
49593ee
Modernize CI
henryruhs Apr 27, 2024
0c8c25a
Modernize CI
henryruhs Apr 27, 2024
fbeb74d
Implement dynamic config (#518)
henryruhs May 1, 2024
dffedbb
Add Windows installer
henryruhs May 2, 2024
d5e37e6
Add --open-browser
henryruhs May 3, 2024
f246b40
Add Windows installer part2
henryruhs May 3, 2024
b9f5766
Use non-commercial license for the installer
henryruhs May 3, 2024
12803bc
Fix create environment in installer
henryruhs May 3, 2024
6cce1e0
Fix openvino for installer
henryruhs May 4, 2024
e8eb285
Fix conda for installer
henryruhs May 4, 2024
abe90f5
Fix conda for installer, Remove python and pip as it is part of conda
henryruhs May 4, 2024
96aabbb
Improve installer - guess the path
henryruhs May 4, 2024
8e0465d
Fix CI
henryruhs May 7, 2024
7f51338
Add missing accept-source-agreements to installer
henryruhs May 5, 2024
4d077c5
Install WinGet
henryruhs May 6, 2024
10568fe
Improve WinGet installation steps
henryruhs May 6, 2024
d5d4def
Use absolute path for winget
henryruhs May 6, 2024
85a27ad
More installer polishing
henryruhs May 6, 2024
619fd05
Add final page to installer, disable version check for Gradio
henryruhs May 7, 2024
ca4a1b4
Remove finish page again
henryruhs May 7, 2024
48d1a5c
Use NEXT for metadata
henryruhs May 7, 2024
a12d434
Support for /S mode
henryruhs May 8, 2024
18b81d2
Use winget-less approach
henryruhs May 9, 2024
a93409f
Improve Conda uninstall
henryruhs May 9, 2024
0ffdd9a
Improve code using platform helpers (#529)
henryruhs May 10, 2024
6d10d55
Update dependencies
henryruhs May 10, 2024
9ce4dd4
Feat/fix windows unicode paths (#531)
henryruhs May 10, 2024
e304401
Fix the Windows unicode path dilemma part2
henryruhs May 10, 2024
136641a
Remove conda environment on uninstall
henryruhs May 11, 2024
6fca879
Fix uninstall command
henryruhs May 11, 2024
a5d8e1f
Install apps for local user only
henryruhs May 13, 2024
99a8918
Add ultra sharp
henryruhs May 13, 2024
635a979
Add clear reality
henryruhs May 13, 2024
395c2fd
Update README and FUNDING
henryruhs May 14, 2024
12009fe
Update FUNDING.yml
henryruhs May 14, 2024
fb78125
Prevent preview of large videos in Gradio (#540)
henryruhs May 16, 2024
3b588fd
Fix order
henryruhs May 16, 2024
b54bf56
Refactor temporary file management, Use temporary file for image proc…
henryruhs May 17, 2024
abb6e72
Allow webm on target component
henryruhs May 17, 2024
cc20c5b
Reduce mosaic effect for frame processors
henryruhs May 17, 2024
68ae5d4
clear static faces on trim frame changes
henryruhs May 17, 2024
b1b749d
Fix trim frame component
henryruhs May 17, 2024
f215d53
Downgrade openvino dependency
henryruhs May 17, 2024
807e64d
Prepare next release
henryruhs May 18, 2024
ee6e9b2
Move get_short_path to filesystem, Add/Improve some testing
henryruhs May 18, 2024
176da11
Prepare installer, Prevent infinite loop for sanitize_path_for_windows
henryruhs May 18, 2024
47cc665
Introduce execution device id
henryruhs May 18, 2024
15db8be
Introduce execution device id
henryruhs May 18, 2024
5c82416
Seems like device id can be a string
henryruhs May 18, 2024
cec8cae
Seems like device id can be a string
henryruhs May 18, 2024
c13c4bd
Make Intel Arc work with OpenVINOExecution
henryruhs May 18, 2024
1b864c9
Use latest Git
henryruhs May 18, 2024
37973f3
Update wording
henryruhs May 19, 2024
c5f2686
Fix create_float_range
henryruhs May 19, 2024
3023352
Update preview
henryruhs May 19, 2024
d10de76
Fix Git link
henryruhs May 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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