Skip to content

Upgrade OpenAI image generation to GPT Image - #67

Merged
Dereje1 merged 1 commit into
masterfrom
codex/upgrade-openai-image-generation-to-gpt-image
Jul 21, 2026
Merged

Upgrade OpenAI image generation to GPT Image#67
Dereje1 merged 1 commit into
masterfrom
codex/upgrade-openai-image-generation-to-gpt-image

Conversation

@Dereje1

@Dereje1 Dereje1 commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Replace the hard-coded DALL·E 3 image path with the GPT Image approach used elsewhere so generated images work with newer OpenAI responses while preserving the existing Pin creation and S3 upload flow.
  • Keep the change minimal and backwards-compatible with the current frontend imgURL contract and existing processImage()/S3 logic.

Description

  • Updated openai dependency range to ^4.52.1 in package.json and package-lock.json to match a GPT Image-capable SDK.
  • Switched server image generation in server/controllers/post.ts to use OPENAI_IMAGE_MODEL = process.env.OPENAI_IMAGE_MODEL || 'gpt-image-1', replaced the hard-coded dall-e-3, and kept n: 1 and size: '1024x1024'.
  • Added support for GPT Image b64_json responses by converting to data:image/png;base64,<base64> and retaining url as a fallback, and changed persisted AI-generated data to only store lightweight metadata (created, hasUrl, hasB64Json, model) rather than the full base64.
  • Added/updated tests in tests/server/controllers/post.test.ts to cover the configured model call, base64 (b64_json) handling, URL fallback, missing-image payload, and verification that the full base64 payload is not persisted, and documented OPENAI_IMAGE_MODEL=gpt-image-1 in README.md.
  • Files changed: package.json, package-lock.json, server/controllers/post.ts, tests/server/controllers/post.test.ts, README.md.
  • Closes Upgrade OpenAI image generation from DALL-E 3 to GPT Image #66

Testing

  • Ran the focused controller tests with npx jest tests/server/controllers/post.test.ts --runInBand and they passed.
  • Ran the full test suite with npm test -- --watch=false --runInBand and all test suites passed.
  • Ran TypeScript checks with npm run compileTS which succeeded, and lint with npm run lint which succeeded after a minor test-line-length fix.
  • Built server and client with npm run build_server and npm run build_client, both completed successfully.
  • Note: npm install openai@^4.52.1 --package-lock-only could not be completed in this environment due to an HTTP 403 from the registry/proxy, so the lockfile entries were updated in-place and all local automated checks used the updated files and mocked OpenAI behavior.

Codex Task

@Dereje1
Dereje1 merged commit b89ad62 into master Jul 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade OpenAI image generation from DALL-E 3 to GPT Image

1 participant