Add warning to catch torch import mistakes. (#8852)

pull/8456/merge
comfyanonymous 2025-07-09 22:03:27 -07:00 committed by GitHub
parent 1205afc708
commit 1fd306824d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -127,6 +127,9 @@ if __name__ == "__main__":
import cuda_malloc
if 'torch' in sys.modules:
logging.warning("WARNING: Potential Error in code: Torch already imported, torch should never be imported before this point.")
import comfy.utils
import execution