赞
踩
rm /etc/apt/sources.list
vim /etc/apt/sources.list
# 默认注释了源码镜像以提高 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
确保内容跟上述图片一致
按esc键,再输入冒号+wq保存
sudo apt-get update
sudo apt upgrade
wget https://cn.download.nvidia.com/XFree86/Linux-x86_64/550.100/NVIDIA-Linux-x86_64-550.100.run
sudo apt-get install g++
点击回车enter即可
sudo apt-get install gcc
sudo apt-get install make
点击回车enter即可
成功安装
sudo apt-get remove --purge nvidia*
sudo vim /etc/modprobe.d/blacklist.conf
blacklist nouveau
options nouveau modeset=0
3.按esc键退出编辑模式,输入:wq保存并退出
4.更新文件
sudo update-initramfs -u
这里等待时间较久
sudo reboot
这里需要等一会才能连上
sudo chmod 777 NVIDIA-Linux-x86_64-550.100.run
sudo ./NVIDIA-Linux-x86_64-550.100.run
这里一直按回车就行,默认选择
一直按回车enter键,直到安装成功
nvidia-smi
wget https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run
执行安装命令
sudo sh ./cuda_12.4.0_550.54.14_linux.run
sudo vim ~/.bashrc
export PATH="/usr/local/cuda-12.4/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-12.4/lib64:$LD_LIBRARY_PATH"
按esc键退出编辑模式,输入:wq保存并退出
3.更新环境变量
source ~/.bashrc
nvcc -V
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
直接回车enter即可,再次输入yes
成功安装
cd miniconda3/bin/
pwd
复制这里的路径
vim ~/.bashrc
export PATH="/root/miniconda3/bin:$PATH"
按esc键退出编辑模式,输入:wq保存并退出
source ~/.bashrc
conda init bash
conda -V
1.配置清华镜像源
代码如下:
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
git clone https://github.com/Sanster/IOPaint.git
git clone https://mirror.ghproxy.com/https://github.com/Sanster/IOPaint.git
cd IOPaint/
conda create -n IOPaint python=3.10
conda activate IOPaint
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
python -m pip install --upgrade pip
pip3 install torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/cu118
pip3 install iopaint
pip install gfpgan
pip install realesrgan
pip install rembg
pip install realesrgan
mkdir model
官方模型介绍https://www.iopaint.com/models
HF_ENDPOINT=https://hf-mirror.com iopaint start --device=cuda --model-dir=./model --model Sanster/PowerPaint-V1-stable-diffusion-inpainting
HF_ENDPOINT=https://hf-mirror.com iopaint start --device=cuda --model-dir=./model --model runwayml/stable-diffusion-v1-5
HF_ENDPOINT=https://hf-mirror.com iopaint start --device=cuda --model-dir=./model --model Fantasy-Studio/Paint-by-Example
HF_ENDPOINT=https://hf-mirror.com iopaint start --device=cuda --model-dir=./model --model kandinsky-community/kandinsky-2-2-decoder-inpaint
HF_ENDPOINT=https://hf-mirror.com iopaint start --device=cuda --model-dir=./model --model Sanster/AnyText
HF_ENDPOINT=https://hf-mirror.com iopaint start --device=cuda --model-dir=./model --model timbrooks/instruct-pix2pix
3.5下载擦除模型
https://pan.quark.cn/s/9ca4455c2651
放置到IOPaint目录下的model下
HF_ENDPOINT=https://hf-mirror.com nohup iopaint start --model lama --device=cuda --port=15109 --host 0.0.0.0 --input input --output-dir output --enable-interactive-seg --interactive-seg-model=vit_l --interactive-seg-device=cuda --enable-gfpgan --gfpgan-device cuda --enable-realesrgan --realesrgan-model RealESRGAN_x4plus --realesrgan-device cuda --enable-remove-bg --enable-restoreformer --restoreformer-device cuda --enable-anime-seg --model-dir=./model &
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。