LogoWonderful Launcher
  • Product
  • Pricing
  • Solutions
  • Docs
  • Blog
  • Get Help
  • Download

Repair ComfyUI Portable Dependencies One Missing Module At A Time

Needs verification

A tested Windows portable ComfyUI repair transcript for missing SQLAlchemy, torch, frontend package, kornia, PyOpenGL, and other startup dependencies.

If a Windows portable ComfyUI environment starts failing with missing core packages, do not begin with a broad reinstall.

The safer repair loop is:

  1. start ComfyUI
  2. read the first new blocker in the log
  3. install only that package in python_embeded
  4. start again
  5. repeat until the server, /system_stats, /object_info, and pip check are healthy

This page is based on a real broken portable environment repaired on May 18, 2026. The lab started with ModuleNotFoundError: No module named 'sqlalchemy' and eventually recovered on an RTX 4070 Ti SUPER with CUDA PyTorch.

Practical rule

Run one install, then restart and read the new log. A copied error search should lead to the exact package that changed the next startup attempt, not to a giant command that hides what actually fixed the environment.

When To Use This Runbook

Use this page when:

  • ComfyUI portable starts with python_embeded\python.exe
  • startup stops before Starting server
  • you see copied errors such as ModuleNotFoundError: No module named 'sqlalchemy', No module named 'torch', or comfyui-frontend-package is not installed
  • your models, workflows, and custom nodes are worth preserving
  • you want to know which package changed the next failure, instead of reinstalling everything

Do not use this as a universal upgrade command. If only one custom node is missing one package, fix that custom node first.

The Tested Repair Chain

This was the actual one-package-at-a-time sequence from the repaired lab.

AttemptFirst new signal in the startup logOne package actionWhat changed after restart
1ModuleNotFoundError: No module named 'sqlalchemy'pip install "SQLAlchemy>=2.0"exposed filelock
2ModuleNotFoundError: No module named 'filelock'pip install filelockexposed alembic and yaml
3Error importing dependencies: No module named 'alembic'pip install alembicdatabase setup moved forward
4ModuleNotFoundError: No module named 'yaml'pip install PyYAMLexposed PIL
5ModuleNotFoundError: No module named 'PIL'pip install Pillowexposed tqdm
6ModuleNotFoundError: No module named 'tqdm'pip install tqdmexposed comfy_aimdo
7ModuleNotFoundError: No module named 'comfy_aimdo'pip install comfy-aimdoexposed torch
8ModuleNotFoundError: No module named 'torch'installed torch, then replaced CPU Torch with torch==2.12.0+cu130 from the PyTorch CUDA indexCUDA became available
9ModuleNotFoundError: No module named 'safetensors'pip install safetensorsexposed packaging
10ModuleNotFoundError: No module named 'packaging'pip install packagingexposed numpy
11ModuleNotFoundError: No module named 'numpy'pip install "numpy>=1.25.0"exposed einops
12ModuleNotFoundError: No module named 'einops'pip install einopsexposed psutil
13ModuleNotFoundError: No module named 'psutil'pip install psutilComfyUI reached VRAM detection, then exposed torchvision
14ModuleNotFoundError: No module named 'torchvision'installed torchvision from the same CUDA wheel indexexposed torchaudio
15ModuleNotFoundError: No module named 'torchaudio'installed torchaudio from the same CUDA wheel indexexposed scipy
16ModuleNotFoundError: No module named 'scipy'pip install scipyexposed transformers
17ModuleNotFoundError: No module named 'transformers'pip install transformersexposed torchsde
18ModuleNotFoundError: No module named 'torchsde'pip install torchsdeexposed av
19ModuleNotFoundError: No module named 'av'pip install avexposed aiohttp
20ModuleNotFoundError: No module named 'aiohttp'pip install aiohttpexposed requests
21ModuleNotFoundError: No module named 'requests'pip install requestsexposed pydantic
22ModuleNotFoundError: No module named 'pydantic'pip install pydanticexposed comfyui-frontend-package
23comfyui-frontend-package is not installedpip install comfyui-frontend-packageserver started, but some built-in extra nodes failed to import

At that point ComfyUI was alive, but the log still showed missing optional or built-in-extra dependencies. The cleanup pass continued in the same style:

