Picture and video generation
Generate picture
Generate images from a text prompt with optional reference images. You can upload up to 6 reference images and submit 1 to 4 generation jobs in a single request.
POST
/
api
/
createNormalPicture
curl --request POST \
--url https://alb.neural4d.com:3000/api/createNormalPicture \
--header 'Authorization: Bearer <token>' \
--form 'prompt=a beautiful flower' \
--form 'images=@/path/to/file' \
--form 'images=@/path/to/file' \
--form 'images=@/path/to/file' \
--form 'jobNum=2' \
--form 'modelKey=image-2' \
--form 'aspectRatio=4:3'
import requests
response = requests.request(
"POST",
"https://alb.neural4d.com:3000/api/createNormalPicture",
headers={
"Authorization": "Bearer <token>",
},
files={"images": open('/path/to/file', 'rb'), "images": open('/path/to/file', 'rb'), "images": open('/path/to/file', 'rb')},
)
print(response.json())
const response = await fetch("https://alb.neural4d.com:3000/api/createNormalPicture", {
method: "POST",
headers: {
"Authorization": "Bearer <token>"
},
body: (() => { const form = new FormData(); form.append("file", fileInput.files[0]); return form; })(),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://alb.neural4d.com:3000/api/createNormalPicture", {
method: "POST",
headers: {
"Authorization": "Bearer <token>"
},
body: (() => { const form = new FormData(); form.append("file", fileInput.files[0]); return form; })(),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://alb.neural4d.com:3000/api/createNormalPicture"))
.header("Authorization", "Bearer <token>")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := nil
req, _ := http.NewRequest("POST", "https://alb.neural4d.com:3000/api/createNormalPicture", payload)
req.Header.Set("Authorization", "Bearer <token>")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://alb.neural4d.com:3000/api/createNormalPicture")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://alb.neural4d.com:3000/api/createNormalPicture");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>"],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://alb.neural4d.com:3000/api/createNormalPicture");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
{
"success": true,
"data": {
"pointsDeducted": 26,
"queueStatus": "queued",
"jobNum": 2,
"uuids": [
"834d7e8c-bd70-48d8-9830-ca1ad9886e33",
"774bd78d-d14f-4531-8972-321086c92edu"
]
}
}
Authorizations
string
default:"Bearer ${YOUR_API_KEY}"
required
Use the bearer token provided through the Neural4D website.
Body multipart/form-data
string
required
Text prompt describing the desired generated image.
string<binary>[]
Optional reference images used to guide generation.Allowed array length:
0 - 6 elements.enum<string>
default:"image-2"
Image generation model key.Available options:
image-2, nano_banana_pro.enum<string>
default:"1:1"
Target aspect ratio for the generated images.Available options:
1:1, 16:9, 9:16, 4:3, 3:4.integer
default:1
Number of generation jobs to submit.Required range:
1 <= x <= 4.curl --request POST \
--url https://alb.neural4d.com:3000/api/createNormalPicture \
--header 'Authorization: Bearer <token>' \
--form 'prompt=a beautiful flower' \
--form 'images=@/path/to/file' \
--form 'images=@/path/to/file' \
--form 'images=@/path/to/file' \
--form 'jobNum=2' \
--form 'modelKey=image-2' \
--form 'aspectRatio=4:3'
import requests
response = requests.request(
"POST",
"https://alb.neural4d.com:3000/api/createNormalPicture",
headers={
"Authorization": "Bearer <token>",
},
files={"images": open('/path/to/file', 'rb'), "images": open('/path/to/file', 'rb'), "images": open('/path/to/file', 'rb')},
)
print(response.json())
const response = await fetch("https://alb.neural4d.com:3000/api/createNormalPicture", {
method: "POST",
headers: {
"Authorization": "Bearer <token>"
},
body: (() => { const form = new FormData(); form.append("file", fileInput.files[0]); return form; })(),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://alb.neural4d.com:3000/api/createNormalPicture", {
method: "POST",
headers: {
"Authorization": "Bearer <token>"
},
body: (() => { const form = new FormData(); form.append("file", fileInput.files[0]); return form; })(),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://alb.neural4d.com:3000/api/createNormalPicture"))
.header("Authorization", "Bearer <token>")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := nil
req, _ := http.NewRequest("POST", "https://alb.neural4d.com:3000/api/createNormalPicture", payload)
req.Header.Set("Authorization", "Bearer <token>")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://alb.neural4d.com:3000/api/createNormalPicture")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://alb.neural4d.com:3000/api/createNormalPicture");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>"],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://alb.neural4d.com:3000/api/createNormalPicture");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
- 200
Picture generation job accepted
boolean
required
Whether the generation request was accepted.
object
required
Queue and task details for the accepted generation request.
{
"success": true,
"data": {
"pointsDeducted": 26,
"queueStatus": "queued",
"jobNum": 2,
"uuids": [
"834d7e8c-bd70-48d8-9830-ca1ad9886e33",
"774bd78d-d14f-4531-8972-321086c92edu"
]
}
}
⌘I
curl --request POST \
--url https://alb.neural4d.com:3000/api/createNormalPicture \
--header 'Authorization: Bearer <token>' \
--form 'prompt=a beautiful flower' \
--form 'images=@/path/to/file' \
--form 'images=@/path/to/file' \
--form 'images=@/path/to/file' \
--form 'jobNum=2' \
--form 'modelKey=image-2' \
--form 'aspectRatio=4:3'
import requests
response = requests.request(
"POST",
"https://alb.neural4d.com:3000/api/createNormalPicture",
headers={
"Authorization": "Bearer <token>",
},
files={"images": open('/path/to/file', 'rb'), "images": open('/path/to/file', 'rb'), "images": open('/path/to/file', 'rb')},
)
print(response.json())
const response = await fetch("https://alb.neural4d.com:3000/api/createNormalPicture", {
method: "POST",
headers: {
"Authorization": "Bearer <token>"
},
body: (() => { const form = new FormData(); form.append("file", fileInput.files[0]); return form; })(),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://alb.neural4d.com:3000/api/createNormalPicture", {
method: "POST",
headers: {
"Authorization": "Bearer <token>"
},
body: (() => { const form = new FormData(); form.append("file", fileInput.files[0]); return form; })(),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://alb.neural4d.com:3000/api/createNormalPicture"))
.header("Authorization", "Bearer <token>")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := nil
req, _ := http.NewRequest("POST", "https://alb.neural4d.com:3000/api/createNormalPicture", payload)
req.Header.Set("Authorization", "Bearer <token>")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://alb.neural4d.com:3000/api/createNormalPicture")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://alb.neural4d.com:3000/api/createNormalPicture");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>"],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://alb.neural4d.com:3000/api/createNormalPicture");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
{
"success": true,
"data": {
"pointsDeducted": 26,
"queueStatus": "queued",
"jobNum": 2,
"uuids": [
"834d7e8c-bd70-48d8-9830-ca1ad9886e33",
"774bd78d-d14f-4531-8972-321086c92edu"
]
}
}

