From 745f72ded407acc4cf87ab009cb7a276d8210535 Mon Sep 17 00:00:00 2001 From: kang Date: Mon, 18 May 2026 00:07:36 +0800 Subject: [PATCH] auto-save 2026-05-18 00:07 (~3) --- .memory/worklog.json | 26 +++++++++++++------------- api/main.py | 13 ++++++++++++- web/lib/api.ts | 2 ++ 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/.memory/worklog.json b/.memory/worklog.json index 467bf00..4858c1b 100644 --- a/.memory/worklog.json +++ b/.memory/worklog.json @@ -1,18 +1,5 @@ { "entries": [ - { - "files_changed": 1, - "message": "Codex 会话活跃 · 最近命令:codex · 1 项未提交变更 · 最近提交:auto-save 2026-05-15 15:04 (~8)", - "ts": "2026-05-15T07:04:46Z", - "type": "session-heartbeat" - }, - { - "files_changed": 2, - "hash": "8bdb797", - "message": "auto-save 2026-05-15 15:10 (~2)", - "ts": "2026-05-15T15:10:14+08:00", - "type": "commit" - }, { "files_changed": 4, "message": "Codex 会话活跃 · 最近命令:codex · 4 项未提交变更 · 最近提交:auto-save 2026-05-15 15:10 (~2)", @@ -3258,6 +3245,19 @@ "type": "session-heartbeat", "message": "Codex 会话活跃 · 最近命令:codex · 分支 main · 1 项未提交变更 · 最近提交:auto-save 2026-05-17 23:46 (~2)", "files_changed": 1 + }, + { + "ts": "2026-05-17T23:56:54+08:00", + "type": "commit", + "message": "auto-save 2026-05-17 23:56 (~2)", + "hash": "7c51ff2", + "files_changed": 2 + }, + { + "ts": "2026-05-17T15:58:31Z", + "type": "session-heartbeat", + "message": "Codex 会话活跃 · 最近命令:codex · 分支 main · 1 项未提交变更 · 最近提交:auto-save 2026-05-17 23:56 (~2)", + "files_changed": 1 } ] } diff --git a/api/main.py b/api/main.py index f89c98f..9a3b6f3 100644 --- a/api/main.py +++ b/api/main.py @@ -51,6 +51,15 @@ TRANSLATE_MODEL = os.getenv("TRANSLATE_MODEL", "gemini-2.5-flash") REWRITE_MODEL = os.getenv("REWRITE_MODEL", "gemini-2.5-pro") VISION_MODEL = os.getenv("VISION_MODEL", "gemini-2.5-flash") IMAGE_MODEL = os.getenv("IMAGE_MODEL", "gemini-3-pro-image-preview") +GPT_IMAGE_MODEL = os.getenv("GPT_IMAGE_MODEL", "gpt-image-2").strip() or "gpt-image-2" +SUBJECT_ASSET_IMAGE_MODEL = os.getenv("SUBJECT_ASSET_IMAGE_MODEL", GPT_IMAGE_MODEL).strip() or GPT_IMAGE_MODEL +SUBJECT_ASSET_IMAGE_MODELS = [ + m.strip() + for m in os.getenv("SUBJECT_ASSET_IMAGE_MODELS", f"{SUBJECT_ASSET_IMAGE_MODEL},gpt-image-1.5").split(",") + if m.strip() +] +if SUBJECT_ASSET_IMAGE_MODEL not in SUBJECT_ASSET_IMAGE_MODELS: + SUBJECT_ASSET_IMAGE_MODELS.insert(0, SUBJECT_ASSET_IMAGE_MODEL) PRODUCT_ASSET_MAX_SIDE = max(1024, int(os.getenv("PRODUCT_ASSET_MAX_SIDE", "1600"))) PRODUCT_ASSET_MIN_LONG_SIDE = max(512, int(os.getenv("PRODUCT_ASSET_MIN_LONG_SIDE", "900"))) PRODUCT_ASSET_MIN_SHORT_SIDE = max(320, int(os.getenv("PRODUCT_ASSET_MIN_SHORT_SIDE", "600"))) @@ -2753,6 +2762,8 @@ def health() -> dict: "vision": VISION_MODEL, "image": IMAGE_MODEL, "image_fallbacks": [IMAGE_MODEL, "gemini-3.1-flash-image-preview", "gemini-2.5-flash-image"], + "subject_image": SUBJECT_ASSET_IMAGE_MODEL, + "subject_image_fallbacks": SUBJECT_ASSET_IMAGE_MODELS, "minimax_tts": MINIMAX_TTS_MODEL, "minimax_voice": MINIMAX_TTS_VOICE_ID, "minimax_voice_pool": MINIMAX_TTS_VOICE_POOL or [MINIMAX_TTS_VOICE_ID], @@ -3904,7 +3915,7 @@ def generate_subject_assets(job_id: str, idx: int, element_id: str, req: Generat "If user direction requests a gender, age, or style change, apply that one change uniformly to all views; never mix male/female, young/old, or multiple style identities inside the same six-view pack. " "For transparent humanoids, keep the same transparent skin shell, skeleton proportions, visible spine/rib cage/pelvis/limb bones, and non-horror wellness character style in every view. " ) - models = [IMAGE_MODEL, "gemini-3.1-flash-image-preview", "gemini-2.5-flash-image"] + models = SUBJECT_ASSET_IMAGE_MODELS generated: list[SubjectAsset] = [] try: for view, view_label in _subject_view_labels(req.subject_kind, req.views): diff --git a/web/lib/api.ts b/web/lib/api.ts index 0020985..f21a8eb 100644 --- a/web/lib/api.ts +++ b/web/lib/api.ts @@ -144,6 +144,8 @@ export interface RuntimeModels { vision?: string image?: string image_fallbacks?: string[] + subject_image?: string + subject_image_fallbacks?: string[] minimax_tts?: string minimax_voice?: string minimax_voice_pool?: string[]