ModuleNotFoundError: No module named 'safetensors' in ComfyUI
Fix ComfyUI No module named safetensors errors by installing the Python safetensors package in the environment that starts ComfyUI.
If ComfyUI logs ModuleNotFoundError: No module named 'safetensors', the Python package safetensors is missing from the environment that launched ComfyUI.
This is different from a missing .safetensors model file. A model-placement problem says a checkpoint, LoRA, VAE, or diffusion model file cannot be found. A No module named 'safetensors' traceback means Python cannot import the library that reads the file format.
In the SEO Lab portable repair chain, this error appeared after CUDA Torch was repaired. Installing safetensors moved startup forward to the next missing dependency.
Fast answer
For the GitHub Windows portable package:
.\python_embeded\python.exe -s -m pip show safetensors
.\python_embeded\python.exe -s -m pip install "safetensors>=0.4.2"
.\python_embeded\python.exe -s -c "import safetensors; print('import ok')"
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-buildIf the next log names another package, continue one missing module at a time.
What The Log Looks Like
ModuleNotFoundError: No module named 'safetensors'The traceback may appear during startup, model loading, custom-node import, or a dependency repair chain after Torch starts importing successfully.
Quick Diagnosis
| What You See | Meaning | First Action |
|---|---|---|
No module named 'safetensors' | Python package missing | Install safetensors in the active ComfyUI Python |
.safetensors file not listed in dropdown | Model path problem | Use the model placement guide instead |
| Error changes after installing | The first blocker is fixed | Continue with the next missing module |
| Torch was just repaired | Normal sequence in broken portable environments | Verify CUDA Torch before stacking more packages |
Step 1: Confirm It Is Not A Model File Error
Use this page when the log says:
No module named 'safetensors'Use Where to Put Safetensors in ComfyUI when the problem is:
- a checkpoint does not appear in the dropdown
- a LoRA file is in the wrong folder
- ComfyUI cannot find a named
.safetensorsfile
Step 2: Install The Python Package
Windows portable:
.\python_embeded\python.exe -s -m pip install "safetensors>=0.4.2"Manual venv:
python -m pip install "safetensors>=0.4.2"Step 3: Restart And Read The Next Log
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-buildIf the error changes to No module named 'packaging', numpy, or another dependency, that is progress in a damaged portable environment. Repair the new first blocker rather than pasting a long requirements command.
What Not To Do
- do not move model files for a Python import error
- do not install into system Python when ComfyUI uses
python_embeded - do not reinstall Torch just because
safetensorsis missing - do not treat this as the same intent as
where to put safetensors
Related Guides
- Where to Put Safetensors in ComfyUI
- Repair ComfyUI Portable Dependencies One Missing Module At A Time
- Fix No module named errors in ComfyUI
- No module named 'einops' in ComfyUI
- ComfyUI Dependency Conflicts
Source References
- Windows portable SEO Lab repair, May 18, 2026:
ModuleNotFoundError: No module named 'safetensors'appeared after CUDA Torch repair - Same lab
ComfyUI\requirements.txt:safetensors>=0.4.2 - safetensors 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 packagesDid this fix your issue?
Your answer helps prioritize verified ComfyUI repairs.