Skip to content

fishxcode/gpt-image-2

GPT-Image-2 Tools

简体中文

GPT-Image-2 Tools is a client-side AI image generation playground for the /v1/images/generations API. It is built with TanStack Start, React 19, TypeScript, Tailwind CSS v4, and shadcn/Radix UI components.

Online Demo

Features

  • Configure a custom image generation API endpoint and API Key.
  • Save generation settings locally in the browser.
  • Override settings through URL parameters for shareable playground links.
  • Generate images with configurable model, size, quality, output format, background, response format, and image count.
  • Switch between English and Simplified Chinese UI.
  • Browse curated prompts in the Prompt Plaza and reuse them in the playground.
  • Browse sample assets in the Asset Gallery and reuse their prompts.
  • Includes SEO routes for sitemap, robots, and RSS.
  • Includes Vite and Cloudflare-related project configuration.

Tech Stack

  • TanStack Start and TanStack Router
  • React 19
  • TypeScript
  • Tailwind CSS v4
  • shadcn/Radix UI
  • Vite
  • Cloudflare Vite integration

Getting Started

Prerequisites

  • Node.js
  • npm

Install

npm install

Development

npm run dev

Production Build

npm run build

Development Build

npm run build:dev

Preview

npm run preview

Lint

npm run lint

Format

npm run format

Configuration

Open Settings in the app to configure:

  • API URL, for example https://example.com/v1/images/generations
  • API Key
  • Model, default gpt-image-2
  • Image count, size, quality, response format, background, and output format

Settings are stored in the browser with localStorage. URL parameters can temporarily override saved settings without persisting them until saved in the UI.

Supported URL parameters include apiUrl, apiKey, model, n, size, quality, responseFormat, background, outputFormat, and prompt.

Avoid sharing URLs that contain real API keys.

API Compatibility

The playground sends a POST request to the configured API URL with a bearer token and an image generation payload compatible with /v1/images/generations style endpoints. The response can contain b64_json or url image data.

License

MIT. See LICENSE.

Contributing

See CONTRIBUTING.md, SECURITY.md, and CODE_OF_CONDUCT.md.

About

GPT-Image-2 online AI image generation playground with custom API keys, prompt plaza, reusable gallery examples, and bilingual SEO routes.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors