LogoWonderful Launcher
  • Home
  • Pricing
  • Docs
  • Download

ModuleNotFoundError: No module named 'torchsde' in ComfyUI

Partially verifiedMedium riskLast verified 2026-07-09

Fix ComfyUI No module named torchsde errors by installing torchsde after verifying the active Torch and CUDA environment.

If ComfyUI logs ModuleNotFoundError: No module named 'torchsde', install the Python package torchsde in the same environment that launches ComfyUI.

Because torchsde sits near the PyTorch stack, check Torch first. If your Torch import is CPU-only or CUDA is broken, repair Torch/CUDA before adding more packages.

In the SEO Lab portable repair chain, missing torchsde appeared after transformers was installed. Installing torchsde exposed the next dependency, av.

Fast answer

For the GitHub Windows portable package:

.\python_embeded\python.exe -s -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"
.\python_embeded\python.exe -s -m pip show torchsde
.\python_embeded\python.exe -s -m pip install torchsde
.\python_embeded\python.exe -s -c "import torchsde; print('import ok')"
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build

What The Log Looks Like

ModuleNotFoundError: No module named 'torchsde'

This often appears after the core model stack starts loading successfully enough to reach sampler or model utility imports.

Quick Diagnosis

What You SeeMeaningFirst Action
No module named 'torchsde'torchsde package missingInstall torchsde in ComfyUI's Python
Torch import fails firstLower-level problemFix Torch before torchsde
torch.cuda.is_available() is false unexpectedlyCUDA Torch problemUse the CUDA Torch guide first
Error changes to No module named 'av'Repair chain moved forwardContinue with the AV guide

Step 1: Verify Torch First

Windows portable:

.\python_embeded\python.exe -s -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"

Manual venv:

python -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"

If CUDA should be available but the output is CPU-only or false, do not start with torchsde. Fix Torch/CUDA first.

Step 2: Install torchsde

Windows portable:

.\python_embeded\python.exe -s -m pip install torchsde

Manual venv:

python -m pip install torchsde

Then verify:

.\python_embeded\python.exe -s -c "import torchsde; print('import ok')"

Step 3: Restart ComfyUI

.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build

If the next missing package is av, that means the startup chain moved past torchsde.

What Not To Do

  • do not install torchsde before checking that Torch imports
  • do not let pip install torchsde replace your working CUDA Torch stack
  • do not use system Python when ComfyUI uses python_embeded
  • do not treat this as a model-file problem

Related Guides

  • ModuleNotFoundError: No module named 'torch' in ComfyUI
  • Torch Not Compiled With CUDA Enabled
  • No module named 'av' in ComfyUI
  • Repair ComfyUI Portable Dependencies One Missing Module At A Time
  • Fix No module named errors in ComfyUI

Source References

  • Windows portable SEO Lab repair, May 18, 2026: ModuleNotFoundError: No module named 'torchsde' appeared after Transformers repair
  • Same lab ComfyUI\requirements.txt: torchsde
  • torchsde on PyPI

Start free with Wonderful Launcher if this affects your real ComfyUI environment. It keeps launcher-native repair, task logs, and runtime checks in one place; credits are only for image generation and metered tools.

Download Wonderful LauncherSee credit packages

Did this fix your issue?

Your answer helps prioritize verified ComfyUI repairs.

Table of Contents

What The Log Looks Like
Quick Diagnosis
Step 1: Verify Torch First
Step 2: Install torchsde
Step 3: Restart ComfyUI
What Not To Do
Related Guides
Source References