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

This commit is contained in:
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

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