测试极速成片

This commit is contained in:
Azmat@qq.com
2026-08-26 15:18:18 +08:00
parent 245525ec53
commit 0ee498d807
30 changed files with 1963 additions and 367 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ from typing import Any
import requests
from django.conf import settings
from .openai_compatible import openai_image_size
from .volcano import VolcanoArkProvider
@@ -32,7 +33,7 @@ class YunqiProvider(VolcanoArkProvider):
raise ValueError("YUNQI_API_KEY is not configured")
if image:
raise ValueError("gpt-image-2 via YunQi only supports text-to-image; reference image is not supported")
body: dict[str, Any] = {"model": model, "prompt": prompt, "size": size, "n": 1}
body: dict[str, Any] = {"model": model, "prompt": prompt, "size": openai_image_size(size), "n": 1}
# 实测该网关生图平均延迟 75s+,超时须显著高于火山的 180s
response = requests.post(
f"{self.base_url.rstrip('/')}/{endpoint.lstrip('/')}",