Skip to content

Commit 3fe3df8

Browse files
authored
Merge pull request LykosAI#997 from ionite34/backport/main/pr-996
[dev to main] backport: Use cu128 nightly torch index instead of w-e-w wheels (996)
2 parents 8351c03 + b346754 commit 3fe3df8

File tree

2 files changed

+39
-13
lines changed

2 files changed

+39
-13
lines changed

StabilityMatrix.Core/Models/Packages/ComfyUI.cs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,23 @@ public override async Task InstallPackage(
210210
var isBlackwell =
211211
SettingsManager.Settings.PreferredGpu?.IsBlackwellGpu() ?? HardwareHelper.HasBlackwellGpu();
212212

213-
if (isBlackwell)
213+
if (isBlackwell && torchVersion is TorchIndex.Cuda)
214214
{
215215
pipArgs = pipArgs
216-
.AddArg(
217-
"https://huggingface.co/w-e-w/torch-2.6.0-cu128.nv/resolve/main/torch-2.6.0%2Bcu128.nv-cp310-cp310-win_amd64.whl"
218-
)
219-
.AddArg(
220-
"https://huggingface.co/w-e-w/torch-2.6.0-cu128.nv/resolve/main/torchvision-0.20.0a0%2Bcu128.nv-cp310-cp310-win_amd64.whl"
221-
);
216+
.AddArg("--upgrade")
217+
.AddArg("--pre")
218+
.WithTorch()
219+
.WithTorchVision()
220+
.WithTorchExtraIndex("nightly/cu128");
221+
222+
if (installedPackage.PipOverrides != null)
223+
{
224+
pipArgs = pipArgs.WithUserOverrides(installedPackage.PipOverrides);
225+
}
226+
progress?.Report(
227+
new ProgressReport(-1f, "Installing Torch for your shiny new GPU...", isIndeterminate: true)
228+
);
229+
await venvRunner.PipInstall(pipArgs, onConsoleOutput).ConfigureAwait(false);
222230
}
223231
else
224232
{
@@ -248,6 +256,11 @@ public override async Task InstallPackage(
248256
};
249257
}
250258

259+
if (isBlackwell && torchVersion is TorchIndex.Cuda)
260+
{
261+
pipArgs = new PipInstallArgs();
262+
}
263+
251264
var requirements = new FilePath(installLocation, "requirements.txt");
252265

253266
pipArgs = pipArgs.WithParsedFromRequirementsTxt(

StabilityMatrix.Core/Models/Packages/SDWebForge.cs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,20 @@ public override async Task InstallPackage(
153153
if (isBlackwell && torchVersion is TorchIndex.Cuda)
154154
{
155155
pipArgs = pipArgs
156-
.AddArg(
157-
"https://huggingface.co/w-e-w/torch-2.6.0-cu128.nv/resolve/main/torch-2.6.0%2Bcu128.nv-cp310-cp310-win_amd64.whl"
158-
)
159-
.AddArg(
160-
"https://huggingface.co/w-e-w/torch-2.6.0-cu128.nv/resolve/main/torchvision-0.20.0a0%2Bcu128.nv-cp310-cp310-win_amd64.whl"
161-
);
156+
.AddArg("--upgrade")
157+
.AddArg("--pre")
158+
.WithTorch()
159+
.WithTorchVision()
160+
.WithTorchExtraIndex("nightly/cu128");
161+
162+
if (installedPackage.PipOverrides != null)
163+
{
164+
pipArgs = pipArgs.WithUserOverrides(installedPackage.PipOverrides);
165+
}
166+
progress?.Report(
167+
new ProgressReport(-1f, "Installing Torch for your shiny new GPU...", isIndeterminate: true)
168+
);
169+
await venvRunner.PipInstall(pipArgs, onConsoleOutput).ConfigureAwait(false);
162170
}
163171
else
164172
{
@@ -177,6 +185,11 @@ public override async Task InstallPackage(
177185
);
178186
}
179187

188+
if (isBlackwell && torchVersion is TorchIndex.Cuda)
189+
{
190+
pipArgs = new PipInstallArgs();
191+
}
192+
180193
pipArgs = pipArgs.WithParsedFromRequirementsTxt(requirementsContent, excludePattern: "torch");
181194

182195
if (installedPackage.PipOverrides != null)

0 commit comments

Comments
 (0)