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

オープン
#220 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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分
マージ済み PR(30日)
195

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ThinkFlowLab/OpenDirector のほかの issue

ThinkFlowLab/OpenDirector の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。