diff --git a/config.yaml b/config.yaml index 7be98f7..a1a4504 100644 --- a/config.yaml +++ b/config.yaml @@ -121,6 +121,22 @@ llm: request_timeout: 15 max_retries: 1 retry_delay_seconds: 1.0 + openai_compatible_ai_gen_image: + provider: "openai_compatible" + # AI 绘图专用网关: + # 1. 这里使用用户提供的 OpenAI 兼容服务地址; + # 2. 插件会在此 base_url 基础上请求 images/generations; + # 3. endpoint 保留为图片接口默认值,便于后续统一调整。 + api_base_url: "https://freeapi.dgbmc.top" + endpoint: "images/generations" + api_key: "sk-2XccrBRsX8OmxqCEsZjdDRczhHNaAG7Mn88mNVL7Y0w0tx72" + # 图片模型默认使用 gpt-image-1; + # 若网关只支持其他模型,可后续直接在这里替换。 + model: "gpt-image-1" + stream: false + timeout_seconds: 300 + max_retries: 2 + retry_delay_seconds: 1.0 # 场景路由层:插件建议优先使用 scene,而不是直接绑定 backend。 # 这样当模型或供应商切换时,只需要改这里,不需要逐个改插件配置。 scenes: @@ -132,3 +148,4 @@ llm: "game.task": "openai_compatible_game_task" "auto_reply.group": "dify_workflow_ai_auto_response" "member_roast": "openai_compatible_ai_auto_response" + "image.generate": "openai_compatible_ai_gen_image" diff --git a/plugins/ai_gen_image/config.toml b/plugins/ai_gen_image/config.toml index b349d80..d578690 100644 --- a/plugins/ai_gen_image/config.toml +++ b/plugins/ai_gen_image/config.toml @@ -33,5 +33,5 @@ legacy_model = "turbo" # 2. 插件会从该 scene 对应的 backend 中复用 api_base_url / api_key; # 3. 图片接口默认请求 images/generations,如需特殊网关可在这里覆盖 image_endpoint。 [AIGenImage.llm] -scene = "" +scene = "image.generate" image_endpoint = "images/generations"