Compare commits

...

3 Commits

Author SHA1 Message Date
wxa
86a2b3d125
Merge d4df3d919f into 3aace5c8dc 2026-01-30 14:52:18 +10:30
Christian Byrne
3aace5c8dc
fix: count non-dict items in outputs_count (#12166)
Move count increment before isinstance(item, dict) check so that
non-dict output items (like text strings from PreviewAny node)
are included in outputs_count.

This aligns OSS Python with Cloud's Go implementation which uses
len(itemsArray) to count ALL items regardless of type.

Amp-Thread-ID: https://ampcode.com/threads/T-019c0bb5-14e0-744f-8808-1e57653f3ae3

Co-authored-by: Amp <amp@ampcode.com>
2026-01-29 17:10:08 -08:00
xinanwang
d4df3d919f add docker config file 2025-02-27 17:18:40 +08:00
3 changed files with 56 additions and 1 deletions

12
Dockerfile Normal file
View File

@ -0,0 +1,12 @@
# 替换为自己的python镜像地址
FROM registry.cn-hangzhou.aliyuncs.com/wxa/python:3.12
# 设置工作目录
WORKDIR /app
# 复制 requirements.txt 和安装依赖
COPY requirements.txt /app/requirements.txt
# 安装依赖,指定阿里镜像源
RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ -r /app/requirements.txt
# 复制源代码到容器内
COPY . /app
# 设置容器的默认命令
CMD ["python", "main.py"]

View File

@ -171,9 +171,10 @@ def get_outputs_summary(outputs: dict) -> tuple[int, Optional[dict]]:
continue
for item in items:
count += 1
if not isinstance(item, dict):
continue
count += 1
if preview_output is None and is_previewable(media_type, item):
enriched = {

42
comfyui.yaml Normal file
View File

@ -0,0 +1,42 @@
# 配置docker配置文件启用gpu
#{
# "runtimes": {
# "nvidia": {
# "args": [],
# "path": "nvidia-container-runtime"
# }
# }
#}
# 打包启动镜像命令docker compose build up -d
version: '1'
services:
app:
build: .
container_name: comfyui
runtime: nvidia
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [ gpu ]
volumes:
- .:/app
- ./app/models/Stable-diffusion:/app/models/Stable-diffusion # 绑定模型目录
ports:
- "8188:8188" # 如果你的应用需要暴露端口
command: python main.py # 启动 main.py 文件
environment:
- PYTHONUNBUFFERED=1 # 确保输出不会被缓冲
working_dir: /app
restart: always
networks:
- my_custom_network
networks:
my_custom_network:
name: comfyui