LogoWonderful Launcher
  • Home
  • Pricing
  • Docs
  • Download

No module named 'transformers' in ComfyUI

Partially verifiedLow riskTested on Windows 10, Windows 11 | portable | Python 3.11 | CUDA 12.x | Torch 2.x | ComfyUI portable repair lab and manual venv patternLast verified 2026-05-21Estimated time 5-15 minutes

Fix ComfyUI No module named transformers errors in the active Python environment and understand when the failure comes from ComfyUI's core text stack.

ComfyUI stops with ModuleNotFoundError: No module named 'transformers'. This is not always a plugin problem: in current builds the error often comes from ComfyUI's own text and tokenizer stack, where the traceback runs through comfy\sd1_clip.py and fails on from transformers import CLIPTokenizer before the server starts.

File "...\ComfyUI\comfy\sd1_clip.py", line 3, in <module>
  from transformers import CLIPTokenizer
ModuleNotFoundError: No module named 'transformers'

That path is ComfyUI's own model/tokenizer import, not a random custom node.

Triage

What you seeMeaningFirst action
No module named 'transformers' from comfy\sd1_clip.pyCore text/tokenizer dependency missingInstall transformers in ComfyUI's active Python
pip show transformers works in system Python but ComfyUI still failsWrong Python environmentUse python_embeded\python.exe or the active venv
Local requirements.txt lists transformers>=... / tokenizers>=...ComfyUI expects this package familyRepair it from the same environment
Installing transformers exposes a new missing packageWider dependency driftKeep following the new first blocker
Server already starts and only a plugin fails on transformersCould be plugin-specificStill install into the same ComfyUI Python first

Step 1: Check the local requirement line

Get-Content ComfyUI\requirements.txt | Select-String "transformers|tokenizers"

A recent ComfyUI requirement is transformers>=4.50.3 and tokenizers>=0.13.3. This tells you whether your ComfyUI code already expects the package, and which version to match.

Step 2: Install in the Python that launches ComfyUI

For Windows portable:

.\python_embeded\python.exe -s -m pip install "transformers>=4.50.3"

For a manual venv:

python -m pip install "transformers>=4.50.3"

This may also install adjacent packages such as tokenizers, huggingface-hub, and regex. Use the version in your own local requirements.txt when it differs. For ComfyUI Desktop or another managed launcher, install through that app's environment, not a separate terminal Python.

Step 3: Restart and read the next blocker

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

In a broken portable environment, transformers is often not the last missing package (a common next blocker is No module named 'torchsde'). Fix the next first blocker in the same Python rather than guessing several packages at once.

Step 4: Distinguish core failure from plugin failure

If the traceback points into ComfyUI\comfy\sd1_clip.py, supported_models.py, or sd.py, the missing transformers import is part of ComfyUI's own text stack. If it points into a folder under custom_nodes, it may be plugin-specific — but the repair still belongs in the same Python environment that launches ComfyUI.

What not to do

  • do not install transformers into system Python when ComfyUI uses python_embeded
  • do not downgrade Torch, NumPy, or Pillow when the only error is a missing transformers import
  • do not assume a plugin error means core ComfyUI is healthy until you read the traceback path
  • do not keep installing packages without restarting and reading the new first blocker

Related Guides

  • Repair ComfyUI Portable Dependencies One Missing Module At A Time
  • ModuleNotFoundError: No module named 'torch' in ComfyUI
  • comfyui-frontend-package is not installed in ComfyUI
  • ComfyUI Startup Failed
  • Plugin Missing Module Warning: When It Is Safe to Ignore

Source References

  • ComfyUI custom node troubleshooting guide
Related guides:Start from the No module named hubFix Torch missing errorsConfirm the active Python

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

Triage
Step 1: Check the local requirement line
Step 2: Install in the Python that launches ComfyUI
Step 3: Restart and read the next blocker
Step 4: Distinguish core failure from plugin failure
What not to do
Related Guides
Source References