3737import {
3838 CUDA_TORCH_URL ,
3939 NIGHTLY_CPU_TORCH_URL ,
40- TorchDeviceType
40+ TorchDeviceType ,
41+ TorchMirrorUrl
4142} from ' @comfyorg/comfyui-electron-types'
4243import Divider from ' primevue/divider'
4344import Panel from ' primevue/panel'
@@ -46,6 +47,7 @@ import { ModelRef, computed, onMounted, ref } from 'vue'
4647import MirrorItem from ' @/components/install/mirror/MirrorItem.vue'
4748import { PYPI_MIRROR , PYTHON_MIRROR , UVMirror } from ' @/constants/uvMirrors'
4849import { t } from ' @/i18n'
50+ import { electronAPI } from ' @/utils/envUtil'
4951import { isInChina } from ' @/utils/networkUtil'
5052import { ValidationState , mergeValidationStates } from ' @/utils/validationUtil'
5153
@@ -55,6 +57,17 @@ const pythonMirror = defineModel<string>('pythonMirror', { required: true })
5557const pypiMirror = defineModel <string >(' pypiMirror' , { required: true })
5658const torchMirror = defineModel <string >(' torchMirror' , { required: true })
5759
60+ const isBlackwellArchitecture = ref (false )
61+
62+ const requiresNightlyPytorch = async (): Promise <boolean > => {
63+ try {
64+ return await electronAPI ().isBlackwell ()
65+ } catch (error ) {
66+ console .error (' Failed to detect Blackwell architecture:' , error )
67+ return false
68+ }
69+ }
70+
5871const getTorchMirrorItem = (device : TorchDeviceType ): UVMirror => {
5972 const settingId = ' Comfy-Desktop.UV.TorchInstallMirror'
6073 switch (device ) {
@@ -65,6 +78,13 @@ const getTorchMirrorItem = (device: TorchDeviceType): UVMirror => {
6578 fallbackMirror: NIGHTLY_CPU_TORCH_URL
6679 }
6780 case ' nvidia' :
81+ if (isBlackwellArchitecture .value ) {
82+ return {
83+ settingId ,
84+ mirror: TorchMirrorUrl .NightlyCuda ,
85+ fallbackMirror: TorchMirrorUrl .NightlyCuda
86+ }
87+ }
6888 return {
6989 settingId ,
7090 mirror: CUDA_TORCH_URL ,
@@ -83,6 +103,7 @@ const getTorchMirrorItem = (device: TorchDeviceType): UVMirror => {
83103const userIsInChina = ref (false )
84104onMounted (async () => {
85105 userIsInChina .value = await isInChina ()
106+ isBlackwellArchitecture .value = await requiresNightlyPytorch ()
86107})
87108
88109const useFallbackMirror = (mirror : UVMirror ) => ({
0 commit comments