refactor(inference): 统合 image_gen 为 GPT Image 2 异步 API,删除冗余配置

- 删除 gptimage.go,异步逻辑直接内聚到 inference.go
- ImageGenConfig 改为 GPT Image 2 参数:aspect_ratio / x_channel / poll_max_wait / poll_interval
- GenerateImages 流程:submit → poll → download,支持并行多图(spritesheet)
- 移除旧的 OpenAI 兼容同步 API 代码(callImageGenAPI / parseImageResponse 等)
- 统一 env:GEN2D_IMAGE_* 系列,移除 GEN2D_GPT_IMAGE2_* 冗余
This commit is contained in:
2026-05-25 12:44:39 +08:00
parent d9d3b51262
commit c4dc7394b1
6 changed files with 255 additions and 512 deletions
-1
View File
@@ -35,7 +35,6 @@ func main() {
// 注入 LLM 和文生图配置到 service 层
service.InitLLMConfig(cfg.LLM)
service.InitImageGenConfig(cfg.ImageGen)
service.InitGptImage2Config(cfg.GptImage2)
r := gin.New()
r.Use(gin.Recovery()) // panic 恢复中间件,防止服务因未捕获异常宕机