Merge pull request #51 from lijirou12/codex/migrate-imagine-to-grok-superimage-1.0-y2p5rd

Add grok-superimage support, robust SSE streaming, image recovery and proxy/ retry fixes
This commit is contained in:
Mo Li authored and GitHub committed 2026-02-27 12:47:26 +08:00
commit 8b0eed146b
5 files changed
+3 -22

No files matched your search

+1 -1
View File
@@ -411,7 +411,7 @@ class ChatService:
# 跨 Token 重试循环
tried_tokens = set()
max_token_retries = int(get_config("retry.max_retry"))
max_token_retries = int(get_config("retry.max_retry") or 3)
last_error = None
for attempt in range(max_token_retries):
+1 -1
View File
@@ -52,7 +52,7 @@ class ImageGenerationService:
enable_nsfw: Optional[bool] = None,
chat_format: bool = False,
) -> ImageGenerationResult:
max_token_retries = int(get_config("retry.max_retry"))
max_token_retries = int(get_config("retry.max_retry") or 3)
tried_tokens: set[str] = set()
last_error: Optional[Exception] = None
+1 -1
View File
@@ -66,7 +66,7 @@ class ImageEditService:
)
images = images[-3:]
max_token_retries = int(get_config("retry.max_retry"))
max_token_retries = int(get_config("retry.max_retry") or 3)
tried_tokens: set[str] = set()
last_error: Exception | None = None
-8
View File
@@ -110,14 +110,6 @@ const LOCALE_MAP = {
},
"superimage": {
"label": "SuperImage 配置",
"n": { title: "生成数量", desc: "仅用于 grok-superimage-1.0 的服务端统一生成数量(1-10)。" },
"size": { title: "图片尺寸", desc: "仅用于 grok-superimage-1.0 的服务端统一尺寸。" },
"response_format": { title: "响应格式", desc: "仅用于 grok-superimage-1.0 的服务端统一返回格式。" }
},
"asset": {
"label": "资产配置",
"upload_concurrent": { title: "上传并发", desc: "上传接口的最大并发数。推荐 30。" },
-11
View File
@@ -113,17 +113,6 @@ final_min_bytes = 100000
blocked_parallel_attempts = 5
# ==================== SuperImage 配置 ====================
[superimage]
# 仅对 grok-superimage-1.0 生效,由服务端统一控制,不使用客户端 image_config
n = 1
# 图片尺寸:1280x720 / 720x1280 / 1792x1024 / 1024x1792 / 1024x1024
size = "1024x1024"
# 响应格式:url / b64_json / base64
response_format = "url"
# ==================== SuperImage 配置 ====================
[superimage]
# 仅对 grok-superimage-1.0 生效,由服务端统一控制,不使用客户端 image_config