生成图片
curl --request POST \
--url https://alb.neural4d.com:3000/api/createNormalPicture \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'prompt=a beautiful flower' \
--form 'images[0]=(binary)' \
--form 'images[1]=(binary)' \
--form 'images[2]=(binary)' \
--form jobNum=2 \
--form modelKey=image-2 \
--form aspectRatio=4:3 \
--form images.items='@example-file'const form = new FormData();
form.append('prompt', 'a beautiful flower');
form.append('images[0]', '(binary)');
form.append('images[1]', '(binary)');
form.append('images[2]', '(binary)');
form.append('jobNum', '2');
form.append('modelKey', 'image-2');
form.append('aspectRatio', '4:3');
form.append('images.items', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://alb.neural4d.com:3000/api/createNormalPicture', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://alb.neural4d.com:3000/api/createNormalPicture"
files = { "images.items": ("example-file", open("example-file", "rb")) }
payload = {
"prompt": "a beautiful flower",
"images[0]": "(binary)",
"images[1]": "(binary)",
"images[2]": "(binary)",
"jobNum": "2",
"modelKey": "image-2",
"aspectRatio": "4:3"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text){
"success": true,
"data": {
"pointsDeducted": 26,
"queueStatus": "queued",
"jobNum": 2,
"uuids": [
"834d7e8c-bd70-48d8-9830-ca1ad9886e33",
"774bd78d-d14f-4531-8972-321086c92edu"
]
}
}图片与视频生成
生成图片
通过文本提示词生成图片,并可选上传参考图。单次请求最多可上传 6 张参考图,并提交 1 到 4 个生成任务。
POST
/
api
/
createNormalPicture
生成图片
curl --request POST \
--url https://alb.neural4d.com:3000/api/createNormalPicture \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'prompt=a beautiful flower' \
--form 'images[0]=(binary)' \
--form 'images[1]=(binary)' \
--form 'images[2]=(binary)' \
--form jobNum=2 \
--form modelKey=image-2 \
--form aspectRatio=4:3 \
--form images.items='@example-file'const form = new FormData();
form.append('prompt', 'a beautiful flower');
form.append('images[0]', '(binary)');
form.append('images[1]', '(binary)');
form.append('images[2]', '(binary)');
form.append('jobNum', '2');
form.append('modelKey', 'image-2');
form.append('aspectRatio', '4:3');
form.append('images.items', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://alb.neural4d.com:3000/api/createNormalPicture', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://alb.neural4d.com:3000/api/createNormalPicture"
files = { "images.items": ("example-file", open("example-file", "rb")) }
payload = {
"prompt": "a beautiful flower",
"images[0]": "(binary)",
"images[1]": "(binary)",
"images[2]": "(binary)",
"jobNum": "2",
"modelKey": "image-2",
"aspectRatio": "4:3"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text){
"success": true,
"data": {
"pointsDeducted": 26,
"queueStatus": "queued",
"jobNum": 2,
"uuids": [
"834d7e8c-bd70-48d8-9830-ca1ad9886e33",
"774bd78d-d14f-4531-8972-321086c92edu"
]
}
}授权
使用 Neural4D 网站提供的 Bearer token。
请求体
multipart/form-data
⌘I