上传图片编辑
curl --request POST \
--url https://model-api.skyengine.com.cn/v1/tob/upload-paint \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "midjourney",
"imgUrl": "https://example.com/source.png",
"mask": {
"areas": [
{
"width": 1024,
"height": 1024,
"points": [
300,
300,
300,
700,
700,
700,
700,
300
]
}
]
},
"canvas": {
"width": 1024,
"height": 1024
},
"imgPos": {
"width": 512,
"height": 512,
"x": 256,
"y": 256
},
"remixPrompt": "A blue ceramic mug"
}
'import requests
url = "https://model-api.skyengine.com.cn/v1/tob/upload-paint"
payload = {
"model": "midjourney",
"imgUrl": "https://example.com/source.png",
"mask": { "areas": [
{
"width": 1024,
"height": 1024,
"points": [300, 300, 300, 700, 700, 700, 700, 300]
}
] },
"canvas": {
"width": 1024,
"height": 1024
},
"imgPos": {
"width": 512,
"height": 512,
"x": 256,
"y": 256
},
"remixPrompt": "A blue ceramic mug"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'midjourney',
imgUrl: 'https://example.com/source.png',
mask: {
areas: [{width: 1024, height: 1024, points: [300, 300, 300, 700, 700, 700, 700, 300]}]
},
canvas: {width: 1024, height: 1024},
imgPos: {width: 512, height: 512, x: 256, y: 256},
remixPrompt: 'A blue ceramic mug'
})
};
fetch('https://model-api.skyengine.com.cn/v1/tob/upload-paint', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://model-api.skyengine.com.cn/v1/tob/upload-paint"
payload := strings.NewReader("{\n \"model\": \"midjourney\",\n \"imgUrl\": \"https://example.com/source.png\",\n \"mask\": {\n \"areas\": [\n {\n \"width\": 1024,\n \"height\": 1024,\n \"points\": [\n 300,\n 300,\n 300,\n 700,\n 700,\n 700,\n 700,\n 300\n ]\n }\n ]\n },\n \"canvas\": {\n \"width\": 1024,\n \"height\": 1024\n },\n \"imgPos\": {\n \"width\": 512,\n \"height\": 512,\n \"x\": 256,\n \"y\": 256\n },\n \"remixPrompt\": \"A blue ceramic mug\"\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://model-api.skyengine.com.cn/v1/tob/upload-paint")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"midjourney\",\n \"imgUrl\": \"https://example.com/source.png\",\n \"mask\": {\n \"areas\": [\n {\n \"width\": 1024,\n \"height\": 1024,\n \"points\": [\n 300,\n 300,\n 300,\n 700,\n 700,\n 700,\n 700,\n 300\n ]\n }\n ]\n },\n \"canvas\": {\n \"width\": 1024,\n \"height\": 1024\n },\n \"imgPos\": {\n \"width\": 512,\n \"height\": 512,\n \"x\": 256,\n \"y\": 256\n },\n \"remixPrompt\": \"A blue ceramic mug\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://model-api.skyengine.com.cn/v1/tob/upload-paint",
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([
'model' => 'midjourney',
'imgUrl' => 'https://example.com/source.png',
'mask' => [
'areas' => [
[
'width' => 1024,
'height' => 1024,
'points' => [
300,
300,
300,
700,
700,
700,
700,
300
]
]
]
],
'canvas' => [
'width' => 1024,
'height' => 1024
],
'imgPos' => [
'width' => 512,
'height' => 512,
'x' => 256,
'y' => 256
],
'remixPrompt' => 'A blue ceramic mug'
]),
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;
}{
"id": "<job_id>",
"status": 1,
"urls": [],
"comment": "执行中"
}{
"error": {
"code": 2004,
"message": "unsupported field \"callback\""
}
}{
"error": {
"code": 2002,
"message": "Youchuan submit failed"
}
}{
"error": {
"code": 2007,
"message": "too many active image jobs"
}
}悠船 MJ 图片接口
上传图片编辑
通过图片URL和画布发起独立编辑;不是multipart上传接口。 所有字段均通过JSON传入;不支持callback。成功提交返回原始任务id,使用GET /v1/tob/job/轮询结果。
POST
/
v1
/
tob
/
upload-paint
上传图片编辑
curl --request POST \
--url https://model-api.skyengine.com.cn/v1/tob/upload-paint \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "midjourney",
"imgUrl": "https://example.com/source.png",
"mask": {
"areas": [
{
"width": 1024,
"height": 1024,
"points": [
300,
300,
300,
700,
700,
700,
700,
300
]
}
]
},
"canvas": {
"width": 1024,
"height": 1024
},
"imgPos": {
"width": 512,
"height": 512,
"x": 256,
"y": 256
},
"remixPrompt": "A blue ceramic mug"
}
'import requests
url = "https://model-api.skyengine.com.cn/v1/tob/upload-paint"
payload = {
"model": "midjourney",
"imgUrl": "https://example.com/source.png",
"mask": { "areas": [
{
"width": 1024,
"height": 1024,
"points": [300, 300, 300, 700, 700, 700, 700, 300]
}
] },
"canvas": {
"width": 1024,
"height": 1024
},
"imgPos": {
"width": 512,
"height": 512,
"x": 256,
"y": 256
},
"remixPrompt": "A blue ceramic mug"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'midjourney',
imgUrl: 'https://example.com/source.png',
mask: {
areas: [{width: 1024, height: 1024, points: [300, 300, 300, 700, 700, 700, 700, 300]}]
},
canvas: {width: 1024, height: 1024},
imgPos: {width: 512, height: 512, x: 256, y: 256},
remixPrompt: 'A blue ceramic mug'
})
};
fetch('https://model-api.skyengine.com.cn/v1/tob/upload-paint', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://model-api.skyengine.com.cn/v1/tob/upload-paint"
payload := strings.NewReader("{\n \"model\": \"midjourney\",\n \"imgUrl\": \"https://example.com/source.png\",\n \"mask\": {\n \"areas\": [\n {\n \"width\": 1024,\n \"height\": 1024,\n \"points\": [\n 300,\n 300,\n 300,\n 700,\n 700,\n 700,\n 700,\n 300\n ]\n }\n ]\n },\n \"canvas\": {\n \"width\": 1024,\n \"height\": 1024\n },\n \"imgPos\": {\n \"width\": 512,\n \"height\": 512,\n \"x\": 256,\n \"y\": 256\n },\n \"remixPrompt\": \"A blue ceramic mug\"\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://model-api.skyengine.com.cn/v1/tob/upload-paint")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"midjourney\",\n \"imgUrl\": \"https://example.com/source.png\",\n \"mask\": {\n \"areas\": [\n {\n \"width\": 1024,\n \"height\": 1024,\n \"points\": [\n 300,\n 300,\n 300,\n 700,\n 700,\n 700,\n 700,\n 300\n ]\n }\n ]\n },\n \"canvas\": {\n \"width\": 1024,\n \"height\": 1024\n },\n \"imgPos\": {\n \"width\": 512,\n \"height\": 512,\n \"x\": 256,\n \"y\": 256\n },\n \"remixPrompt\": \"A blue ceramic mug\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://model-api.skyengine.com.cn/v1/tob/upload-paint",
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([
'model' => 'midjourney',
'imgUrl' => 'https://example.com/source.png',
'mask' => [
'areas' => [
[
'width' => 1024,
'height' => 1024,
'points' => [
300,
300,
300,
700,
700,
700,
700,
300
]
]
]
],
'canvas' => [
'width' => 1024,
'height' => 1024
],
'imgPos' => [
'width' => 512,
'height' => 512,
'x' => 256,
'y' => 256
],
'remixPrompt' => 'A blue ceramic mug'
]),
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;
}{
"id": "<job_id>",
"status": 1,
"urls": [],
"comment": "执行中"
}{
"error": {
"code": 2004,
"message": "unsupported field \"callback\""
}
}{
"error": {
"code": 2002,
"message": "Youchuan submit failed"
}
}{
"error": {
"code": 2007,
"message": "too many active image jobs"
}
}完整流程、参数组合与轮询示例见 Midjourney 图片生成与编辑示例。
Authorizations
在 Authorization 请求头中传入 Bearer 。
Body
application/json
账号已开通的 MJ 模型名;直接请求必填。
Minimum string length:
1Example:
"midjourney"
上游可访问的源图片URL。
Minimum string length:
1Example:
"https://example.com/source.png"
使用坐标区域 areas 或蒙版 URL。
- Option 1
- Option 2
Show child attributes
Show child attributes
目标画布尺寸。
Show child attributes
Show child attributes
图片在目标画布中的尺寸与水平/垂直位移。
Show child attributes
Show child attributes
新的提示词。
Minimum string length:
1Example:
"A blue ceramic mug on a white table"
Response
任务已受理;也可能直接返回终态。
原始任务ID。后续编辑作为jobId,查询作为路径参数。
0等待;1执行中;2成功;3失败。
Available options:
0, 1, 2, 3 成功后的图片地址;等待中通常为空。
状态说明或任务失败原因。
上游任务消耗信息;完成前可能变化,不等同于平台钱包流水或最终实付账单。
Show child attributes
Show child attributes

