Reference only

SQLAlchemy and Alembic failures: preserve local data before changing anything

Separate missing libraries, database access and migration state without deleting the database.

Separate three concerns

SQLAlchemy is a database toolkit. Alembic documents migration environments and revision-based upgrades.12 We recommend treating Python imports, database access and migration state as separate checks.

python -m pip show SQLAlchemy alembic

First identify whether the database belongs to ComfyUI, a node or the launcher. Preserve its application version and backup procedure. Do not share a password-bearing connection string. A copy of a live database file is not automatically a recoverable backup.

For a missing library, follow the application's dependency requirements. For an access error, inspect the target and process permissions. For a missing revision, check that application code and migration files belong together. Do not use stamp head as a replacement for executing required migrations.

This guide does not assume the database is disposable. Test the documented recovery path on a copy and confirm that existing records remain readable before testing new writes. A successful command exit alone is not evidence that user data survived correctly.

Research draft. No local/GPU reproduction or independent editorial sign-off. Upstream statements and our recommendations are distinguished.

Didn't solve it?

Check the next possible cause

The same symptom can come from a different cause. Work through these related entries in order.

  1. Keep a reproducible ComfyUI repair record without exposing secretsCapture the environment and one controlled change while distinguishing metadata from runtime success.
  2. Where to run ComfyUI commands: PowerShell, CMD and virtual environmentsIdentify the shell, interpreter and working directory before copying an installation command.
Paste your full log into the error finder

Was this page helpful?

Anonymous. Only a yes/no counter is stored; no account, IP address or device details.

Sources & references

Research draft. No local/GPU reproduction or independent editorial sign-off. Upstream statements and our recommendations are distinguished.

01SQLAlchemy installation overviewSource checked: 2026-09-2102Alembic migration tutorialSource checked: 2026-09-21

Report an issue · 78032b6b-ec57-5575-906f-31bc5b2f2990