Skip to content

feat: Images API 参数扩展 — quality/input_fidelity/moderation#1

Merged
ONEGAYI merged 1 commit into
mainfrom
worktree-images-api-update
May 10, 2026
Merged

feat: Images API 参数扩展 — quality/input_fidelity/moderation#1
ONEGAYI merged 1 commit into
mainfrom
worktree-images-api-update

Conversation

@ONEGAYI
Copy link
Copy Markdown
Owner

@ONEGAYI ONEGAYI commented May 10, 2026

Summary

  • 适配 PackyAPI gpt-image-2 新文档(2026/5/10),扩展 Images API 参数透传
  • 后端 _PARAM_KEYSGenerateParams 新增 input_fidelitymoderation
  • 前端 RatioSelector 新增 Quality(auto/low/medium/high)和 Moderation(auto/low)选择区段
  • quality 默认值从 high 改为 auto(与 API 文档一致)

Test plan

  • 后端 101 个测试全部通过
  • 前端 TypeScript 类型检查通过
  • 手动测试 images 模式文生图(确认新参数不影响 generations 端点)
  • 手动测试 images 模式图片编辑(确认 input_fidelity 和 moderation 正确透传)

🤖 Generated with Claude Code

适配 PackyAPI gpt-image-2 新文档(2026/5/10),扩展 Images API 参数透传。

后端:
- client.py: _PARAM_KEYS 新增 input_fidelity、moderation 参数键
- generate.py: GenerateParams 新增 input_fidelity、moderation 可选字段
- generate.py: quality 默认值从 high 改为 auto(与 API 文档一致)

前端:
- types/index.ts: GenerateParams 类型对齐新增字段
- generationStore.ts: 新增 quality、moderation 状态及 setter
- generationStore.ts: startGeneration 透传 quality、moderation 到 API
- RatioSelector.tsx: 新增 Quality(auto/low/medium/high)和 Moderation(auto/low)选择区段
- RatioSelector.tsx: Popover 改用 createPortal 渲染到 body,避免 overflow 裁剪
- InputArea.tsx: 工具栏行增加 overflow: visible
- i18n: 中英文翻译新增 ratio.quality、ratio.moderation

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ONEGAYI
Copy link
Copy Markdown
Owner Author

ONEGAYI commented May 10, 2026

/review

@github-actions
Copy link
Copy Markdown

Preparing review...

@ONEGAYI
Copy link
Copy Markdown
Owner Author

ONEGAYI commented May 10, 2026

/review

@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@ONEGAYI ONEGAYI merged commit 3e9f54e into main May 10, 2026
@ONEGAYI ONEGAYI deleted the worktree-images-api-update branch May 10, 2026 12:16
ONEGAYI pushed a commit that referenced this pull request May 10, 2026
### 变更内容

- CHANGELOG.md: 新增 v1.7.0 版本条目,记录 Markdown/LaTeX 渲染、Images API 参数扩展、PR Agent CI
- CLAUDE.md: 更新版本号至 1.7.0,更新文件树(新增 MarkdownRenderer 组件、PR Agent 配置、GitHub Actions),更新架构描述(Images API 参数透传、Markdown 渲染流程)
- 版本号同步更新至 1.7.0(5 文件:pyproject.toml、server.py、package.json、Cargo.toml、tauri.conf.json)
- README 排版修正

### 关联

Close #1, Close #2

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant