feat: support GPT Image 2 primary and increase timeout in v53.8.52

This commit is contained in:
chenjunhong
2026-09-10 10:28:19 +08:00
parent 62e44c5df9
commit 920a385bb4
8 changed files with 14 additions and 10 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ WEB_DIRECTORY = "./src/Comfyui_Fd_Nodes/other"
__author__ = """xuyucai"""
__email__ = "986327386@qq.com"
__version__ = "53.8.51"
__version__ = "53.8.52"
try:
from .src.Comfyui_Fd_Nodes.nodes import NODE_CLASS_MAPPINGS
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "Comfyui_Fd_Nodes"
version = "53.8.51" # 999开头的版本是debug版
version = "53.8.52" # 999开头的版本是debug版
description = "Custom nodes for fd project"
authors = [
{name = "xuyucai", email = "986327386@qq.com"}
+1 -1
View File
@@ -18,7 +18,7 @@ logger = logging.getLogger(__name__)
class FD_GPTImageComboNode:
"""GPT 图生图 combo 节点 - 接收最多8个图片组合并发调用 GPT Image API。"""
MODELS = ["gpt-image-2", "gpt-image-2.5", "gpt-image-2.5-sunburst-siphonlab", "gpt-image-2.5-flare-siphonlab"]
MODELS = ["gpt-image-2", "gpt-image-2-primary", "gpt-image-2.5", "gpt-image-2.5-sunburst-siphonlab", "gpt-image-2.5-flare-siphonlab"]
ASPECT_RATIOS = ["", "1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "16:9", "9:16", "21:9", "9:21"]
IMAGE_SIZES = ["4K", "2K", "1K"]
QUALITIES = ["low", "medium", "high", "xhigh", "max"]
+1 -1
View File
@@ -46,7 +46,7 @@ class FD_GTPImage(ComfyNodeABC):
IO.COMBO,
{
"tooltip": "The GPT image model to use for image edits.",
"options": ["gpt-image-2", "gpt-image-2.5", "gpt-image-2.5-sunburst-siphonlab", "gpt-image-2.5-flare-siphonlab"],
"options": ["gpt-image-2", "gpt-image-2-primary", "gpt-image-2.5", "gpt-image-2.5-sunburst-siphonlab", "gpt-image-2.5-flare-siphonlab"],
"default": "gpt-image-2",
},
),
+1 -1
View File
@@ -19,7 +19,7 @@ logger = logging.getLogger(__name__)
class FD_GPTMultiImage:
"""GPT 多图编辑节点,沿用知衣多图输入与并发方式,底层调用 GPT Image edit API。"""
MODELS = ["gpt-image-2", "gpt-image-2.5", "gpt-image-2.5-sunburst-siphonlab", "gpt-image-2.5-flare-siphonlab"]
MODELS = ["gpt-image-2", "gpt-image-2-primary", "gpt-image-2.5", "gpt-image-2.5-sunburst-siphonlab", "gpt-image-2.5-flare-siphonlab"]
ASPECT_RATIOS = ["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "16:9", "9:16", "21:9", "9:21"]
IMAGE_SIZES = ["4K", "2K", "1K"]
QUALITIES = ["low", "medium", "high", "xhigh", "max"]
@@ -25,9 +25,10 @@ class GptImageEditClient:
- backend="litellm":走旧 multipart {FD_LITELLM_BASE_URL}/v1/images/edits
"""
DEFAULT_TIMEOUT = 300
DEFAULT_TIMEOUT = 500
GPT_IMAGE_CHANNEL = "gpt-image-2"
GPT_25_CHANNELS = {
IMAGE_GENERATION_ONLY_CHANNELS = {
"gpt-image-2-primary",
"gpt-image-2.5",
"gpt-image-2.5-sunburst-siphonlab",
"gpt-image-2.5-flare-siphonlab",
@@ -63,8 +64,8 @@ class GptImageEditClient:
model: str = "gpt-image-2",
) -> Tuple[BytesIO, str, str]:
"""根据 backend 选择调用方式,返回 (image_bytesio, output_text, result_url)。"""
# GPT 2.5 的三个公共 channel 均由业务服务处理路由和回退。
if self.backend == "litellm" and model not in self.GPT_25_CHANNELS:
# 这些公共 channel 的路由语义由 image-generation 服务保证。
if self.backend == "litellm" and model not in self.IMAGE_GENERATION_ONLY_CHANNELS:
return self._edit_via_litellm(
image_tensors=image_tensors,
model=model,
+1
View File
@@ -158,6 +158,7 @@ def test_gpt_nodes_keep_legacy_widget_order():
GPT_IMAGE_MODELS = [
"gpt-image-2",
"gpt-image-2-primary",
"gpt-image-2.5",
"gpt-image-2.5-sunburst-siphonlab",
"gpt-image-2.5-flare-siphonlab",
+3 -1
View File
@@ -34,6 +34,8 @@ class DummyResponse:
@pytest.mark.parametrize("quality", ["low", "medium", "high", "xhigh", "max"])
@pytest.mark.parametrize(("model", "backend"), [
("gpt-image-2", "image_generation"),
("gpt-image-2-primary", "image_generation"),
("gpt-image-2-primary", "litellm"),
("gpt-image-2.5", "image_generation"),
("gpt-image-2.5", "litellm"),
("gpt-image-2.5-sunburst-siphonlab", "litellm"),
@@ -178,7 +180,7 @@ def test_litellm_edit_preserves_model_size_quality_and_images(monkeypatch, model
assert image.convert("RGB").getpixel((0, 0)) == (index * 255,) * 3
@pytest.mark.parametrize("model", ["gpt-image-2", "gpt-image-2.5", "gpt-image-2.5-sunburst-siphonlab", "gpt-image-2.5-flare-siphonlab"])
@pytest.mark.parametrize("model", ["gpt-image-2", "gpt-image-2-primary", "gpt-image-2.5", "gpt-image-2.5-sunburst-siphonlab", "gpt-image-2.5-flare-siphonlab"])
def test_image_generation_edit_raises_error_message_on_status_false(model):
channels = []