[feat] image generation: let gpt-image requests choose a quality level

未关闭
#220 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
python, typescript

调研方向

Start with domain/input_rules.py and the generation parameter contract, then trace how parameters pass through application/creation_generation.py and integrations/providers.py. Read the src/canvas parameter panel and its zh-CN and en-US strings. Done means quality is selectable for gpt-image, reaches the provider and execution snapshot, and the listed acceptance criteria pass; image tools remain an open question.

由索引模型根据 Issue 内容生成。

描述

area:provider modality:image provider:openai type:feat

Goal and scope

The OpenAI gpt-image generation and edit endpoints accept quality (low / medium / high / auto), and both output and cost are tiered by it. OpenDirector never sends this parameter, so the choice is left entirely to OpenAI's auto. On the latest origin/main (520ce9ed), a request shaped exactly like a generation node's request for gpt-image-2 (1024×1024, short prompt) came back with quality: low, using the same 196 output image tokens as an explicit low request. Users cannot ask for high quality for final assets, nor pin low quality for drafts to keep costs predictable.

This change adds a quality option for the openai-gpt-image profile, defaulting to auto so existing requests stay the same.

User flow and key rules

  • The image node parameter panel shows "Quality: Auto / Low / Medium / High" only for gpt-image models. Other services do not show it and never send quality.
  • The selected quality is stored in the generation spec and fixed in the job's execution snapshot, so retries and recovery reuse it.
  • The Agent sets quality through the same generation parameter, equivalent to the UI entry.
  • Image tools (smart edit, outpaint, etc.) keep the default for now (see open questions).

Implementation impact

  • domain/input_rules.py: declare the selectable quality levels for openai-gpt-image.
  • Generation parameter contract: add the field and regenerate src/contracts/generated.ts; pass it through application/creation_generation.py and integrations/providers.py.
  • src/canvas parameter panel: add the option with zh-CN and en-US strings.

Acceptance criteria

  • Choosing "High" sends quality=high and the response's quality matches; "Auto" sends the same request as today.
  • Non-gpt-image services do not show the option and do not send quality.
  • Quality is recorded in the execution snapshot and survives reopening the project and retrying.
  • Both the UI and the Agent can set it; zh-CN and en-US strings are complete and npm run check:i18n passes.

Open questions

  • Should image tools (smart edit, outpaint, etc.) also expose quality, or always use the default?
主要语言
TypeScript
星标
119
派生
16
平均合并
16 小时 13 分钟
30 天内合并 PR
195

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ThinkFlowLab/OpenDirector 的其他 Issue

查看 ThinkFlowLab/OpenDirector 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。