Cleanup signalOne package actionResult
No module named 'kornia' in post-processing, canny, and morphology nodespip install kornianode count rose from 657 to 685
No module named 'spandrel' in nodes_upscale_model.pypip install spandrelnode count rose to 687
repeated No module named 'pydantic_settings' while parsing pyproject.tomlpip install pydantic-settingsthe startup log shrank from noisy repeats to a short warning set
OpenGL dependencies not availablepip install PyOpenGL, restart, then pip install glfwGLSL/OpenGL node imported
No module named 'simpleeval' in nodes_math.pypip install simpleevalno IMPORT FAILED lines remained
comfyui-workflow-templates is not installedpip install comfyui-workflow-templatesworkflow template warning disappeared
comfyui-embedded-docs package not foundpip install "comfyui-embedded-docs==0.4.4"embedded docs warning disappeared
WARNING: blake3 package not installedpip install blake3blake3 warning disappeared
Failed to import comfy_kitchenpip install "comfy-kitchen>=0.2.8"CUDA and eager comfy_kitchen backends loaded

The final log still said the comfy_kitchen Triton backend was unavailable because triton was not installed. That was not a startup blocker: the CUDA and eager backends were available and the server opened normally.

Step 0: Start From The Portable Root

Open PowerShell in the folder that contains:

run_nvidia_gpu.bat
run_cpu.bat
python_embeded
ComfyUI

Confirm the Python executable:

.\python_embeded\python.exe -s -c "import sys; print(sys.executable); print(sys.version)"

If this path is not the Python that starts ComfyUI, stop and switch to the right environment.

Step 1: Capture Each Attempt

For a one-by-one repair, save logs for each start:

$ts = Get-Date -Format 'yyyyMMdd_HHmmss'
New-Item -ItemType Directory -Force .\repair_logs | Out-Null
$out = ".\repair_logs\attempt_${ts}_stdout.log"
$err = ".\repair_logs\attempt_${ts}_stderr.log"
Start-Process -FilePath ".\python_embeded\python.exe" `
  -ArgumentList @("-s", "ComfyUI\main.py", "--windows-standalone-build") `
  -WorkingDirectory (Get-Location) `
  -RedirectStandardOutput $out `
  -RedirectStandardError $err `
  -PassThru

Then read the bottom of the stderr log:

Get-Content $err -Tail 200

Install only the package named by the first real blocker. Then start again and save a new log.

Step 2: Do Not Trust Port 8188 Until You Check Ownership

In the lab, http://127.0.0.1:8188/ returned 200, but it was another ComfyUI process from C:\Users\huhaibin\Documents\ComfyUI, not the broken lab.

Check the owner before declaring success:

Get-NetTCPConnection -LocalPort 8188 -ErrorAction SilentlyContinue |
  Select-Object LocalAddress,LocalPort,State,OwningProcess

Get-CimInstance Win32_Process |
  Where-Object { $_.CommandLine -like "*ComfyUI*main.py*" } |
  Select-Object ProcessId,CommandLine

If 8188 is already occupied, start the broken environment on a clean port while repairing:

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

Only the process from the same portable root counts as proof.

Step 3: Verify Torch Before And After Installing It

If the log says No module named 'torch', installing torch from the default index may satisfy the import while giving you a CPU-only build.

That happened in the lab:

2.12.0+cpu None False

For the tested Nvidia repair, Torch had to be replaced from the CUDA wheel index:

.\python_embeded\python.exe -s -m pip install `
  --index-url https://download.pytorch.org/whl/cu130 `
  --extra-index-url https://pypi.tuna.tsinghua.edu.cn/simple `
  "torch==2.12.0+cu130"

Then verify in the same embedded Python:

.\python_embeded\python.exe -s -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available()); print(torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'no cuda')"

The lab recovered this result:

2.12.0+cu130 13.0 True
NVIDIA GeForce RTX 4070 Ti SUPER

Use the CUDA wheel that matches your environment. Do not assume the default pip install torch is GPU-enabled.

Step 4: Treat Frontend And Template Packages As ComfyUI Versioned Packages

When the log says:

comfyui-frontend-package is not installed.

look at your own ComfyUI\requirements.txt before choosing versions.

In the lab, installing the frontend package unpinned gave:

ComfyUI frontend version: 1.43.18
required_frontend_version: 1.42.15

It worked, but the safer public instruction is: copy the versions required by your local ComfyUI code when they are pinned.

The same applies to:

  • comfyui-frontend-package
  • comfyui-workflow-templates
  • comfyui-embedded-docs

Step 5: Verify Recovery With More Than The Browser

The final lab start used:

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

Healthy signals:

ComfyUI version: 0.20.1
pytorch version: 2.12.0+cu130
Device: cuda:0 NVIDIA GeForce RTX 4070 Ti SUPER : cudaMallocAsync
ComfyUI frontend version: 1.43.18
comfy-kitchen version: 0.2.8
Starting server
To see the GUI go to: http://127.0.0.1:8191

Then verify endpoints:

