Skip to content

Commit e7c15ed

Browse files
committed
Merge pull request LykosAI#996 from ionite34/more-blackwell-updates
Use cu128 nightly torch index instead of w-e-w wheels (cherry picked from commit 7ab289c) # Conflicts: # StabilityMatrix.Core/Models/Packages/SDWebForge.cs
1 parent 8b5fde1 commit e7c15ed

File tree

2 files changed

+43
-7
lines changed

2 files changed

+43
-7
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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,25 @@ public override async Task InstallPackage(
149149
var torchVersion = options.PythonOptions.TorchIndex ?? GetRecommendedTorchVersion();
150150
if (torchVersion is TorchIndex.DirectMl)
151151
{
152+
<<<<<<< HEAD
152153
pipArgs = pipArgs.WithTorchDirectML();
154+
=======
155+
pipArgs = pipArgs
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);
170+
>>>>>>> 7ab289c8 (Merge pull request #996 from ionite34/more-blackwell-updates)
153171
}
154172
else
155173
{
@@ -168,6 +186,11 @@ public override async Task InstallPackage(
168186
);
169187
}
170188

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

173196
if (installedPackage.PipOverrides != null)

0 commit comments

Comments
 (0)