Skip to content

Commit 9f85660

Browse files
Disable forced NVIDIA torch upgrades (#1543)
Stop forcing NVIDIA PyTorch upgrades. Users should control large PyTorch downloads and avoid surprise upgrades. This change removes the legacy torch mirror migration and stops treating NVIDIA cu130 minimum versions as a required package upgrade, so validation no longer triggers an automatic update. The package update flow also skips the recommended NVIDIA torch install step, keeping upgrades user-driven. Tradeoff: users can remain on older CUDA/torch builds and may hit compatibility issues; the NVIDIA driver warning still appears.
1 parent b1614a1 commit 9f85660

File tree

3 files changed

+2
-29
lines changed

3 files changed

+2
-29
lines changed

src/install/installationManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ export class InstallationManager implements HasTelemetry {
382382
await installation.virtualEnvironment.installComfyUIRequirements(callbacks);
383383
await installation.virtualEnvironment.installComfyUIManagerRequirements(callbacks);
384384
await this.warnIfNvidiaDriverTooOld(installation);
385-
await installation.virtualEnvironment.ensureRecommendedNvidiaTorch(callbacks);
385+
// Disable automatic NVIDIA torch upgrades so users control large downloads.
386+
// await installation.virtualEnvironment.ensureRecommendedNvidiaTorch(callbacks);
386387
await installation.validate();
387388
} catch (error) {
388389
log.error('Error auto-updating packages:', error);

src/main-process/comfyInstallation.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { rm } from 'node:fs/promises';
33

44
import { ComfyServerConfig } from '../config/comfyServerConfig';
55
import { ComfySettings, useComfySettings } from '../config/comfySettings';
6-
import { LEGACY_NVIDIA_TORCH_MIRROR, TorchMirrorUrl } from '../constants';
76
import { evaluatePathRestrictions } from '../handlers/pathHandlers';
87
import type { DesktopInstallState } from '../main_types';
98
import type { InstallValidation } from '../preload';
@@ -86,28 +85,10 @@ export class ComfyInstallation {
8685
const basePath = config.get('basePath');
8786
if (state && basePath) {
8887
await ComfySettings.load(basePath);
89-
await ComfyInstallation.migrateLegacyTorchMirrorIfNeeded();
9088
return new ComfyInstallation(state, basePath, getTelemetry());
9189
}
9290
}
9391

94-
private static async migrateLegacyTorchMirrorIfNeeded(): Promise<void> {
95-
const selectedDevice = useDesktopConfig().get('selectedDevice');
96-
if (selectedDevice !== 'nvidia') return;
97-
98-
const settings = useComfySettings();
99-
const torchMirror = settings.get('Comfy-Desktop.UV.TorchInstallMirror');
100-
if (!torchMirror || torchMirror !== LEGACY_NVIDIA_TORCH_MIRROR) return;
101-
102-
try {
103-
settings.set('Comfy-Desktop.UV.TorchInstallMirror', TorchMirrorUrl.Cuda);
104-
await settings.saveSettings();
105-
log.info('Migrated legacy NVIDIA torch mirror from cu129 to cu130.');
106-
} catch (error) {
107-
log.warn('Failed to migrate legacy NVIDIA torch mirror to cu130.', error);
108-
}
109-
}
110-
11192
/**
11293
* Validate the installation and add any results to {@link issues}.
11394
* @returns The validated installation state, along with a list of any issues detected.

src/virtualEnvironment.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
AMD_ROCM_SDK_PACKAGES,
1212
AMD_TORCH_PACKAGES,
1313
InstallStage,
14-
LEGACY_NVIDIA_TORCH_MIRROR,
1514
NVIDIA_TORCHVISION_VERSION,
1615
NVIDIA_TORCH_PACKAGES,
1716
NVIDIA_TORCH_VERSION,
@@ -115,9 +114,6 @@ function fixDeviceMirrorMismatch(device: TorchDeviceType, mirror: string | undef
115114
if (device === 'nvidia') return TorchMirrorUrl.Cuda;
116115
else if (device === 'mps') return TorchMirrorUrl.NightlyCpu;
117116
}
118-
if (device === 'nvidia' && mirror === LEGACY_NVIDIA_TORCH_MIRROR) {
119-
return TorchMirrorUrl.Cuda;
120-
}
121117
return mirror;
122118
}
123119

@@ -982,11 +978,6 @@ export class VirtualEnvironment implements HasTelemetry, PythonExecutor {
982978
return 'package-upgrade';
983979
}
984980

985-
if (await this.needsNvidiaTorchUpgrade()) {
986-
log.info('NVIDIA PyTorch version out of date. Treating as package upgrade.');
987-
return 'package-upgrade';
988-
}
989-
990981
log.debug('hasRequirements result:', 'OK');
991982
return 'OK';
992983
}

0 commit comments

Comments
 (0)