Qwen-image

docker部署

安装魔搭社区的modelscope模型管理工具

1
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple modelscope

下载docker镜像

1
modelscope download --model inkcoi/ComfyUI-Qwen-Image --local_dir /home/user/#下载文件位置

镜像文件约40GB,请留有充足储存空间

加载Docker镜像

1
docker load -i ./comfyui-qwen-image-latest.tar

加载镜像为comfyui-qwen-image latest 1c856fa3dfd8 10 days ago 42.5GB

运行docker容器

1
docker run --gpus all -d --name comfyui-qwen -p 8188:8188 comfyui-qwen-image:latest python3 main.py --listen 0.0.0.0 

挂载目录

1
2
3
4
5
6
docker run --gpus all -d --name comfyui-qwen -p 8188:8188 \
-v /home/edzhao/Qwen-image/comfyui_data/models:/ComfyUI/models \
-v /home/edzhao/Qwen-image/comfyui_data/output:/ComfyUI/output \
-v /home/edzhao/Qwen-image/comfyui_data/custom_nodes:/ComfyUI/custom_nodes \
-v /home/edzhao/Qwen-image/comfyui_data/input:/ComfyUI/input \
comfyui-qwen-image:latest python3 main.py --listen 0.0.0.0

如果没有GPU,可以添加--cpu参数:

手动处理

如何遇到依赖错误导致docker容器直接无法启动

基于这个新的自定义镜像,启动一个临时的、只运行 shell 的容器

1
docker run -it --name comfyui_fix_shell_temp --entrypoint /bin/bash comfyui_my_custom_state:latest

-it: 交互式模式。

--name comfyui_fix_shell_temp: 给这个临时容器命名,方便识别。

--entrypoint /bin/bash: 覆盖镜像的默认启动命令,直接启动 shell 环境。

comfyui_my_custom_state:latest: 使用您刚才创建的自定义镜像。

在**comfyui_fix_shell_temp **中完成修复后,将容器打包为镜像。

1
docker commit f6b773f8bcc7 comfyui_my_custom_state_fixed_final:latest

之后从镜像启动即可。

端口转发和监听

容器需要转发端口,-p 8188:8188

comfyui启动需要python3 main.py --listen 0.0.0.0