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>"
}画像
Midjourney 領域再描画
POST
/
v3
/
async
/
mj-inpaint
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>"
}Midjourney の領域再描画機能を使用して、生成済み画像の指定領域を再描画します。ポリゴン領域または白黒マスク画像で再描画領域を指定できます。このインターフェースは非同期処理方式を採用しており、クライアントは task_id を使用して最終的な生成結果を照会する必要があります。
リクエストヘッダー
string
必須
列挙値:
application/jsonstring
必須
Bearer 認証形式: Bearer {{API Key}}。
リクエストボディ
integer
必須
画像番号。領域再描画を行う画像を指定するために使用します。取り得る値:0~3
string
必須
元画像生成タスクの一意の識別子。
string
再描画領域のプロンプト。再描画領域に期待する内容を説明するために使用します。長さ制限:1-8192 文字。
object
必須
描画領域の設定。area パラメータの代替で、複数領域の再描画に対応します。areas と url のいずれか一方を指定します。
object
必須
レスポンス情報パラメータ
string
必須
非同期タスクの task_id。この task_id を使用して タスク結果照会 API をリクエストし、生成結果を取得してください
⌘I