[PR #3387] [CLOSED] fix: treat torchaudio as optional in PyTorch recovery #3254

Closed
opened 2026-10-28 21:16:29 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/ComfyUI-Manager/pull/3387
Author: @0nikod
Created: 10/17/2026
Status: ❌ Closed

Base: main ← Head: fix/optional-torchaudio-checks


📝 Commits (1)

  • 337f2d1 fix: treat torchaudio as optional in PyTorch recovery

📊 Changes

1 file changed (+2 additions, -3 deletions)

View changed files

📝 glob/manager_util.py (+2 -3)

📄 Description

Summary

Remove the mandatory torchaudio assumption from PyTorch recovery checks. Environments with torch and torchvision installed no longer report PyTorch is not installed solely because torchaudio is absent.

Background

ComfyUI removed its mandatory torchaudio dependency in https://github.com/Comfy-Org/ComfyUI/pull/16457. Manager still required torchaudio in its initial package inventory and compared its version when deciding whether to restore PyTorch.

Changes

  • Require only torch and torchvision in the initial inventory check.
  • Stop using torchaudio version changes as a trigger for PyTorch recovery.
  • Preserve existing rollback commands, version mappings, platform indexes, package blacklists, and snapshot protection.

Reproduction

With unchanged torch==2.7.0+cu128 and torchvision==0.22.0+cu128 installed but no torchaudio, Manager previously logged:

[ComfyUI-Manager] PyTorch is not installed

This environment now passes the recovery check without a PyTorch error or rollback.

Testing

  • Ran nine isolated recovery scenarios against the final implementation using uv run --no-project --with aiohttp --with ruff python and mocked inventories, logging, subprocess calls, and rollback. All passed: unchanged environments with and without audio; missing torch or torchvision; torch or torchvision version changes; and torchaudio addition, removal, and version changes. No subprocess calls were executed.
  • uv run --no-project --with aiohttp --with ruff ruff check --no-cache .: passed.
  • git diff --check and staged diff check: passed.
  • No test files are added. The full suite was not rerun for this reduced patch.

Compatibility

Existing torch and torchvision validation and recovery behavior remain unchanged. This patch only adjusts recovery triggers: if a required-package change triggers rollback, the existing installation commands can still install torchaudio. No runtime dependencies or snapshot formats change. No real PyTorch installation or GPU execution was performed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/ComfyUI-Manager/pull/3387 **Author:** [@0nikod](https://github.com/0nikod) **Created:** 10/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/optional-torchaudio-checks` --- ### 📝 Commits (1) - [`337f2d1`](https://github.com/Comfy-Org/ComfyUI-Manager/commit/337f2d146401be12857c29361e158ec50f66fc34) fix: treat torchaudio as optional in PyTorch recovery ### 📊 Changes **1 file changed** (+2 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `glob/manager_util.py` (+2 -3) </details> ### 📄 Description ## Summary Remove the mandatory torchaudio assumption from PyTorch recovery checks. Environments with torch and torchvision installed no longer report `PyTorch is not installed` solely because torchaudio is absent. ## Background ComfyUI removed its mandatory torchaudio dependency in https://github.com/Comfy-Org/ComfyUI/pull/16457. Manager still required torchaudio in its initial package inventory and compared its version when deciding whether to restore PyTorch. ## Changes - Require only torch and torchvision in the initial inventory check. - Stop using torchaudio version changes as a trigger for PyTorch recovery. - Preserve existing rollback commands, version mappings, platform indexes, package blacklists, and snapshot protection. ## Reproduction With unchanged `torch==2.7.0+cu128` and `torchvision==0.22.0+cu128` installed but no torchaudio, Manager previously logged: ```text [ComfyUI-Manager] PyTorch is not installed ``` This environment now passes the recovery check without a PyTorch error or rollback. ## Testing - Ran nine isolated recovery scenarios against the final implementation using `uv run --no-project --with aiohttp --with ruff python` and mocked inventories, logging, subprocess calls, and rollback. All passed: unchanged environments with and without audio; missing torch or torchvision; torch or torchvision version changes; and torchaudio addition, removal, and version changes. No subprocess calls were executed. - `uv run --no-project --with aiohttp --with ruff ruff check --no-cache .`: passed. - `git diff --check` and staged diff check: passed. - No test files are added. The full suite was not rerun for this reduced patch. ## Compatibility Existing torch and torchvision validation and recovery behavior remain unchanged. This patch only adjusts recovery triggers: if a required-package change triggers rollback, the existing installation commands can still install torchaudio. No runtime dependencies or snapshot formats change. No real PyTorch installation or GPU execution was performed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-28 21:16:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/ComfyUI-Manager#3254
No description provided.