From 233fb5455f500c275bf5242a760fe936cc2c5174 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 10 Jul 2025 00:59:04 -0400 Subject: [PATCH] Add warning to catch torch import mistakes. --- main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.py b/main.py index d488c0f4c..0b1987ef4 100644 --- a/main.py +++ b/main.py @@ -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