Stable Diffusion ubuntu 部署,问题记录

问题一

在使用图生图时,报错
在这里插入图片描述
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 or using the --no-half commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check.

解决方案一(我单独改了这个没生效):

1、web页面修改配置:
Settings > Stable Diffusion
在这里插入图片描述
应用设置,重新加载
在这里插入图片描述

解决方案二(这种只适合windows 部署的):

另一种解决方法–no-half是从选项开始。
将 webui-user.bat 文件更改为:
更改前的 webui-user.bat (示例)

@echo off

set GIT_PYTHON_REFRESH=quiet

set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=

call webui.bat

COMMANDLINE_ARGS=–no-half添加
更改 webui-user.bat 后(示例)

@echo off

set GIT_PYTHON_REFRESH=quiet

set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=--no-half

call webui.bat

解决方案三:

1、在执行启动命令前,设置环境变量

export COMMANDLINE_ARGS="--xformers --no-half-vae"

2、再执行启动命令

./SD_start.sh 

我还修改过这个脚本,但是没生效,不知道是不是改错地方了,stable-diffusion-webui 目录下有个webui-user.sh 文件,stable-diffusion-webui/stable-diffusion-webui/ 下
也有个webui-user.sh 文件,我改的是下面这个目录下的 文件,没生效,最终还是在终端设置环境变量再启动,才生效了

vim stable-diffusion-webui/stable-diffusion-webui/webui-user.sh +13

问题二:

(使用SDXLRonghua_v11.safetensors 模型报错)
在这里插入图片描述

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、在执行启动命令前,设置环境变量

export COMMANDLINE_ARGS="--xformers --no-half-vae"

2、再执行启动命令

./SD_start.sh 
  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据引用\[1\]和引用\[2\]的内容,你可以使用Ubuntu 20.4.5桌面版系统来部署stable diffusion。首先,你需要按照教程一步一步地进行部署,确保你能够成功地运行stable diffusion。如果你不想使用命令行或Windows系统,你可以手动创建一个名为stable-diffusion-v1的文件夹,并将下载的模型参数文件改名为model.ckpt,然后将其放在stable-diffusion-v1目录下。最后,运行stable-diffusion即可。如果你是Linux系统的用户,你可以运行以下代码来创建文件夹并建立符号链接:mkdir -p models/ldm/stable-diffusion-v1/,ln -s <path/to/model.ckpt> models/ldm/stable-diffusion-v1/model.ckpt。这样你就可以成功地部署stable diffusion了。 #### 引用[.reference_title] - *1* [AMD显卡Ubuntu20.4系统下部署stable diffusion](https://blog.csdn.net/volcanoyincan618/article/details/129603178)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [Stable Diffusion 本地部署](https://blog.csdn.net/m0_57567093/article/details/127405008)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值