Midjourney 画像拡張
curl --request POST \
--url https://api.highwayapi.ai/v3/async/mj-outpaint \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"image_no": 123,
"task_id": "<string>",
"remix_prompt": "<string>",
"scale": 123
}
'import requests
url = "https://api.highwayapi.ai/v3/async/mj-outpaint"
payload = {
"image_no": 123,
"task_id": "<string>",
"remix_prompt": "<string>",
"scale": 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>', scale: 123})
};
fetch('https://api.highwayapi.ai/v3/async/mj-outpaint', 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-outpaint",
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>',
'scale' => 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-outpaint"
payload := strings.NewReader("{\n \"image_no\": 123,\n \"task_id\": \"<string>\",\n \"remix_prompt\": \"<string>\",\n \"scale\": 123\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-outpaint")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"image_no\": 123,\n \"task_id\": \"<string>\",\n \"remix_prompt\": \"<string>\",\n \"scale\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/mj-outpaint")
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 \"scale\": 123\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}画像
Midjourney 画像拡張
POST
/
v3
/
async
/
mj-outpaint
Midjourney 画像拡張
curl --request POST \
--url https://api.highwayapi.ai/v3/async/mj-outpaint \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"image_no": 123,
"task_id": "<string>",
"remix_prompt": "<string>",
"scale": 123
}
'import requests
url = "https://api.highwayapi.ai/v3/async/mj-outpaint"
payload = {
"image_no": 123,
"task_id": "<string>",
"remix_prompt": "<string>",
"scale": 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>', scale: 123})
};
fetch('https://api.highwayapi.ai/v3/async/mj-outpaint', 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-outpaint",
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>',
'scale' => 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-outpaint"
payload := strings.NewReader("{\n \"image_no\": 123,\n \"task_id\": \"<string>\",\n \"remix_prompt\": \"<string>\",\n \"scale\": 123\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-outpaint")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"image_no\": 123,\n \"task_id\": \"<string>\",\n \"remix_prompt\": \"<string>\",\n \"scale\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/mj-outpaint")
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 \"scale\": 123\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 文字。
float
必須
画像拡張の目標比率。ビュー内で新しい画像が占める領域が、元画像の領域に対して何倍になるかを示します。取値範囲:1.1~2.0例:1:1 の画像を拡張した後、外側に 20% 拡張(scale=1.2)
レスポンス情報パラメータ
string
必須
非同期タスクの task_id。この task_id を使用して タスク結果照会 API をリクエストし、生成結果を取得してください
⌘I