No module named 'diffusers' in ComfyUI
Fix ComfyUI ModuleNotFoundError: No module named 'diffusers' caused by custom nodes that depend on the Hugging Face Diffusers library.
Community Knowledge
This page is based on common ComfyUI troubleshooting patterns and has not been fully tested across all environments. Back up your environment before changing packages.
If ComfyUI logs ModuleNotFoundError: No module named 'diffusers', a custom node that depends on the Hugging Face Diffusers library cannot load.
ComfyUI itself does not require diffusers. This error comes from third-party custom nodes that use the Diffusers pipeline for model loading, conversion, or inference. Common examples include nodes for Stable Diffusion pipelines, IP-Adapter, AnimateDiff, or model conversion utilities.
Fast answer
For the GitHub Windows portable package:
.\python_embeded\python.exe -s -m pip install diffusers
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-buildFor a manual venv install, activate your environment first, then run python -m pip install diffusers.
What the error looks like
IMPORT FAILED: ComfyUI-ExampleNode
Traceback (most recent call last):
File "...\custom_nodes\ComfyUI-ExampleNode\__init__.py", line 3, in <module>
from diffusers import StableDiffusionPipeline
ModuleNotFoundError: No module named 'diffusers'The exact custom node name will vary. The key indicator is No module named 'diffusers' in the traceback.
Why it happens
- The custom node was installed (cloned or downloaded) but its
requirements.txtwas never run - ComfyUI Manager installed the node files but did not install Python dependencies
- You reinstalled or updated ComfyUI and the new environment does not have
diffusers - A previous
pip installbroke the package and it was silently uninstalled during conflict resolution
Quick diagnosis
| Check | Command (portable) | Expected |
|---|---|---|
| Is diffusers installed? | .\python_embeded\python.exe -s -m pip show diffusers | Shows version and location |
| Which node needs it? | Read the IMPORT FAILED line in the startup log | Names the custom node folder |
| Any conflicts? | .\python_embeded\python.exe -s -m pip check | No broken requirements |
Safe manual fix
Step 1: Install diffusers in the correct Python
For Windows portable:
.\python_embeded\python.exe -s -m pip install diffusersFor a manual venv:
python -m pip install diffusersThis will also install dependencies like safetensors, huggingface-hub, and regex if they are not already present.
Step 2: If the custom node has its own requirements.txt
Check the plugin folder for a requirements file:
Get-Content ComfyUI\custom_nodes\<node-name>\requirements.txtIf it exists, install from it, but read it first to make sure it will not downgrade torch or other core packages:
.\python_embeded\python.exe -s -m pip install -r ComfyUI\custom_nodes\<node-name>\requirements.txtStep 3: Restart and verify
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-buildCheck the startup log. The IMPORT FAILED line for that node should be gone.
When not to run pip install blindly
diffusers has many dependencies and updates frequently. Be careful about:
- Installing a version that conflicts with your current
transformersortorchversion - Running
pip install diffusers --upgradewhen a custom node needs a specific version - Installing
diffusers[torch]extras that might pull a CPU-only torch build
If pip check shows conflicts after installing, fix the specific version mismatch rather than upgrading everything.
How Wonderful Launcher can help
Wonderful Launcher can help detect and resolve this issue. It helps manage your ComfyUI environment and dependencies safely, reducing the risk of version conflicts that diffusers updates can cause.
Download Wonderful Launcher — it's free and can recover your environment without reinstalling.
Related errors
- ComfyUI Plugin Import Failed
- ComfyUI Transformers Missing
- ComfyUI Dependency Conflicts
- Plugin Missing Module Warning: When It Is Safe to Ignore
- ComfyUI Startup Failed
Source References
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.