#!/bin/bash # 设置环境变量 export CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1 # 创建Lora目录软连接 TARGET_LORA="/home/xsl/change_hair/project/onediff/stable-diffusion-webui/models/Lora" if [ -e "$TARGET_LORA" ]; then echo "删除已存在的Lora连接或目录: $TARGET_LORA" rm -rf "$TARGET_LORA" fi ln -s /gz-fs/Lora "$TARGET_LORA" echo "创建软连接成功: /gz-fs/Lora -> $TARGET_LORA" # 1. 换发算法服务 cd /home/xsl/change_hair/project/hair_service_sd nohup /home/xsl/miniconda3/envs/condiff-train-hair/bin/python run_copy_cost_colorb64.py > hair_service.log 2>&1 & # 2. webUI服务推理 + onediff cd /home/xsl/change_hair/project/onediff/stable-diffusion-webui nohup /home/xsl/miniconda3/envs/onediff/bin/python webui.py --api --listen --xformers --port 57860 > webui.log 2>&1 & nohup ./webui.sh --api --listen --disable-safe-unpickle --port 9038 > webui_sh.log 2>&1 & # 3. photo_service cd /home/xsl/change_hair/project/photo_service nohup /home/xsl/miniconda3/envs/py310/bin/python lora_train_service_1.py > photo_service.log 2>&1 & echo "所有服务已在后台启动"