myshellbot / download_comfyui_borges.sh
manking's picture
Upload download_comfyui_borges.sh
b1db18f verified
Raw
History Blame Contribute Delete
1.34 kB
#!/bin/bash
# 函数:居中显示文本
center_text() {
local text="$1"
local width=80
printf "%*s\n" $((( ${#text} + width ) / 2)) "$text"
}
# 欢迎页
clear
center_text "👏迎使用ComfyUI模型下载程序⬇️"
echo ""
center_text "我是:悪棍Borges"
echo ""
center_text "B站 https://space.bilibili.com/402195818?spm_id_from=333.1007.0.0"
echo ""
center_text "专注AI绘图 任何问题 联系V::black_pear"
echo ""
echo "-------------------------------------"
# 下载文件函数
download_file() {
read -p "请输入下载链接: " download_url
read -p "请输入保存文件的文件名: " filename
# 执行下载
echo "正在下载 $filename ..."
wget -O "$filename" "$download_url"
# 下载完成后提示
if [ $? -eq 0 ]; then
echo "下载完成: $filename"
else
echo "下载失败,请检查链接或网络连接。"
exit 1
fi
}
# 初次下载
download_file
# 是否继续下载
while true; do
read -p "是否继续下载?(yes/no): " choice
case $choice in
[Yy]* )
download_file
;;
[Nn]* )
echo "感谢使用 ComfyUI模型下载程序,再见!"
exit 0
;;
* )
echo "请输入 'yes' 或 'no'."
;;
esac
done