ToB企服应用市场:ToB评测及商务社交产业平台

标题: 在服务器Ubuntu22.04系统下,ComfyUI的摆设 [打印本页]

作者: 大连密封材料    时间: 2024-11-22 17:40
标题: 在服务器Ubuntu22.04系统下,ComfyUI的摆设
一、安装情况:ubuntu基本情况设置

1.更新包列表:

修改设置文件
  1. vi /etc/apt/sources.list
复制代码
将原有的内容注释(每行最前面加#)
在最后添加以下内容
  1. ########   Ubuntu22.04LTS 清华镜像源   ###############
  2. # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
  3. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
  4. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
  5. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
  6. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
  7. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
  8. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
  9. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
  10. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
  11. # 预发布软件源,不建议启用
  12. # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
  13. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
复制代码
更新软件列表
  1. sudo apt-get update
复制代码
更新本地软件
  1. sudo apt upgrade
复制代码
更新时间较长,请耐烦等候
2. 安装GPU驱动程序


  1. ubuntu-drivers devices
复制代码

  1. sudo apt update
  2. sudo apt install nvidia-driver-535
复制代码

  1. reboot
复制代码
3.查察显卡信息

  1. nvidia-smi
复制代码

4.下载并安装 CUDA 12.3

访问 NVIDIA CUDA Toolkit 下载页面,选择 CUDA 12.3 版本。对于 Ubuntu,您可能需要运行类似以下的下令:
  1. wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pinsudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600wget 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.debsudo dpkg -i cuda-repo-ubuntu2204-12-3-local_12.3.0-545.23.06-1_amd64.debsudo cp /var/cuda-repo-ubuntu2204-12-3-local/cuda-*-keyring.gpg /usr/share/keyrings/sudo apt-get update
  2. sudo apt-get -y install cuda-toolkit-12-3
复制代码

  1. export PATH=/usr/local/cuda-12.3/bin${PATH:+:${PATH}}
  2. export LD_LIBRARY_PATH=/usr/local/cuda-12.3/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
复制代码

  1. source ~/.bashrc
复制代码

  1. nvcc --version
复制代码

二、安装miniconda情况

1. 下载miniconda3

  1. wget https://mirrors.cqupt.edu.cn/anaconda/miniconda/Miniconda3-py310_23.10.0-1-Linux-x86_64.sh
复制代码
2. 安装miniconda3

  1. bash Miniconda3-py310_23.10.0-1-Linux-x86_64.sh -u
复制代码
直接一直enter键,到输入路径和yes
这边建议路径为:miniconda3
3. 打开用户情况编辑页面

  1. vim ~/.bashrc
复制代码

  1. export PATH="/root/miniconda3/bin:$PATH"
复制代码
4.conda设置


  1. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
复制代码
  1. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
复制代码
  1. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
复制代码

  1. conda config --set show_channel_urls yes
复制代码

  1. pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
复制代码
5. 重新加载用户情况变量

  1. source ~/.bashrc
复制代码

  1. conda init bash
复制代码
6. 创建Comfyui需要的情况

  1. conda create -n comfyui python=3.10
  2. conda activate comfyui
复制代码
三、克隆Comfyui仓库

官网地址:Comfyui的GitHub地址
  1. git clone https://github.com/comfyanonymous/ComfyUI.git
复制代码
如果下载速率较慢可添加https://mirror.ghproxy.com/镜像源
  1. git clone https://mirror.ghproxy.com/https://github.com/comfyanonymous/ComfyUI.git
复制代码
进入到Comfyui文件夹内
  1. cd ComfyUI
复制代码
  1. pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121
复制代码
  1. pip install -r requirements.txt
复制代码
  1. python main.py --port 15070 --listen 0.0.0.0
复制代码

  1. --port 50000: 设置服务器监听的端口为业务端口,此处改为业务端口。
复制代码
启动乐成后,访问http://主机IP:端口


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4