Midjourney 图生图
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/mj-img2img \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Make it more colorful and vibrant",
"aspectRatio": "16:9",
"enableTranslation": false,
"fileUrls": [
"https://example.com/image.jpg"
],
"speed": "relaxed",
"stylization": 1,
"variety": 10,
"version": "7",
"waterMark": "my_watermark",
"weirdness": 1
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/mj-img2img"
payload = {
"prompt": "Make it more colorful and vibrant",
"aspectRatio": "16:9",
"enableTranslation": False,
"fileUrls": ["https://example.com/image.jpg"],
"speed": "relaxed",
"stylization": 1,
"variety": 10,
"version": "7",
"waterMark": "my_watermark",
"weirdness": 1
}
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({
prompt: 'Make it more colorful and vibrant',
aspectRatio: '16:9',
enableTranslation: false,
fileUrls: ['https://example.com/image.jpg'],
speed: 'relaxed',
stylization: 1,
variety: 10,
version: '7',
waterMark: 'my_watermark',
weirdness: 1
})
};
fetch('https://api.sinancode.com/v1/generate/k/mj-img2img', 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.sinancode.com/v1/generate/k/mj-img2img",
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' => 'Make it more colorful and vibrant',
'aspectRatio' => '16:9',
'enableTranslation' => false,
'fileUrls' => [
'https://example.com/image.jpg'
],
'speed' => 'relaxed',
'stylization' => 1,
'variety' => 10,
'version' => '7',
'waterMark' => 'my_watermark',
'weirdness' => 1
]),
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.sinancode.com/v1/generate/k/mj-img2img"
payload := strings.NewReader("{\n \"prompt\": \"Make it more colorful and vibrant\",\n \"aspectRatio\": \"16:9\",\n \"enableTranslation\": false,\n \"fileUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"speed\": \"relaxed\",\n \"stylization\": 1,\n \"variety\": 10,\n \"version\": \"7\",\n \"waterMark\": \"my_watermark\",\n \"weirdness\": 1\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.sinancode.com/v1/generate/k/mj-img2img")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Make it more colorful and vibrant\",\n \"aspectRatio\": \"16:9\",\n \"enableTranslation\": false,\n \"fileUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"speed\": \"relaxed\",\n \"stylization\": 1,\n \"variety\": 10,\n \"version\": \"7\",\n \"waterMark\": \"my_watermark\",\n \"weirdness\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/mj-img2img")
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\": \"Make it more colorful and vibrant\",\n \"aspectRatio\": \"16:9\",\n \"enableTranslation\": false,\n \"fileUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"speed\": \"relaxed\",\n \"stylization\": 1,\n \"variety\": 10,\n \"version\": \"7\",\n \"waterMark\": \"my_watermark\",\n \"weirdness\": 1\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}图片生成 - Midjourney
Midjourney 图生图
使用 Midjourney AI 模型从输入图片生成图片(异步)
POST
/
generate
/
k
/
mj-img2img
Midjourney 图生图
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/mj-img2img \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Make it more colorful and vibrant",
"aspectRatio": "16:9",
"enableTranslation": false,
"fileUrls": [
"https://example.com/image.jpg"
],
"speed": "relaxed",
"stylization": 1,
"variety": 10,
"version": "7",
"waterMark": "my_watermark",
"weirdness": 1
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/mj-img2img"
payload = {
"prompt": "Make it more colorful and vibrant",
"aspectRatio": "16:9",
"enableTranslation": False,
"fileUrls": ["https://example.com/image.jpg"],
"speed": "relaxed",
"stylization": 1,
"variety": 10,
"version": "7",
"waterMark": "my_watermark",
"weirdness": 1
}
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({
prompt: 'Make it more colorful and vibrant',
aspectRatio: '16:9',
enableTranslation: false,
fileUrls: ['https://example.com/image.jpg'],
speed: 'relaxed',
stylization: 1,
variety: 10,
version: '7',
waterMark: 'my_watermark',
weirdness: 1
})
};
fetch('https://api.sinancode.com/v1/generate/k/mj-img2img', 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.sinancode.com/v1/generate/k/mj-img2img",
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' => 'Make it more colorful and vibrant',
'aspectRatio' => '16:9',
'enableTranslation' => false,
'fileUrls' => [
'https://example.com/image.jpg'
],
'speed' => 'relaxed',
'stylization' => 1,
'variety' => 10,
'version' => '7',
'waterMark' => 'my_watermark',
'weirdness' => 1
]),
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.sinancode.com/v1/generate/k/mj-img2img"
payload := strings.NewReader("{\n \"prompt\": \"Make it more colorful and vibrant\",\n \"aspectRatio\": \"16:9\",\n \"enableTranslation\": false,\n \"fileUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"speed\": \"relaxed\",\n \"stylization\": 1,\n \"variety\": 10,\n \"version\": \"7\",\n \"waterMark\": \"my_watermark\",\n \"weirdness\": 1\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.sinancode.com/v1/generate/k/mj-img2img")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Make it more colorful and vibrant\",\n \"aspectRatio\": \"16:9\",\n \"enableTranslation\": false,\n \"fileUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"speed\": \"relaxed\",\n \"stylization\": 1,\n \"variety\": 10,\n \"version\": \"7\",\n \"waterMark\": \"my_watermark\",\n \"weirdness\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/mj-img2img")
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\": \"Make it more colorful and vibrant\",\n \"aspectRatio\": \"16:9\",\n \"enableTranslation\": false,\n \"fileUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"speed\": \"relaxed\",\n \"stylization\": 1,\n \"variety\": 10,\n \"version\": \"7\",\n \"waterMark\": \"my_watermark\",\n \"weirdness\": 1\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}使用 Midjourney V7 模型基于图片生成新的艺术作品。
模型特点:
- 特征保留 - 保留原图核心特征的同时添加创意元素
- 风格转换 - 将照片转化为独特的 Midjourney 艺术风格
- 灵活控制 - 通过权重参数控制原图影响程度
- 高质量输出 - V7 增强的纹理和细节表现
授权
请使用您的 API Token 进行认证
请求体
application/json
Task parameters
提示词(必填,最大2000字符)- 生成的文本描述
Required string length:
1 - 2000示例:
"Make it more colorful and vibrant"
宽高比(可选)- 输出宽高比
可用选项:
1:2, 9:16, 2:3, 3:4, 5:6, 6:5, 4:3, 3:2, 1:1, 16:9, 2:1 示例:
"16:9"
启用翻译(可选,默认 false)- 启用自动翻译
示例:
false
文件 URL 列表(可选)- 输入图片 URL 数组
示例:
["https://example.com/image.jpg"]
速度(可选)- API 生成速度
可用选项:
relaxed, fast, turbo 示例:
"relaxed"
风格化(可选,范围 0-1000)- 艺术风格强度
必填范围:
0 <= x <= 1000示例:
1
多样性(可选,范围 0-100,步长5)- 内容多样性
必填范围:
0 <= x <= 100示例:
10
版本(可选)- Midjourney 模型版本
可用选项:
7, 6.1, 6, 5.2, 5.1, niji6 示例:
"7"
水印(可选)- 水印标识
示例:
"my_watermark"
怪异度(可选,范围 0-3000)- 创意独特性
必填范围:
0 <= x <= 3000示例:
1
响应
OK
Task ID
示例:
"01234567-89ab-cdef-0123-456789abcdef"
⌘I