Skip to content

Commit 9621b8f

Browse files
[Desktop] Support Nvidia Blackwell (#3480)
Co-authored-by: Benjamin Lu <[email protected]>
1 parent 6be381b commit 9621b8f

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"dependencies": {
7272
"@alloc/quick-lru": "^5.2.0",
7373
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
74-
"@comfyorg/comfyui-electron-types": "^0.4.31",
74+
"@comfyorg/comfyui-electron-types": "^0.4.36",
7575
"@comfyorg/litegraph": "^0.13.3",
7676
"@primevue/forms": "^4.2.5",
7777
"@primevue/themes": "^4.2.5",

src/components/install/MirrorsConfiguration.vue

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
import {
3838
CUDA_TORCH_URL,
3939
NIGHTLY_CPU_TORCH_URL,
40-
TorchDeviceType
40+
TorchDeviceType,
41+
TorchMirrorUrl
4142
} from '@comfyorg/comfyui-electron-types'
4243
import Divider from 'primevue/divider'
4344
import Panel from 'primevue/panel'
@@ -46,6 +47,7 @@ import { ModelRef, computed, onMounted, ref } from 'vue'
4647
import MirrorItem from '@/components/install/mirror/MirrorItem.vue'
4748
import { PYPI_MIRROR, PYTHON_MIRROR, UVMirror } from '@/constants/uvMirrors'
4849
import { t } from '@/i18n'
50+
import { electronAPI } from '@/utils/envUtil'
4951
import { isInChina } from '@/utils/networkUtil'
5052
import { ValidationState, mergeValidationStates } from '@/utils/validationUtil'
5153
@@ -55,6 +57,17 @@ const pythonMirror = defineModel<string>('pythonMirror', { required: true })
5557
const pypiMirror = defineModel<string>('pypiMirror', { required: true })
5658
const 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+
5871
const 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 => {
83103
const userIsInChina = ref(false)
84104
onMounted(async () => {
85105
userIsInChina.value = await isInChina()
106+
isBlackwellArchitecture.value = await requiresNightlyPytorch()
86107
})
87108
88109
const useFallbackMirror = (mirror: UVMirror) => ({

0 commit comments

Comments
 (0)