47 lines
1.8 KiB
TOML
47 lines
1.8 KiB
TOML
[AIGenImage]
|
||
enable = true
|
||
command = ["AI绘图", "绘图", "画图", "生成图片"]
|
||
command-format = """
|
||
🎨AI绘图指令:
|
||
AI绘图 描述文字
|
||
"""
|
||
|
||
# OpenAI 兼容图片生成参数。
|
||
# 当前 image.generate 场景在全局 llm 配置里已路由到 gpt-image-2,
|
||
# 这里同步使用相同模型,避免插件本地默认值覆盖场景模型后出现 model_not_found。
|
||
default_model = "gpt-image-2"
|
||
image_quality = "standard"
|
||
image_response_format = "b64_json"
|
||
image_count = 1
|
||
|
||
# 图片尺寸配置:
|
||
# 1. image_size 会优先直接用于 OpenAI 兼容接口;
|
||
# 2. default_width/default_height 主要用于旧版 pollinations 回退逻辑;
|
||
# 3. 为了兼容老逻辑,这两组配置同时保留。
|
||
image_size = "1024x1024"
|
||
default_width = 1024
|
||
default_height = 1024
|
||
default_timeout = 300
|
||
|
||
# 旧版回退接口配置:
|
||
# 当没有配置 llm.scene,且也没有单独提供网关地址/密钥时,
|
||
# 插件会继续使用原来的 pollinations 逻辑生成图片。
|
||
image_api_url = "https://image.pollinations.ai/prompt/{prompt}"
|
||
legacy_model = "turbo"
|
||
|
||
# 图片生成主配置:
|
||
# 1. 推荐通过 llm.scene 走项目统一的 LLM 配置路由;
|
||
# 2. 插件会从该 scene 对应的 backend 中复用 api_base_url / api_key;
|
||
# 3. 图片接口默认请求 images/generations,如需特殊网关可在这里覆盖 image_endpoint。
|
||
[AIGenImage.llm]
|
||
scene = "image.generate"
|
||
image_endpoint = "images/generations"
|
||
|
||
[runtime]
|
||
# AI 绘图属于长耗时命令:
|
||
# 1. 上游模型生成、下载与落盘都可能持续几十秒到数分钟;
|
||
# 2. 这里启用 background,让它在后台任务池里跑,避免长期占住前台消息并发槽位;
|
||
# 3. 超时时间放宽到 7 分钟,兼容慢模型或高峰期图像生成延迟。
|
||
message_dispatch_mode = "background"
|
||
plugin_process_timeout_seconds = 420
|