修改配置文件
vi /etc/apt/sources.list 将原有的内容注释(每行最前面加#)
在最后添加以下内容
######## Ubuntu22.04LTS 清华镜像源 ############### # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse # 预发布软件源,不建议启用 # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse 更新软件列表
sudo apt-get update 更新本地软件
sudo apt upgrade 更新时间较长,请耐心等待
ubuntu-drivers devices sudo apt update sudo apt install nvidia-driver-535 reboot nvidia-smi 
访问 NVIDIA CUDA Toolkit 下载页面,选择 CUDA 12.3 版本。对于 Ubuntu,您可能需要运行类似以下的命令:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600 wget https://developer.download.nvidia.com/compute/cuda/12.3.0/local_installers/cuda-repo-ubuntu2204-12-3-local_12.3.0-545.23.06-1_amd64.deb sudo dpkg -i cuda-repo-ubuntu2204-12-3-local_12.3.0-545.23.06-1_amd64.deb sudo cp /var/cuda-repo-ubuntu2204-12-3-local/cuda-*-keyring.gpg /usr/share/keyrings/ sudo apt-get update sudo apt-get -y install cuda-toolkit-12-3 export PATH=/usr/local/cuda-12.3/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.3/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} source ~/.bashrc nvcc --version 
wget https://mirrors.cqupt.edu.cn/anaconda/miniconda/Miniconda3-py310_23.10.0-1-Linux-x86_64.sh bash Miniconda3-py310_23.10.0-1-Linux-x86_64.sh -u 直接一直enter键,到输入路径和yes
这边建议路径为:miniconda3
vim ~/.bashrc export PATH="/root/miniconda3/bin:$PATH" source ~/.bashrc conda init bash conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ conda config --set show_channel_urls yes pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple conda create -n 3d python=3.9 conda activate 3d 官网地址:stable-fast-3d的GitHub地址
git clone https://github.com/Stability-AI/stable-fast-3d.git 如果下载速度较慢可添加https://mirror.ghproxy.com/镜像源
git clone https://mirror.ghproxy.com/https://github.com/Stability-AI/stable-fast-3d.git cd stable-fast-3d git+https://github.com/vork/PyNanoInstantMeshes.git 改为
git+https://mirror.ghproxy.com/https://github.com/vork/PyNanoInstantMeshes.git pip install -r requirements.txt pip install -r requirements-dev.txt pip install -r requirements-demo.txt 设置镜像地址
export HF_ENDPOINT=https://hf-mirror.com python gradio_app.py wget https://mirror.ghproxy.com/https://github.com/danielgatis/rembg/releases/download/v0.0.0/u2net.onnx /root/.u2net/u2net.onnx ·下载stable-fast-3d模型
mkdir models cd models pip install modelscope modelscope download --model maple77/stable-fast-3d --local_dir './' model = SF3D.from_pretrained( "stabilityai/stable-fast-3d", config_name="config.yaml", weight_name="model.safetensors", ) 模型文件路径指定到刚才下载的路径
model = SF3D.from_pretrained( "/root/project/stable-fast-3d/models/", config_name="config.yaml", weight_name="model.safetensors", ) demo.queue().launch(share=False) 改为
demo.queue().launch(server_name="0.0.0.0", server_port=15119) server_port变量为设置服务器监听的端口为业务端口,此处改为业务端口。
然后在启动服务
python gradio_app.py 
启动成功后,访问http://主机IP:端口