Free | No tracking | Every fact with a source|German and English

Error / Installation

module 'torch' has no attribute 'float8_e4m3fn' (PyTorch too old for fp8)

Your PyTorch is too old and does not know the 8-bit number format fp8 that the program or model wants to use yet.

The message

AttributeError: module 'torch' has no attribute 'float8_e4m3fn'

Affects: AUTOMATIC1111 Stable Diffusion WebUI, ComfyUI, Python

Why is this happening?

The data type torch.float8_e4m3fn has only been available since PyTorch 2.1. If an older version is installed, any access to it will fail with this message. In AUTOMATIC1111, this happens when the “FP8 weight” option is enabled but PyTorch 2.0 is still in the venv: updating the WebUI with git pull does not automatically replace an already installed PyTorch. Special builds (e.g. for Jetson) with a pre-release version of 2.1 are also affected.

How to fix it

  1. Check your PyTorch version. AUTOMATIC1111: in the stable-diffusion-webui folder, run venv\Scripts\python.exe -c "import torch; print(torch.__version__)". ComfyUI portable: in the ComfyUI_windows_portable folder, run .\python_embeded\python.exe -c "import torch; print(torch.__version__)". Anything below 2.1 is too old.
  2. AUTOMATIC1111, quick fix: Under Settings > Optimizations, set the “FP8 weight” option to “Disable”.
  3. AUTOMATIC1111, proper solution: In webui-user.bat, add --reinstall-torch once to set COMMANDLINE_ARGS= and start it. The WebUI will then install the PyTorch version that matches its state (from version 1.8.0 onward, that is 2.1.2). After that, remove the option again.
  4. ComfyUI portable: The easiest way is to download the current portable version again. Or update PyTorch with .\python_embeded\python.exe -m pip install --upgrade torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130 (for RTX 20 and newer; keep the driver up to date).
  5. ComfyUI installed manually: Activate the venv and run pip install --upgrade torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130.
  6. If a newer PyTorch is not possible (e.g. on special hardware), use models in fp16 or GGUF instead of fp8.

Set up from scratch again

If it still doesn’t work after that, a fresh setup step by step often helps:

Terms for this

Similar errors

Sources

Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.