GPT Image 1.5
Text-to-Image • OpenAI • ProxiedOpenAI's image generation model that creates and edits images from text prompts, supporting multiple quality levels and output sizes.
| Model Info | |
|---|---|
| Terms and License | link ↗ |
| More information | link ↗ |
Usage
const response = await env.AI.run( 'openai/gpt-image-1.5', { prompt: 'A golden retriever puppy playing in autumn leaves', }, { gateway: { id: 'default' }, })console.log(response)
Examples
High Quality — Generate a high-quality detailed image
const response = await env.AI.run( 'openai/gpt-image-1.5', { prompt: 'A detailed botanical illustration of exotic tropical flowers with fine line work and watercolor textures', quality: 'high', }, { gateway: { id: 'default' }, })console.log(response)
Custom Size — Generate a widescreen image
const response = await env.AI.run( 'openai/gpt-image-1.5', { prompt: 'A panoramic view of the northern lights over a snowy mountain range, vivid greens and purples dancing across the sky', size: '1792x1024', }, { gateway: { id: 'default' }, })console.log(response)
Vivid Style — Hyper-real, dramatic image style
const response = await env.AI.run( 'openai/gpt-image-1.5', { prompt: 'A neon-lit cyberpunk cityscape at night with rain-slicked streets and holographic billboards', style: 'vivid', quality: 'high', }, { gateway: { id: 'default' }, })console.log(response)
Natural Style — More natural, less hyper-real image style
const response = await env.AI.run( 'openai/gpt-image-1.5', { prompt: 'A quiet Japanese garden in morning mist with a stone lantern and koi pond', style: 'natural', size: '1024x1024', }, { gateway: { id: 'default' }, })console.log(response)
Parameters
stringrequiredText prompt describing the image to generate or editstringBase64-encoded input image for image editingstringenum: low, medium, high, autoQuality of the generated imagestringenum: 256x256, 512x512, 1024x1024, 1792x1024, 1024x1792Size of the generated imagestringenum: vivid, naturalStyle of the generated imagestringformat: uriURL to the generated imageAPI Schemas
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "description": "Text prompt describing the image to generate or edit", "type": "string" }, "image": { "description": "Base64-encoded input image for image editing", "type": "string" }, "quality": { "description": "Quality of the generated image", "type": "string", "enum": [ "low", "medium", "high", "auto" ] }, "size": { "description": "Size of the generated image", "type": "string", "enum": [ "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792" ] }, "style": { "description": "Style of the generated image", "type": "string", "enum": [ "vivid", "natural" ] } }, "required": [ "prompt" ], "additionalProperties": false}{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "image": { "description": "URL to the generated image", "type": "string", "format": "uri" } }, "required": [ "image" ], "additionalProperties": false}