stable-diffusion
stable-diffusion copied to clipboard
cannot import name 'autocast' from 'torch'
Got the conda env, installs, downloads and everything all working smoothly now, no error messages but upon running this pops up:
Traceback (most recent call last):
File "stable-diffusion/scripts/txt2img.py", line 12, in
Having the same issue currently unfortunately
yes, I have the same issue for this problem.
For me, the issue was resolved by updating txt2img.py line 12 from from torch import autocast
to from torch.cuda.amp import autocast
.
I also needed to modify line 225 from with precision_scope("cuda"):
to with precision_scope(True):
.
I am calling the CLI and passing --precision=autocast
.