@@ -207,36 +207,52 @@ public override async Task InstallPackage(
207207
208208 var pipArgs = new PipInstallArgs ( ) ;
209209
210- pipArgs = torchVersion switch
210+ var isBlackwell =
211+ SettingsManager . Settings . PreferredGpu ? . IsBlackwellGpu ( ) ?? HardwareHelper . HasBlackwellGpu ( ) ;
212+
213+ if ( isBlackwell )
211214 {
212- TorchIndex . DirectMl => pipArgs . WithTorchDirectML ( ) ,
213- _
214- => pipArgs
215- . AddArg ( "--upgrade" )
216- . WithTorch ( )
217- . WithTorchVision ( )
218- . WithTorchExtraIndex (
219- torchVersion switch
220- {
221- TorchIndex . Cpu => "cpu" ,
222- TorchIndex . Cuda => "cu126" ,
223- TorchIndex . Rocm => "rocm6.2.4" ,
224- TorchIndex . Mps => "cpu" ,
225- _
226- => throw new ArgumentOutOfRangeException (
227- nameof ( torchVersion ) ,
228- torchVersion ,
229- null
230- )
231- }
232- )
233- } ;
215+ 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+ ) ;
222+ }
223+ else
224+ {
225+ pipArgs = torchVersion switch
226+ {
227+ TorchIndex . DirectMl => pipArgs . WithTorchDirectML ( ) ,
228+ _
229+ => pipArgs
230+ . AddArg ( "--upgrade" )
231+ . WithTorch ( )
232+ . WithTorchVision ( )
233+ . WithTorchExtraIndex (
234+ torchVersion switch
235+ {
236+ TorchIndex . Cpu => "cpu" ,
237+ TorchIndex . Cuda => "cu126" ,
238+ TorchIndex . Rocm => "rocm6.2.4" ,
239+ TorchIndex . Mps => "cpu" ,
240+ _
241+ => throw new ArgumentOutOfRangeException (
242+ nameof ( torchVersion ) ,
243+ torchVersion ,
244+ null
245+ )
246+ }
247+ )
248+ } ;
249+ }
234250
235251 var requirements = new FilePath ( installLocation , "requirements.txt" ) ;
236252
237253 pipArgs = pipArgs . WithParsedFromRequirementsTxt (
238254 await requirements . ReadAllTextAsync ( cancellationToken ) . ConfigureAwait ( false ) ,
239- excludePattern : "torch$|numpy"
255+ excludePattern : isBlackwell ? "torch$|torchvision$|numpy" : "torch$|numpy"
240256 ) ;
241257
242258 // https://github.com/comfyanonymous/ComfyUI/pull/4121
@@ -385,7 +401,7 @@ private async Task SetupModelFoldersConfig(DirectoryPath installDirectory)
385401 nodeValue . Children [ "ultralytics_bbox" ] = Path . Combine ( modelsDir , "Ultralytics" , "bbox" ) ;
386402 nodeValue . Children [ "ultralytics_segm" ] = Path . Combine ( modelsDir , "Ultralytics" , "segm" ) ;
387403 nodeValue . Children [ "sams" ] = Path . Combine ( modelsDir , "Sams" ) ;
388- nodeValue . Children [ "diffusion_models" ] = Path . Combine ( modelsDir , "unet " ) ;
404+ nodeValue . Children [ "diffusion_models" ] = Path . Combine ( modelsDir , "Unet " ) ;
389405 }
390406 else
391407 {
@@ -429,7 +445,7 @@ private async Task SetupModelFoldersConfig(DirectoryPath installDirectory)
429445 { "ultralytics_bbox" , Path . Combine ( modelsDir , "Ultralytics" , "bbox" ) } ,
430446 { "ultralytics_segm" , Path . Combine ( modelsDir , "Ultralytics" , "segm" ) } ,
431447 { "sams" , Path . Combine ( modelsDir , "Sams" ) } ,
432- { "diffusion_models" , Path . Combine ( modelsDir , "unet " ) }
448+ { "diffusion_models" , Path . Combine ( modelsDir , "Unet " ) }
433449 }
434450 ) ;
435451 }
0 commit comments