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

This commit is contained in:
comfyanonymous
2025-07-10 01:03:27 -04:00
committed by GitHub
parent 7d5d2e4bdd
commit 912e395336
+3
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