Invoke-RestMethod http://127.0.0.1:8191/system_stats
Invoke-RestMethod http://127.0.0.1:8191/object_info
.\python_embeded\python.exe -s -m pip check

The repaired lab returned:

ComfyUI 0.20.1
PyTorch 2.12.0+cu130
GPU: NVIDIA GeForce RTX 4070 Ti SUPER
object_info node count: 689
CheckpointLoaderSimple: present
KSampler: present
ComfyMathExpression: present
pip check: No broken requirements found.

What Is A Blocker And What Is Only A Warning?

Log lineBlocker?What to do
ModuleNotFoundError: No module named 'sqlalchemy' before server startYesInstall SQLAlchemy in ComfyUI's embedded Python, then restart
ModuleNotFoundError: No module named 'torch'YesInstall Torch, then verify CUDA, not just import success
comfyui-frontend-package is not installedYesInstall the frontend package required by local ComfyUI
IMPORT FAILED: nodes_math.pyPartialServer can start, but that node is missing; install simpleeval
Starting server appearsNoServer has started; continue with endpoint verification
Found comfy_kitchen backend triton: {'available': False, ...}Usually noIgnore unless a workflow actually requires Triton
/system_stats returns the expected GPUNoGood sign that runtime is alive

One Package At A Time Or Requirements All At Once?

Use this decision:

SituationBetter move
You are diagnosing an unknown broken portable environmentOne package, restart, read the next log
The first error is a custom node missing one packageInstall that node's package or requirements
Torch imports but CUDA is falseFix the CUDA Torch wheel first
Torch/CUDA is healthyAvoid broad commands that may replace it
You are creating a fresh clean environmentpip install -r ComfyUI\requirements.txt can be normal

A blind pip install -r ComfyUI\requirements.txt can be acceptable for a clean manual install, but it is not the best forensic repair loop when you need to understand what broke.

What Not To Do

  • do not use system pip when ComfyUI uses python_embeded
  • do not assume a browser page on 8188 belongs to the environment you are repairing
  • do not treat CPU Torch import success as CUDA success
  • do not paste a long package list when you are trying to learn the next log change
  • do not treat every warning after Starting server as fatal
  • do not delete the environment before preserving workflows, models, and custom nodes

How Wonderful Launcher Helps

The hard part of this repair is not memorizing package names. It is the loop:

  • start
  • capture the first real error
  • repair the right Python
  • start again
  • distinguish blockers from warnings
  • verify the app is really alive

Wonderful Launcher is built around that recovery loop. It makes environment boundaries and startup logs easier to reason about, especially when a portable ComfyUI install has been modified by plugins over time.

Related Guides

  • ModuleNotFoundError: No module named 'sqlalchemy' in ComfyUI
  • comfyui-frontend-package is not installed in ComfyUI
  • ModuleNotFoundError: No module named 'torch' in ComfyUI
  • ModuleNotFoundError: No module named 'transformers' in ComfyUI
  • ModuleNotFoundError: No module named 'kornia' in ComfyUI
  • OpenGL dependencies not available in ComfyUI
  • ComfyUI Startup Failed
  • ComfyUI Dependency Conflicts
  • ModuleNotFoundError: No module named 'triton' in ComfyUI
  • Torch Not Compiled With CUDA Enabled

Source References

  • Windows portable repair lab, May 18, 2026: E:\ComfyUI_portable\ComfyUI_SEO_Lab
  • First fatal log: ModuleNotFoundError: No module named 'sqlalchemy'
  • Important pitfall: 8188 belonged to another ComfyUI process, so the lab was verified on port 8191
  • Final lab launch: ComfyUI 0.20.1, frontend 1.43.18, PyTorch 2.12.0+cu130, GPU NVIDIA GeForce RTX 4070 Ti SUPER
  • Final endpoint check: /object_info reported 689 nodes and pip check returned No broken requirements found

You can fix it manually, or download Wonderful Launcher for Windows to diagnose plugin errors, missing dependencies, and broken ComfyUI environments without reinstalling.

Download free for Windows

Did this fix your issue?

Your answer helps prioritize verified ComfyUI repairs.

Table of Contents

When To Use This Runbook
The Tested Repair Chain
Step 0: Start From The Portable Root
Step 1: Capture Each Attempt
Step 2: Do Not Trust Port 8188 Until You Check Ownership
Step 3: Verify Torch Before And After Installing It
Step 4: Treat Frontend And Template Packages As ComfyUI Versioned Packages
Step 5: Verify Recovery With More Than The Browser
What Is A Blocker And What Is Only A Warning?
One Package At A Time Or Requirements All At Once?
What Not To Do
How Wonderful Launcher Helps
Related Guides
Source References