Stable Diffusion ubuntu deployment, problem recording
Stable Diffusion ubuntu deployment, problem recording
Question one
When using Tushengtu, an error is reported
NansException: A tensor with all NaNs was produced in Unet. This could be either because there's not enough precision to represent the picture, or because your video card does not support half type. Try setting the "Upcast cross attention layer to float32" option in Settings > [Stable Diffusion](/search?q=Stable Diffusion) or using the --no-half commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check.
Solution 1 (I changed this separately but it didn’t take effect):
1. Modify the configuration on the web page:
Settings > Stable Diffusion
application settings and reload
Solution two (this is only suitable for windows deployment):
Another workaround is to start with the option –no-half.
Change the webui-user.bat file to:
webui-user.bat before change (example)
@echo off
set GIT_PYTHON_REFRESH=quiet
set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=
call webui.bat
COMMANDLINE_ARGS=–no-half added
after changing webui-user.bat (example)
@echo off
set GIT_PYTHON_REFRESH=quiet
set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=--no-half
call webui.bat
Solution three:
1. Before executing the startup command, set the environment variables
export COMMANDLINE_ARGS="--xformers --no-half-vae"
2. Execute the startup command again
./SD_start.sh
I also modified this script, but it didn't take effect. I don't know if I changed it in the wrong place. There is a webui-user.sh file in the stable-diffusion-webui directory, and there
is also a file in stable-diffusion-webui/stable-diffusion-webui/ There is a webui-user.sh file. I changed the file in the directory below, but it didn’t take effect. Finally, I set the environment variables in the terminal and then started it, and it took effect.
vim stable-diffusion-webui/stable-diffusion-webui/webui-user.sh +13
Question two:
(Error reported when using SDXLRonghua_v11.safetensors model)
OutOfMemoryError: CUDA out of memory. Tried to allocate 3.96 GiB (GPU 0; 15.75 GiB total capacity; 6.81 GiB already allocated; 3.74 GiB free; 10.99 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
1. Before executing the startup command, set the environment variables
export COMMANDLINE_ARGS="--xformers --no-half-vae"
2. Execute the startup command again
./SD_start.sh