feat: support GPT Image 2 primary and increase timeout in v53.8.52
This commit is contained in:
+1
-1
@@ -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
@@ -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"}
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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 = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user