Runtime crash on start.bat after installing Python via uv (torch / optimum incompatibility)
Summary
On Windows, following the official install flow (including installing Python via uv when prompted), install.bat completes successfully. However, running start.bat fails at runtime with an ImportError related to torch.onnx.symbolic_opset14._attention_scale.
This appears to be caused by an incompatible torch version being installed by uv, due to torch not being version-pinned.
Environment
Steps to reproduce
- On a clean Windows system without Python:
- Run
install.bat
- When prompted, install Python using uv’s official installer (link provided by the script)
- Re-run
install.bat (completes successfully)
- Run
start.bat
Actual behavior
Application crashes immediately at startup with:
ImportError: cannot import name '_attention_scale'
from 'torch.onnx.symbolic_opset14'
Traceback goes through:
optimum.exporters.onnx.model_patcher
→ torch.onnx.symbolic_opset14
Expected behavior
After following the installer’s guidance and a successful install, start.bat should launch the application.
Investigation / Findings
-
torch is importable and reports version:
python -c "import torch; print(torch.__version__)"
-
pip uninstall torch does not work because torch was installed by uv, not pip
-
optimum.exporters.onnx imports _attention_scale, which no longer exists in newer torch versions
-
This causes a runtime import failure, not an installation failure
Verified:
python -c "import torch.onnx.symbolic_opset14 as s; print(hasattr(s, '_attention_scale'))"
# False
Root cause
install.bat relies on uv for dependency installation
torch is not pinned in requirements.txt
- uv installs the latest available torch (
2.10.0+cpu)
- That torch version is incompatible with Optimum’s ONNX exporter
Workaround
Manually pin torch to a compatible version, delete env, and re-run install:
(or explicitly)
After this, start.bat runs correctly.
Suggested fix
- Pin torch to a compatible version in
requirements.txt
- Or document tested torch versions in the README
This would prevent a successful install followed by an immediate runtime crash.
Runtime crash on
start.batafter installing Python via uv (torch / optimum incompatibility)Summary
On Windows, following the official install flow (including installing Python via uv when prompted),
install.batcompletes successfully. However, runningstart.batfails at runtime with anImportErrorrelated totorch.onnx.symbolic_opset14._attention_scale.This appears to be caused by an incompatible torch version being installed by uv, due to torch not being version-pinned.
Environment
OS: Windows 10 / 11
FastSD CPU version:
1.0.0-beta.281Install method:
Ran
install.batPython was missing, so followed the installer prompt
Installed Python using uv’s official instructions:
(from https://docs.astral.sh/uv/getting-started/installation/)
Re-ran
install.bat→ completed successfullyPython: installed via uv
Torch installed by uv:
2.10.0+cpuSteps to reproduce
install.batinstall.bat(completes successfully)start.batActual behavior
Application crashes immediately at startup with:
Traceback goes through:
Expected behavior
After following the installer’s guidance and a successful install,
start.batshould launch the application.Investigation / Findings
torchis importable and reports version:python -c "import torch; print(torch.__version__)"pip uninstall torchdoes not work because torch was installed by uv, not pipoptimum.exporters.onnximports_attention_scale, which no longer exists in newer torch versionsThis causes a runtime import failure, not an installation failure
Verified:
python -c "import torch.onnx.symbolic_opset14 as s; print(hasattr(s, '_attention_scale'))" # FalseRoot cause
install.batrelies on uv for dependency installationtorchis not pinned inrequirements.txt2.10.0+cpu)Workaround
Manually pin torch to a compatible version, delete
env, and re-run install:(or explicitly)
After this,
start.batruns correctly.Suggested fix
requirements.txtThis would prevent a successful install followed by an immediate runtime crash.