Repintado de áreas de Midjourney
curl --request POST \
--url https://api.highwayapi.ai/v3/async/mj-inpaint \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"image_no": 123,
"task_id": "<string>",
"remix_prompt": "<string>",
"mask": {
"url": "<string>",
"areas": [
{
"points": [
123
],
"width": 123,
"height": 123
}
]
},
"area": {
"points": [
123
],
"width": 123,
"height": 123
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/mj-inpaint"
payload = {
"image_no": 123,
"task_id": "<string>",
"remix_prompt": "<string>",
"mask": {
"url": "<string>",
"areas": [
{
"points": [123],
"width": 123,
"height": 123
}
]
},
"area": {
"points": [123],
"width": 123,
"height": 123
}
}
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({
image_no: 123,
task_id: '<string>',
remix_prompt: '<string>',
mask: {url: '<string>', areas: [{points: [123], width: 123, height: 123}]},
area: {points: [123], width: 123, height: 123}
})
};
fetch('https://api.highwayapi.ai/v3/async/mj-inpaint', 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/async/mj-inpaint",
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([
'image_no' => 123,
'task_id' => '<string>',
'remix_prompt' => '<string>',
'mask' => [
'url' => '<string>',
'areas' => [
[
'points' => [
123
],
'width' => 123,
'height' => 123
]
]
],
'area' => [
'points' => [
123
],
'width' => 123,
'height' => 123
]
]),
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/async/mj-inpaint"
payload := strings.NewReader("{\n \"image_no\": 123,\n \"task_id\": \"<string>\",\n \"remix_prompt\": \"<string>\",\n \"mask\": {\n \"url\": \"<string>\",\n \"areas\": [\n {\n \"points\": [\n 123\n ],\n \"width\": 123,\n \"height\": 123\n }\n ]\n },\n \"area\": {\n \"points\": [\n 123\n ],\n \"width\": 123,\n \"height\": 123\n }\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/async/mj-inpaint")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"image_no\": 123,\n \"task_id\": \"<string>\",\n \"remix_prompt\": \"<string>\",\n \"mask\": {\n \"url\": \"<string>\",\n \"areas\": [\n {\n \"points\": [\n 123\n ],\n \"width\": 123,\n \"height\": 123\n }\n ]\n },\n \"area\": {\n \"points\": [\n 123\n ],\n \"width\": 123,\n \"height\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/mj-inpaint")
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 \"image_no\": 123,\n \"task_id\": \"<string>\",\n \"remix_prompt\": \"<string>\",\n \"mask\": {\n \"url\": \"<string>\",\n \"areas\": [\n {\n \"points\": [\n 123\n ],\n \"width\": 123,\n \"height\": 123\n }\n ]\n },\n \"area\": {\n \"points\": [\n 123\n ],\n \"width\": 123,\n \"height\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Imágenes
Repintado de áreas de Midjourney
POST
/
v3
/
async
/
mj-inpaint
Repintado de áreas de Midjourney
curl --request POST \
--url https://api.highwayapi.ai/v3/async/mj-inpaint \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"image_no": 123,
"task_id": "<string>",
"remix_prompt": "<string>",
"mask": {
"url": "<string>",
"areas": [
{
"points": [
123
],
"width": 123,
"height": 123
}
]
},
"area": {
"points": [
123
],
"width": 123,
"height": 123
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/mj-inpaint"
payload = {
"image_no": 123,
"task_id": "<string>",
"remix_prompt": "<string>",
"mask": {
"url": "<string>",
"areas": [
{
"points": [123],
"width": 123,
"height": 123
}
]
},
"area": {
"points": [123],
"width": 123,
"height": 123
}
}
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({
image_no: 123,
task_id: '<string>',
remix_prompt: '<string>',
mask: {url: '<string>', areas: [{points: [123], width: 123, height: 123}]},
area: {points: [123], width: 123, height: 123}
})
};
fetch('https://api.highwayapi.ai/v3/async/mj-inpaint', 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/async/mj-inpaint",
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([
'image_no' => 123,
'task_id' => '<string>',
'remix_prompt' => '<string>',
'mask' => [
'url' => '<string>',
'areas' => [
[
'points' => [
123
],
'width' => 123,
'height' => 123
]
]
],
'area' => [
'points' => [
123
],
'width' => 123,
'height' => 123
]
]),
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/async/mj-inpaint"
payload := strings.NewReader("{\n \"image_no\": 123,\n \"task_id\": \"<string>\",\n \"remix_prompt\": \"<string>\",\n \"mask\": {\n \"url\": \"<string>\",\n \"areas\": [\n {\n \"points\": [\n 123\n ],\n \"width\": 123,\n \"height\": 123\n }\n ]\n },\n \"area\": {\n \"points\": [\n 123\n ],\n \"width\": 123,\n \"height\": 123\n }\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/async/mj-inpaint")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"image_no\": 123,\n \"task_id\": \"<string>\",\n \"remix_prompt\": \"<string>\",\n \"mask\": {\n \"url\": \"<string>\",\n \"areas\": [\n {\n \"points\": [\n 123\n ],\n \"width\": 123,\n \"height\": 123\n }\n ]\n },\n \"area\": {\n \"points\": [\n 123\n ],\n \"width\": 123,\n \"height\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/mj-inpaint")
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 \"image_no\": 123,\n \"task_id\": \"<string>\",\n \"remix_prompt\": \"<string>\",\n \"mask\": {\n \"url\": \"<string>\",\n \"areas\": [\n {\n \"points\": [\n 123\n ],\n \"width\": 123,\n \"height\": 123\n }\n ]\n },\n \"area\": {\n \"points\": [\n 123\n ],\n \"width\": 123,\n \"height\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Utiliza la función de repintado de áreas de Midjourney para volver a dibujar regiones específicas de una imagen ya generada. Permite especificar el área de repintado mediante regiones poligonales o una imagen de máscara en blanco y negro. Esta interfaz utiliza procesamiento asíncrono, por lo que el cliente debe consultar el resultado final generado mediante el task_id.
Encabezados de la solicitud
string
requerido
Valores enumerados:
application/jsonstring
requerido
Formato de autenticación Bearer: Bearer {{clave de API}}.
Cuerpo de la solicitud
integer
requerido
Número de imagen, utilizado para especificar la imagen sobre la que se realizará el repintado de área.Rango de valores: 0~3
string
requerido
Identificador único de la tarea de generación de la imagen original.
string
Prompt para el área de repintado, utilizado para describir el contenido esperado en el área que se volverá a dibujar.Límite de longitud: 1-8192 caracteres.
object
requerido
Configuración del área de dibujo, que reemplaza al parámetro area y admite el repintado de múltiples áreas. Elija una de areas o url.
Mostrar propiedades
Mostrar propiedades
string
Especifica la región poligonal mediante una imagen binaria en blanco y negro. Admite especificar varias regiones; las áreas blancas son las áreas de repintado.
object[]
Arreglo de regiones poligonales; admite especificar varias regiones.
Mostrar propiedades de InpaintArea
Mostrar propiedades de InpaintArea
number[]
requerido
Arreglo de puntos de coordenadas de la región poligonal, con la esquina superior izquierda como origen, organizado en sentido horario y en formato XYXY.
float
requerido
Ancho de la imagen en píxeles.Rango de valores: 500~4096
float
requerido
Alto de la imagen en píxeles.Rango de valores: 500~4096
object
requerido
Configuración de una única región poligonal (se usa de forma excluyente con el parámetro mask).
Mostrar propiedades
Mostrar propiedades
number[]
requerido
Arreglo de puntos de coordenadas de la región poligonal, con la esquina superior izquierda como origen, organizado en sentido horario y en formato XYXY.
float
requerido
Ancho de la imagen en píxeles.Rango de valores: 500~4096
float
requerido
Alto de la imagen en píxeles.Rango de valores: 500~4096
Parámetros de información de la respuesta
string
requerido
El task_id de la tarea asíncrona. Debe usar este task_id para solicitar la API de consulta de resultado de tarea y obtener el resultado generado
⌘I