Edición de GPT Image 2 Light
curl --request POST \
--url https://api.highwayapi.ai/v3/gpt-image-2-light-edit \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"mask": {
"image_url": "<string>"
},
"size": "<string>",
"images": [
{
"image_url": "<string>"
}
],
"prompt": "<string>",
"background": "<string>",
"moderation": "<string>"
}
'import requests
url = "https://api.highwayapi.ai/v3/gpt-image-2-light-edit"
payload = {
"mask": { "image_url": "<string>" },
"size": "<string>",
"images": [{ "image_url": "<string>" }],
"prompt": "<string>",
"background": "<string>",
"moderation": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
mask: {image_url: '<string>'},
size: '<string>',
images: [{image_url: '<string>'}],
prompt: '<string>',
background: '<string>',
moderation: '<string>'
})
};
fetch('https://api.highwayapi.ai/v3/gpt-image-2-light-edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/gpt-image-2-light-edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mask' => [
'image_url' => '<string>'
],
'size' => '<string>',
'images' => [
[
'image_url' => '<string>'
]
],
'prompt' => '<string>',
'background' => '<string>',
'moderation' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/gpt-image-2-light-edit"
payload := strings.NewReader("{\n \"mask\": {\n \"image_url\": \"<string>\"\n },\n \"size\": \"<string>\",\n \"images\": [\n {\n \"image_url\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"background\": \"<string>\",\n \"moderation\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/gpt-image-2-light-edit")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"mask\": {\n \"image_url\": \"<string>\"\n },\n \"size\": \"<string>\",\n \"images\": [\n {\n \"image_url\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"background\": \"<string>\",\n \"moderation\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/gpt-image-2-light-edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"mask\": {\n \"image_url\": \"<string>\"\n },\n \"size\": \"<string>\",\n \"images\": [\n {\n \"image_url\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"background\": \"<string>\",\n \"moderation\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"images": [
"<string>"
]
}Imágenes
Edición de GPT Image 2 Light
POST
/
v3
/
gpt-image-2-light-edit
Edición de GPT Image 2 Light
curl --request POST \
--url https://api.highwayapi.ai/v3/gpt-image-2-light-edit \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"mask": {
"image_url": "<string>"
},
"size": "<string>",
"images": [
{
"image_url": "<string>"
}
],
"prompt": "<string>",
"background": "<string>",
"moderation": "<string>"
}
'import requests
url = "https://api.highwayapi.ai/v3/gpt-image-2-light-edit"
payload = {
"mask": { "image_url": "<string>" },
"size": "<string>",
"images": [{ "image_url": "<string>" }],
"prompt": "<string>",
"background": "<string>",
"moderation": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
mask: {image_url: '<string>'},
size: '<string>',
images: [{image_url: '<string>'}],
prompt: '<string>',
background: '<string>',
moderation: '<string>'
})
};
fetch('https://api.highwayapi.ai/v3/gpt-image-2-light-edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/gpt-image-2-light-edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mask' => [
'image_url' => '<string>'
],
'size' => '<string>',
'images' => [
[
'image_url' => '<string>'
]
],
'prompt' => '<string>',
'background' => '<string>',
'moderation' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/gpt-image-2-light-edit"
payload := strings.NewReader("{\n \"mask\": {\n \"image_url\": \"<string>\"\n },\n \"size\": \"<string>\",\n \"images\": [\n {\n \"image_url\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"background\": \"<string>\",\n \"moderation\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/gpt-image-2-light-edit")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"mask\": {\n \"image_url\": \"<string>\"\n },\n \"size\": \"<string>\",\n \"images\": [\n {\n \"image_url\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"background\": \"<string>\",\n \"moderation\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/gpt-image-2-light-edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"mask\": {\n \"image_url\": \"<string>\"\n },\n \"size\": \"<string>\",\n \"images\": [\n {\n \"image_url\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"background\": \"<string>\",\n \"moderation\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"images": [
"<string>"
]
}API de edición de imágenes GPT Image 2 Light. Recibe URL de imágenes mediante el array images, edita las imágenes de entrada según el prompt y devuelve la URL de la imagen editada.
Encabezados de solicitud
string
requerido
Valores enumerados:
application/jsonstring
requerido
Formato de autenticación Bearer: Bearer {{API Key}}.
Cuerpo de la solicitud
object
Ocultar propiedades
Ocultar propiedades
string
URL o data URL de la imagen de máscara. La imagen de máscara debe ser PNG y debe incluir alpha channel, por ejemplo RGBA o LA. Las áreas transparentes indican las zonas que deben editarse o redibujarse, mientras que las áreas opacas indican las zonas que deben mantenerse sin cambios en la medida de lo posible. Normalmente, las dimensiones de la máscara deben coincidir con las de la image de entrada. No se admite file_id.
string
predeterminado:"1024x1024"
Resolución de la imagen de salida.Valores opcionales:
1024x1024, 1024x1536, 1536x1024, 1152x2048, 2048x1152, 2048x2048, 2160x3840, 3840x2160object[]
requerido
Lista de imágenes originales que se editarán en modo JSON URL. Se requiere al menos un image_url; admite URL o data URL.Longitud del array: 1 - 16
Ocultar propiedades
Ocultar propiedades
string
requerido
URL o data URL de la imagen de entrada. No se admite file_id.
string
requerido
Instrucciones de edición que describen cómo se desea modificar la imagen de entrada. Si está vacío, se devolverá prompt is required.Límite de longitud: 0 - 32000
string
Método de tratamiento del fondo de la imagen de salida.Valores opcionales:
auto, opaquestring
Nivel de rigor de la moderación de contenido.Valores opcionales:
auto, lowInformación de respuesta
string[]
Array de URL de las imágenes resultantes de la edición transformadas y almacenadas por la plataforma.
⌘I