Fix wildcard listen address detection for dual-stack (0.0.0.0,::)

This commit is contained in:
caissonfiv
2026-03-26 18:23:21 +08:00
parent f17b78b91b
commit 5d3ea8f67e
+2 -1
View File
@@ -62,7 +62,8 @@ def _detect_comfy_address():
if args.listen:
listen = args.listen.strip()
# 0.0.0.0 / :: 表示监听所有接口,取本机实际出口 IP
host = _get_local_ip() if listen in ('0.0.0.0', '::') else listen
is_wildcard = listen in ('0.0.0.0', '::') or '0.0.0.0' in listen or listen.startswith('::')
host = _get_local_ip() if is_wildcard else listen
except Exception:
pass # 不在 ComfyUI 环境中也能降级运行