メインコンテンツへスキップ
POST
/
v3
/
gpt-image-2-edit
GPT Image 2 画像編集
curl --request POST \
  --url https://api.highwayapi.ai/v3/gpt-image-2-edit \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "n": 123,
  "mask": "<string>",
  "size": "<string>",
  "image": "<string>",
  "prompt": "<string>",
  "quality": "<string>",
  "background": "<string>",
  "output_format": "<string>"
}
'
{
  "images": [
    {}
  ]
}
OpenAI GPT Image 2 画像編集 API。テキストプロンプトに基づいて画像を編集し、マスク修復、透明背景、およびさまざまな品質/サイズオプションに対応しています。

リクエストヘッダー

Content-Type
string
必須
列挙値: application/json
Authorization
string
必須
Bearer 認証形式: Bearer {{API Key}}。

リクエストボディ

n
integer
デフォルト:1
生成する画像の数。実際に返される数はリクエスト数より少ない場合があります。値の範囲:[1, 10]
mask
string
追加画像。その完全に透明な領域が編集対象の位置を示します。alpha チャンネル付きの PNG 形式である必要があります。
size
string
デフォルト:"1024x1024"
生成画像のサイズ。選択可能な値:auto, 688x2048, 880x2048, 1024x1024, 1024x1536, 1024x2048, 1152x2048, 1360x2048, 1536x1024, 1536x2048, 2048x688, 2048x880, 2048x1024, 2048x1152, 2048x1360, 2048x1536, 2048x2048, 2160x3840, 3840x2160
image
string
必須
編集する画像。単一の画像 URL/base64、または画像配列を指定できます。対応形式:PNG、JPEG、GIF、WebP。
prompt
string
必須
必要な編集効果を説明するテキストプロンプト。最大長は 32000 文字です。長さ制限:0 - 32000
quality
string
デフォルト:"low"
生成画像の品質。品質が高いほど時間がかかり、コストも高くなります。選択可能な値:low, medium, high
background
string
デフォルト:"auto"
背景を不透明にするか、自動検出するか。選択可能な値:opaque, auto
output_format
string
デフォルト:"png"
出力画像形式。選択可能な値:png, jpeg

レスポンス情報

images
array
生成された画像 URL の配列。