生成图片融合示例
curl --request POST \
--url https://api.maxapi.ai/api/v1/images/neuralstyle/generate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"source_img": "https://cdn.mewx.art/images/static/example/01fc751b-5262-4164-b639-0fc529378ab8.jpg",
"cn_list": [
{
"type": 1,
"weight": 60,
"guidance_start": 0,
"guidance_end": 1
}
],
"style_img": "https://cdn.mewx.art/images/static/example/a9385171-4c6f-45ed-94d0-138102d4c8d2.jpg",
"engine": 1,
"source_mode": 1,
"type": "neuralstyle",
"callback_url": "http://127.0.0.1:3000"
}
'import requests
url = "https://api.maxapi.ai/api/v1/images/neuralstyle/generate"
payload = {
"source_img": "https://cdn.mewx.art/images/static/example/01fc751b-5262-4164-b639-0fc529378ab8.jpg",
"cn_list": [
{
"type": 1,
"weight": 60,
"guidance_start": 0,
"guidance_end": 1
}
],
"style_img": "https://cdn.mewx.art/images/static/example/a9385171-4c6f-45ed-94d0-138102d4c8d2.jpg",
"engine": 1,
"source_mode": 1,
"type": "neuralstyle",
"callback_url": "http://127.0.0.1:3000"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
source_img: 'https://cdn.mewx.art/images/static/example/01fc751b-5262-4164-b639-0fc529378ab8.jpg',
cn_list: [{type: 1, weight: 60, guidance_start: 0, guidance_end: 1}],
style_img: 'https://cdn.mewx.art/images/static/example/a9385171-4c6f-45ed-94d0-138102d4c8d2.jpg',
engine: 1,
source_mode: 1,
type: 'neuralstyle',
callback_url: 'http://127.0.0.1:3000'
})
};
fetch('https://api.maxapi.ai/api/v1/images/neuralstyle/generate', 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://api.maxapi.ai/api/v1/images/neuralstyle/generate"
payload := strings.NewReader("{\n \"source_img\": \"https://cdn.mewx.art/images/static/example/01fc751b-5262-4164-b639-0fc529378ab8.jpg\",\n \"cn_list\": [\n {\n \"type\": 1,\n \"weight\": 60,\n \"guidance_start\": 0,\n \"guidance_end\": 1\n }\n ],\n \"style_img\": \"https://cdn.mewx.art/images/static/example/a9385171-4c6f-45ed-94d0-138102d4c8d2.jpg\",\n \"engine\": 1,\n \"source_mode\": 1,\n \"type\": \"neuralstyle\",\n \"callback_url\": \"http://127.0.0.1:3000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.maxapi.ai/api/v1/images/neuralstyle/generate")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"source_img\": \"https://cdn.mewx.art/images/static/example/01fc751b-5262-4164-b639-0fc529378ab8.jpg\",\n \"cn_list\": [\n {\n \"type\": 1,\n \"weight\": 60,\n \"guidance_start\": 0,\n \"guidance_end\": 1\n }\n ],\n \"style_img\": \"https://cdn.mewx.art/images/static/example/a9385171-4c6f-45ed-94d0-138102d4c8d2.jpg\",\n \"engine\": 1,\n \"source_mode\": 1,\n \"type\": \"neuralstyle\",\n \"callback_url\": \"http://127.0.0.1:3000\"\n}")
.asString();{
"code": 0,
"msg": "成功",
"data": {
"img_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}POST
https://api.maxapi.ai
/
api
/
v1
/
images
/
neuralstyle
/
generate
生成图片融合示例
curl --request POST \
--url https://api.maxapi.ai/api/v1/images/neuralstyle/generate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"source_img": "https://cdn.mewx.art/images/static/example/01fc751b-5262-4164-b639-0fc529378ab8.jpg",
"cn_list": [
{
"type": 1,
"weight": 60,
"guidance_start": 0,
"guidance_end": 1
}
],
"style_img": "https://cdn.mewx.art/images/static/example/a9385171-4c6f-45ed-94d0-138102d4c8d2.jpg",
"engine": 1,
"source_mode": 1,
"type": "neuralstyle",
"callback_url": "http://127.0.0.1:3000"
}
'import requests
url = "https://api.maxapi.ai/api/v1/images/neuralstyle/generate"
payload = {
"source_img": "https://cdn.mewx.art/images/static/example/01fc751b-5262-4164-b639-0fc529378ab8.jpg",
"cn_list": [
{
"type": 1,
"weight": 60,
"guidance_start": 0,
"guidance_end": 1
}
],
"style_img": "https://cdn.mewx.art/images/static/example/a9385171-4c6f-45ed-94d0-138102d4c8d2.jpg",
"engine": 1,
"source_mode": 1,
"type": "neuralstyle",
"callback_url": "http://127.0.0.1:3000"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
source_img: 'https://cdn.mewx.art/images/static/example/01fc751b-5262-4164-b639-0fc529378ab8.jpg',
cn_list: [{type: 1, weight: 60, guidance_start: 0, guidance_end: 1}],
style_img: 'https://cdn.mewx.art/images/static/example/a9385171-4c6f-45ed-94d0-138102d4c8d2.jpg',
engine: 1,
source_mode: 1,
type: 'neuralstyle',
callback_url: 'http://127.0.0.1:3000'
})
};
fetch('https://api.maxapi.ai/api/v1/images/neuralstyle/generate', 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://api.maxapi.ai/api/v1/images/neuralstyle/generate"
payload := strings.NewReader("{\n \"source_img\": \"https://cdn.mewx.art/images/static/example/01fc751b-5262-4164-b639-0fc529378ab8.jpg\",\n \"cn_list\": [\n {\n \"type\": 1,\n \"weight\": 60,\n \"guidance_start\": 0,\n \"guidance_end\": 1\n }\n ],\n \"style_img\": \"https://cdn.mewx.art/images/static/example/a9385171-4c6f-45ed-94d0-138102d4c8d2.jpg\",\n \"engine\": 1,\n \"source_mode\": 1,\n \"type\": \"neuralstyle\",\n \"callback_url\": \"http://127.0.0.1:3000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.maxapi.ai/api/v1/images/neuralstyle/generate")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"source_img\": \"https://cdn.mewx.art/images/static/example/01fc751b-5262-4164-b639-0fc529378ab8.jpg\",\n \"cn_list\": [\n {\n \"type\": 1,\n \"weight\": 60,\n \"guidance_start\": 0,\n \"guidance_end\": 1\n }\n ],\n \"style_img\": \"https://cdn.mewx.art/images/static/example/a9385171-4c6f-45ed-94d0-138102d4c8d2.jpg\",\n \"engine\": 1,\n \"source_mode\": 1,\n \"type\": \"neuralstyle\",\n \"callback_url\": \"http://127.0.0.1:3000\"\n}")
.asString();{
"code": 0,
"msg": "成功",
"data": {
"img_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}请求体
application/json