Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
diffusers-workflow/install.ps1 at develop · dkackman/diffusers-workflow · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
dkackman
diffusers-workflow
Repository navigation
Code
Issues
3
(3)
Pull requests
1
(1)
Discussions
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
develop
Breadcrumbs
diffusers-workflow
/
install.ps1
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
166 lines (149 loc) · 6.19 KB
develop
Breadcrumbs
diffusers-workflow
/
install.ps1
Copy path
Top
File metadata and controls
Code
Blame
166 lines (149 loc) · 6.19 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
$ErrorActionPreference
=
"
Stop
"
#
Check for 64-bit Windows installation
if
(
-not
[
Environment
]::Is64BitOperatingSystem) {
Write-Error
"
diffusers-workflow requires a 64-bit Windows installation
"
Exit
1
}
#
Check for Visual C++ Runtime DLLs
$vcRuntime
=
Get-Item
-
ErrorAction SilentlyContinue
"
$
env:
windir
\System32\msvcp140.dll
"
if
(
-not
$vcRuntime
.Exists
) {
$vcRuntimeUrl
=
"
https://visualstudio.microsoft.com/downloads/#microsoft-visual-c-redistributable-for-visual-studio-2019
"
Write-Error
"
Unable to find Visual C++ Runtime DLLs
"
Write-Output
"
Download and install the Visual C++ Redistributable for Visual Studio 2019 package from:
$vcRuntimeUrl
"
Exit
1
}
#
Check for Python
try
{
$pythonVersion
=
(python
--
version).split(
"
"
)[
1
]
}
catch
{
Write-Error
"
Unable to find python
"
$pythonUrl
=
"
https://docs.python.org/3/using/windows.html#installation-steps
"
Write-Output
"
Note the check box during installation of Python to install the Python Launcher for Windows.
"
Write-Output
"
Install Python from:
$pythonUrl
"
Exit
1
}
#
Check for supported Python version (3.10 - 3.14)
$supportedPythonVersions
=
"
3.14
"
,
"
3.13
"
,
"
3.12
"
,
"
3.11
"
,
"
3.10
"
if
(
$
env:
INSTALL_PYTHON_VERSION
) {
$pythonVersion
=
$
env:
INSTALL_PYTHON_VERSION
}
else
{
$pythonVersion
=
$null
foreach
(
$version
in
$supportedPythonVersions
) {
try
{
$pver
=
(python
--
version).split(
"
"
)[
1
]
$result
=
$pver
.StartsWith
(
$version
)
}
catch
{
$result
=
$false
}
if
(
$result
) {
$pythonVersion
=
$version
break
}
}
}
if
(
-not
$pythonVersion
) {
$supportedPythonVersions
=
(
$supportedPythonVersions
|
ForEach-Object
{
"
Python
$_
"
})
-join
"
,
"
Write-Error
"
No usable Python version found, supported versions are:
$supportedPythonVersions
"
Write-Output
"
diffusers-workflow requires Python version >= 3.10 and <= 3.14
"
Exit
1
}
#
Print Python version
Write-Output
"
Python version is:
$pythonVersion
"
#
Remove the venv if it exists
if
(
Test-Path
-
Path
"
.\venv
"
-
PathType Container) {
Remove-Item
-
LiteralPath
"
.\venv
"
-
Recurse
-
Force
}
#
Create virtual environment
python
-
m venv venv
#
Activate virtual environment
.\venv\scripts\activate
#
Upgrade pip
python.exe
-
m pip install
--
upgrade pip
if
(
$LASTEXITCODE
-ne
0
) {
exit
$LASTEXITCODE
}
#
Install PyTorch first - GPU-aware, so the resolver below sees it satisfied
#
and leaves it alone. torchaudio comes with it, from the same index so its
#
build matches: dw does not import it, but diffusers' MiniMax H3 blocks use it
#
to resample an audio reference that is not already at the audio VAE's rate,
#
and without it those pipelines fail at the first setup block.
#
#
PyPI's Windows wheel bundles a CUDA 12.x runtime; pytorch.org's cu130 index
#
carries a CUDA 13 build that needs a newer driver (>= 580). So we probe for a
#
working NVIDIA driver via nvidia-smi and, if found, read the CUDA version it
#
supports: a CUDA 13-capable driver gets the cu130 build, an older one stays on
#
PyPI's CUDA 12 wheel rather than a build its driver cannot load (which would
#
silently fall back to the CPU).
$driverCuda
=
$null
if
(
Get-Command
nvidia
-
smi
-
ErrorAction SilentlyContinue) {
#
Finding the binary only proves it exists; a stale or broken driver can
#
leave nvidia-smi installed but failing, so require it to run too.
try
{
$smiOutput
=
(
&
nvidia
-
smi
2>
$null
)
-join
"
`n
"
if
(
$LASTEXITCODE
-eq
0
) {
$cudaMatch
=
[
regex
]::Match(
$smiOutput
,
'
CUDA Version:\s*(\d+)
'
)
if
(
$cudaMatch
.Success
) {
$driverCuda
=
[
int
]
$cudaMatch
.Groups
[
1
].Value
}
else
{
$driverCuda
=
12
}
}
}
catch
{
$driverCuda
=
$null
}
}
if
(
$null
-eq
$driverCuda
) {
Write-Output
"
No CUDA GPU detected - installing CPU-only torch
"
pip install torch torchvision torchaudio
--
index
-
url https:
//
download.pytorch.org
/
whl
/
cpu
}
elseif
(
$driverCuda
-ge
13
) {
Write-Output
"
CUDA
$driverCuda
driver detected - installing GPU-enabled torch (cu130)
"
pip install torch torchvision torchaudio
--
index
-
url https:
//
download.pytorch.org
/
whl
/
cu130
}
else
{
Write-Output
"
CUDA
$driverCuda
driver detected - installing PyPI torch (bundled CUDA 12 runtime)
"
pip install torch torchvision torchaudio
}
if
(
$LASTEXITCODE
-ne
0
) {
exit
$LASTEXITCODE
}
#
Everything else resolves from pyproject.toml - the single source of the
#
dependency list. Editable install with the server + dev extras.
pip install
-
e
"
.[server,dev]
"
if
(
$LASTEXITCODE
-ne
0
) {
exit
$LASTEXITCODE
}
#
Diffusers from GitHub (releases lag the newest model pipelines) - after
#
the resolver, so it isn't replaced by the released version. Forced, because
#
main keeps one dev version string for a release cycle and --upgrade would
#
keep an older commit; --no-deps so torch is not reinstalled, then a plain
#
install adds any dependency the new commit needs (as dw/server/updater.py)
pip install
--
force
-
reinstall
--
no
-
deps git
+
https:
//
github.com
/
huggingface
/
diffusers
if
(
$LASTEXITCODE
-ne
0
) {
exit
$LASTEXITCODE
}
pip install diffusers
if
(
$LASTEXITCODE
-ne
0
) {
exit
$LASTEXITCODE
}
#
Windows/CUDA-specific: bitsandbytes' pyproject marker is linux-only
pip install bitsandbytes kernels
if
(
$LASTEXITCODE
-ne
0
) {
exit
$LASTEXITCODE
}
#
Web UI dependencies - optional, only needed to build/run the SPA served by dw-serve
if
(
Get-Command
npm
-
ErrorAction SilentlyContinue) {
Write-Output
"
"
Write-Output
"
Installing web UI dependencies...
"
Push-Location
ui
npm install
$npmExitCode
=
$LASTEXITCODE
Pop-Location
if
(
$npmExitCode
-ne
0
) {
exit
$npmExitCode
}
}
else
{
Write-Output
"
"
Write-Output
"
npm was not found - skipping web UI dependency install.
"
Write-Output
"
Install Node.js/npm and run 'npm install' in the ui\ folder to build the web UI.
"
}
Write-Output
"
"
Write-Output
"
Installation complete!
"
Write-Output
"
"
Write-Output
"
To activate the virtual environment, run:
"
Write-Output
"
.\venv\scripts\activate
"
Write-Output
"
"
Write-Output
"
Note: Some LLM workflows (e.g., Phi mini-instruct) require flash_attn,
"
Write-Output
"
which requires the CUDA Toolkit: https://developer.nvidia.com/cuda-toolkit
"
You can’t perform that action at this time.