Auto-enable PYTORCH_ENABLE_MPS_FALLBACK for ComfyUI compatibility#6
Draft
Auto-enable PYTORCH_ENABLE_MPS_FALLBACK for ComfyUI compatibility#6
Conversation
…sage Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix AttributeError in torch.mps module
Add version check for torch.mps.compile_shader (PyTorch 2.10+)
Feb 13, 2026
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot
AI
changed the title
Add version check for torch.mps.compile_shader (PyTorch 2.10+)
Replace hard error with automatic backend fallback for PyTorch < 2.10
Feb 14, 2026
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot
AI
changed the title
Replace hard error with automatic backend fallback for PyTorch < 2.10
Auto-enable PYTORCH_ENABLE_MPS_FALLBACK for ComfyUI compatibility
Feb 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ComfyUI custom node now sets
PYTORCH_ENABLE_MPS_FALLBACK=1to prevent crashes from unsupported MPS operations.Changes
__init__.py: Set environment variable before torch import usingsetdefault()to allow user override__init__.py: Display actual fallback status in console outputREADME.md: Remove manual environment variable setup instructionsImplementation
Console output now shows:
Users can override by setting
PYTORCH_ENABLE_MPS_FALLBACK=0before ComfyUI startup.Original prompt
This section details on the original issue you should resolve
<issue_title>AttributeError: module 'torch.mps' has no attribute 'compile_shader'</issue_title>
<issue_description>
ComfyUI Error Report
Error Details
Stack Trace