Midjourney
Midjourney editor 작업 생성
CometAPI Submit Editor API (POST /mj/submit/edits)를 사용해 maskBase64, 프롬프트, 선택적 원본 이미지, 투명 편집으로 Midjourney 이미지를 편집합니다.
POST
/
mj
/
submit
/
edits
cURL
curl https://api.cometapi.com/mj/submit/edits \
-H "Authorization: Bearer $COMETAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Change to white background",
"image": "https://your-image-host/source.png"
}'import os
import requests
response = requests.post(
"https://api.cometapi.com/mj/submit/edits",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
json={
"prompt": "Change to white background",
"image": "https://your-image-host/source.png",
},
)
task = response.json()
print(task["code"], task.get("result"))
const response = await fetch("https://api.cometapi.com/mj/submit/edits", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "Change to white background",
image: "https://your-image-host/source.png",
}),
});
const task = await response.json();
console.log(task.code, task.result);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/mj/submit/edits",
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([
'prompt' => 'Change to white background',
'image' => 'https://your-image-host/source.png'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.cometapi.com/mj/submit/edits"
payload := strings.NewReader("{\n \"prompt\": \"Change to white background\",\n \"image\": \"https://your-image-host/source.png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.cometapi.com/mj/submit/edits")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Change to white background\",\n \"image\": \"https://your-image-host/source.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/mj/submit/edits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"Change to white background\",\n \"image\": \"https://your-image-host/source.png\"\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"description": "<string>",
"result": "<string>"
}이 엔드포인트를 사용하면 마스크로 Midjourney 이미지를 편집하거나, 프롬프트와 소스 이미지를 조합해 투명 배경 결과를 생성할 수 있습니다.
일반적인 두 가지 모드
- 마스킹 편집:
maskBase64와prompt를 전송하고, 필요에 따라 원본image를 함께 전송합니다 - 투명 드로잉: 별도의 마스크 없이 투명 배경 결과를 원할 때
image와prompt를 전송합니다
작업 흐름
1
editor 작업 제출
편집 모드를 선택하고, 프롬프트와 소스 데이터를 전송한 다음, 반환된 작업 id를 저장합니다.
2
작업 폴링
작업이 종료 상태에 도달할 때까지 단일 작업 가져오기를 사용합니다.
3
결과에서 계속 진행
최종 에셋을 직접 사용하거나, 편집 결과에 후속 버튼이 표시되면 Action을 트리거합니다.
인증
Bearer token authentication. Use your CometAPI key.
본문
application/json
Text prompt describing the desired edit.
Image to edit. Pass a public URL or a base64-encoded data URI.
Custom state string. Returned as-is in the task result and webhook callback for your own tracking.
Webhook URL to receive task status updates. Falls back to your account-level webhook if omitted.
When true, return the original provider image URL instead of a CometAPI-proxied link.
응답
200 - application/json
Success
마지막 수정일 2026년 6월 23일
⌘I
cURL
curl https://api.cometapi.com/mj/submit/edits \
-H "Authorization: Bearer $COMETAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Change to white background",
"image": "https://your-image-host/source.png"
}'import os
import requests
response = requests.post(
"https://api.cometapi.com/mj/submit/edits",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
json={
"prompt": "Change to white background",
"image": "https://your-image-host/source.png",
},
)
task = response.json()
print(task["code"], task.get("result"))
const response = await fetch("https://api.cometapi.com/mj/submit/edits", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "Change to white background",
image: "https://your-image-host/source.png",
}),
});
const task = await response.json();
console.log(task.code, task.result);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/mj/submit/edits",
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([
'prompt' => 'Change to white background',
'image' => 'https://your-image-host/source.png'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.cometapi.com/mj/submit/edits"
payload := strings.NewReader("{\n \"prompt\": \"Change to white background\",\n \"image\": \"https://your-image-host/source.png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.cometapi.com/mj/submit/edits")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Change to white background\",\n \"image\": \"https://your-image-host/source.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/mj/submit/edits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"Change to white background\",\n \"image\": \"https://your-image-host/source.png\"\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"description": "<string>",
"result": "<string>"
}