AI开发平台MODELARTS-SDXL&SD1.5 ComfyUI基于Lite Cluster适配NPU推理指导(6.3.906):Step3 下载并安装软件

时间:2024-09-24 10:50:11

Step3 下载并安装软件

  1. 在宿主机上创建目录/root/comfyui,将下面步骤中所有的文件放到/root/comfyui目录下。
  2. 下载模型,模型下载地址:SD1.5模型地址SDXL下载地址。根据自己的需要下载对应的模型。
  3. 将获取到的ComfyUI插件AscendCloud-AIGC-6.3.906-xxx.zip文件上传到/root/comfyui,并解压。获取路径参见表2
    unzip AscendCloud-AIGC-*.zip -d ./AscendCloud
    mv AscendCloud/aigc_inference/torch_npu/comfyui/831511a1eecbe271/comfyui_ascend_node ./
    rm -rf AscendCloud*
  4. 编写dockerfile
    FROM swr.cn-southwest-2.myhuaweicloud.com/atelier/pytorch_2_1_ascend:pytorch_2.1.0-cann_8.0.rc2-py_3.9-hce_2.0.2312-aarch64-snt9b-20240606190017-b881580
    
    RUN cd /home/ma-user && git clone https://github.com/comfyanonymous/ComfyUI.git -c http.sslVerify=false && cd ComfyUI/ && git reset --hard 831511a1eecbe271e302f2f2053f285f00614180 && pip install -r requirements.txt 
    
    COPY --chown=ma-user:ma-group v1-5-pruned-emaonly.safetensors /home/ma-user/ComfyUI/models/checkpoints
    COPY --chown=ma-user:ma-group sd_xl_base_1.0.safetensors /home/ma-user/ComfyUI/models/checkpoints
    COPY --chown=ma-user:ma-group comfyui_ascend_node /home/ma-user/ComfyUI/custom_nodes/comfyui_ascend_node 
    
    ENTRYPOINT cd /home/ma-user/ComfyUI && source /usr/local/Ascend/ascend-toolkit/set_env.sh && python main.py --port 30027 --listen 0.0.0.0 --force-fp16
  5. 基于dockerfile进行build
    docker build -t comfyui:v1 .
support.huaweicloud.com/bestpractice-modelarts/modelarts_10_01205.html