Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

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

comfyanonymous1fd306824d35
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