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

Aberta
#220 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
55/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
python, typescript

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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?
Linguagem predominante
TypeScript
Estrelas
119
Forks
16
Merge médio
16h 13min
PRs com merge (30d)
195

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de ThinkFlowLab/OpenDirector

Todas as issues de ThinkFlowLab/OpenDirector

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.