Image to 3D
Generate model with image
Generate 3D models from one uploaded image. Supports model count, mesh quality, target face count, and mesh-only output. Existing defaults are preserved when the new options are omitted.
POST
/
api
/
generateModelWithImage
curl --request POST \
--url https://alb.neural4d.com:3000/api/generateModelWithImage \
--header 'Authorization: Bearer <token>' \
--form 'image=@/path/to/file' \
--form 'modelCount=1' \
--form 'disablePbr=0' \
--form 'onlyGenerateMesh=false' \
--form 'mesh_quality=high' \
--form 'faceNum=1000000'
import requests
response = requests.request(
"POST",
"https://alb.neural4d.com:3000/api/generateModelWithImage",
headers={
"Authorization": "Bearer <token>",
},
files={"image": open('/path/to/file', 'rb')},
)
print(response.json())
const response = await fetch("https://alb.neural4d.com:3000/api/generateModelWithImage", {
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/generateModelWithImage", {
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/generateModelWithImage"))
.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/generateModelWithImage", 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/generateModelWithImage")
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/generateModelWithImage");
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/generateModelWithImage");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
{
"type": "sys",
"message": "Generating",
"uuids": [
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
],
"uploadedImageUrl": "https://s3.neural4d.com/example.png?sign=xxx.png",
"generationConfig": {
"faceNum": {
"default": 1000000,
"min": 500000,
"max": 1000000,
"value": 1000000
}
}
}
{
"limitType": 3,
"message": "Please check the image."
}
{
"errors": [
{
"type": "field",
"value": 5,
"msg": "modelCount must be an integer between 1 and 4 (inclusive)",
"path": "modelCount",
"location": "body"
}
]
}
"Unauthorized"
{
"message": "Insufficient points or account restricted"
}
{
"message": "Too many requests from this user, please try again after a minute."
}
{
"error": "Internal server error"
}
Authorizations
string
default:"Bearer ${YOUR_API_KEY}"
required
Use the bearer token provided through the Neural4D website.
Body multipart/form-data
- Option 1
- Option 2
string<binary>
required
Required input file. The multipart part must use an
image/* content type and must not exceed 50 MB.enum<string>
required
Standard mesh quality.Available options:
standard.integer
default:4
Number of models to generate.Required range:
1 <= x <= 4.enum<integer>
default:0
PBR toggle. Use
0 to enable PBR and 1 to disable it.Available options: 0, 1.boolean
default:false
Whether to generate only the mesh, without texture or PBR output.
boolean
default:false
Image enhancement is in beta. Contact customer service for access.
integer
Target face count for standard quality.Required range:
100000 <= x <= 500000.Default: 500000.string<binary>
required
Required input file. The multipart part must use an
image/* content type and must not exceed 50 MB.enum<string>
default:"high"
High or extra-high mesh quality.Available options:
high, extra_high.This branch also applies when the field is omitted.integer
default:4
Number of models to generate.Required range:
1 <= x <= 4.enum<integer>
default:0
PBR toggle. Use
0 to enable PBR and 1 to disable it.Available options: 0, 1.boolean
default:false
Whether to generate only the mesh, without texture or PBR output.
boolean
default:false
Image enhancement is in beta. Contact customer service for access.
integer
Target face count for high or extra-high quality.Required range:
500000 <= x <= 1000000.Default: 1000000.curl --request POST \
--url https://alb.neural4d.com:3000/api/generateModelWithImage \
--header 'Authorization: Bearer <token>' \
--form 'image=@/path/to/file' \
--form 'modelCount=1' \
--form 'disablePbr=0' \
--form 'onlyGenerateMesh=false' \
--form 'mesh_quality=high' \
--form 'faceNum=1000000'
import requests
response = requests.request(
"POST",
"https://alb.neural4d.com:3000/api/generateModelWithImage",
headers={
"Authorization": "Bearer <token>",
},
files={"image": open('/path/to/file', 'rb')},
)
print(response.json())
const response = await fetch("https://alb.neural4d.com:3000/api/generateModelWithImage", {
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/generateModelWithImage", {
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/generateModelWithImage"))
.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/generateModelWithImage", 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/generateModelWithImage")
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/generateModelWithImage");
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/generateModelWithImage");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
- 200
- 400
- 401
- 402
- 429
- 500
Generation job accepted, or the request was rejected by content moderation.
- Option 1
- Option 2
enum<string>
required
Response source or type marker.Available options:
sys.Example: "sys".string
required
Generation status message.Available options:
Generating.string<uuid>[]
required
UUIDs that can be used to retrieve the generated models.Allowed array length:
1 - 4 elements.string<uri> | null
required
Signed URL for the uploaded source image, or null when unavailable.
integer | null
Credits deducted when the value is available.
object
Normalized face-count configuration applied to this generation request.
Show child attributes
Show child attributes
Face-count limits and the normalized value applied to the generation task.
Show child attributes
Show child attributes
Default face count for the selected mesh quality.
Minimum face count for the selected mesh quality.
Maximum face count for the selected mesh quality.
Normalized face count applied to the generation task.
Invalid request parameter or image file.
object[]
required
Request validation errors.
Show child attributes
Show child attributes
Human-readable validation error message.
Request field that failed validation.
Request location containing the invalid field.
Validation error category.
Rejected request value when it is available.
Authentication failed.
The request was blocked by an account, IP, or credit restriction.
string
Human-readable API error message.
string
Internal or downstream error description when available.
Rate limit exceeded.
string
Human-readable API error message.
string
Internal or downstream error description when available.
{
"type": "sys",
"message": "Generating",
"uuids": [
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
],
"uploadedImageUrl": "https://s3.neural4d.com/example.png?sign=xxx.png",
"generationConfig": {
"faceNum": {
"default": 1000000,
"min": 500000,
"max": 1000000,
"value": 1000000
}
}
}
{
"limitType": 3,
"message": "Please check the image."
}
{
"errors": [
{
"type": "field",
"value": 5,
"msg": "modelCount must be an integer between 1 and 4 (inclusive)",
"path": "modelCount",
"location": "body"
}
]
}
"Unauthorized"
{
"message": "Insufficient points or account restricted"
}
{
"message": "Too many requests from this user, please try again after a minute."
}
{
"error": "Internal server error"
}
⌘I
curl --request POST \
--url https://alb.neural4d.com:3000/api/generateModelWithImage \
--header 'Authorization: Bearer <token>' \
--form 'image=@/path/to/file' \
--form 'modelCount=1' \
--form 'disablePbr=0' \
--form 'onlyGenerateMesh=false' \
--form 'mesh_quality=high' \
--form 'faceNum=1000000'
import requests
response = requests.request(
"POST",
"https://alb.neural4d.com:3000/api/generateModelWithImage",
headers={
"Authorization": "Bearer <token>",
},
files={"image": open('/path/to/file', 'rb')},
)
print(response.json())
const response = await fetch("https://alb.neural4d.com:3000/api/generateModelWithImage", {
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/generateModelWithImage", {
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/generateModelWithImage"))
.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/generateModelWithImage", 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/generateModelWithImage")
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/generateModelWithImage");
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/generateModelWithImage");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
{
"type": "sys",
"message": "Generating",
"uuids": [
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
],
"uploadedImageUrl": "https://s3.neural4d.com/example.png?sign=xxx.png",
"generationConfig": {
"faceNum": {
"default": 1000000,
"min": 500000,
"max": 1000000,
"value": 1000000
}
}
}
{
"limitType": 3,
"message": "Please check the image."
}
{
"errors": [
{
"type": "field",
"value": 5,
"msg": "modelCount must be an integer between 1 and 4 (inclusive)",
"path": "modelCount",
"location": "body"
}
]
}
"Unauthorized"
{
"message": "Insufficient points or account restricted"
}
{
"message": "Too many requests from this user, please try again after a minute."
}
{
"error": "Internal server error"
}

