按 OpenAI 官方放开 GIF+参考图,SVG 仍仅文生图;有蒙版禁用 GIF/SVG
This commit is contained in:
@@ -467,14 +467,41 @@ class GPTImage26SvgGifTests(unittest.TestCase):
|
||||
|
||||
def test_svg_gif_reject_edit_inputs(self):
|
||||
import torch
|
||||
from comfyui_o1key.utils.o1key_image_catalog import validate_gpt_image_vector_output
|
||||
|
||||
client = object.__new__(GptImageClient)
|
||||
fake = torch.zeros((1, 8, 8, 3))
|
||||
for output_format in ("svg", "gif"):
|
||||
with self.assertRaisesRegex(ValueError, "纯文生图"):
|
||||
client._build_async_generate_body(
|
||||
"test", "gpt-image-2.6-sunburst", "high", None, 1,
|
||||
image_list=[fake], output_format=output_format,
|
||||
)
|
||||
with self.assertRaisesRegex(ValueError, "纯文生图"):
|
||||
client._build_async_generate_body(
|
||||
"test", "gpt-image-2.6-sunburst", "high", None, 1,
|
||||
image_list=[fake], output_format="svg",
|
||||
)
|
||||
# GIF + reference images is allowed (OpenAI image edit guidance).
|
||||
validate_gpt_image_vector_output(
|
||||
"gpt-image-2.6-sunburst",
|
||||
"gif",
|
||||
has_images=True,
|
||||
has_mask=False,
|
||||
)
|
||||
with self.assertRaisesRegex(ValueError, "纯文生图"):
|
||||
validate_gpt_image_vector_output(
|
||||
"gpt-image-2.6-sunburst",
|
||||
"svg",
|
||||
has_images=False,
|
||||
has_mask=True,
|
||||
)
|
||||
with self.assertRaisesRegex(ValueError, "不支持蒙版"):
|
||||
validate_gpt_image_vector_output(
|
||||
"gpt-image-2.6-sunburst",
|
||||
"gif",
|
||||
has_images=True,
|
||||
has_mask=True,
|
||||
)
|
||||
with self.assertRaisesRegex(ValueError, "不支持蒙版"):
|
||||
client._build_async_generate_body(
|
||||
"test", "gpt-image-2.6-sunburst", "high", None, 1,
|
||||
image_list=[fake], mask_tensor=fake, output_format="gif",
|
||||
)
|
||||
|
||||
def test_materialize_gif_expands_frames_and_keeps_bytes(self):
|
||||
from io import BytesIO
|
||||
|
||||
Reference in New Issue
Block a user