forked from sdbds/Hunyuan3D-2-for-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2、run_gui.ps1
More file actions
53 lines (44 loc) · 1.19 KB
/
Copy path2、run_gui.ps1
File metadata and controls
53 lines (44 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# run script by @bdsqlsz
$host_address= "127.0.0.1"
$port = ""
$enable_t23d = $false
$profile_set=3 #5 for highvarm, 4 for high, 3 for normal,2 for low, 1 for ultra
# Activate python venv
Set-Location $PSScriptRoot
if ($env:OS -ilike "*windows*") {
if (Test-Path "./venv/Scripts/activate") {
Write-Output "Windows venv"
./venv/Scripts/activate
}
elseif (Test-Path "./.venv/Scripts/activate") {
Write-Output "Windows .venv"
./.venv/Scripts/activate
}
}
elseif (Test-Path "./venv/bin/activate") {
Write-Output "Linux venv"
./venv/bin/Activate.ps1
}
elseif (Test-Path "./.venv/bin/activate") {
Write-Output "Linux .venv"
./.venv/bin/activate.ps1
}
$Env:HF_HOME = $PSScriptRoot+"\huggingface"
$Env:TORCH_HOME= $PSScriptRoot+"\torch"
#$Env:HF_ENDPOINT = "https://hf-mirror.com"
$Env:XFORMERS_FORCE_DISABLE_TRITON = "1"
$ext_args = [System.Collections.ArrayList]::new()
if ($host_address) {
[void]$ext_args.Add("--host=$host_address")
}
if ($port) {
[void]$ext_args.Add("--port=$port")
}
if ($enable_t23d) {
[void]$ext_args.Add("--enable_t23d")
}
if ($profile_set -ne 3) {
[void]$ext_args.Add("--profile=$profile_set")
}
python gradio_app.py $ext_args
Read-Host | Out-Null ;