开机脚本

使用linux systemd 服务管理工具,我的系统版本是Ubuntu22.04,需要新建服务管理脚本,文件位置:/etc/systemd/system/webui.service内容如下:

[Unit]
Description=Start sd-ui service
After=multi-user.target

[Service]
User=root
ExecStart=/home/jichang/Ai/stable-diffusion-webui-forge/start.sh --gradio-auth root:123456

[Install]
WantedBy=default.target
~

start.sh 文件必须有执行权限 chmod 777 start.sh,内容如下


#!/bin/bash
source /home/jichang/Ai/stable-diffusion-webui-forge/venv/bin/activate
/home/jichang/Ai/stable-diffusion-webui-forge/webui.sh  -f --listen  --api --disable-safe-unpickle   --opt-sdp-no-mem-attention --opt-channelslast --opt-split-attention --no-half


标签: none

添加新评论