文本生成 3D
文本生成模型
通过文本提示词生成 3D 模型。支持控制模型数量、网格质量、目标面数以及是否仅生成网格。未传新参数时保持原有默认行为。
POST
/
api
/
generateModelWithText
curl --request POST \
--url https://alb.neural4d.com:3000/api/generateModelWithText \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}
'
import requests
response = requests.request(
"POST",
"https://alb.neural4d.com:3000/api/generateModelWithText",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
},
)
print(response.json())
const response = await fetch("https://alb.neural4d.com:3000/api/generateModelWithText", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://alb.neural4d.com:3000/api/generateModelWithText", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}),
});
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/generateModelWithText"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"prompt\": \"people\",\n \"modelCount\": 1,\n \"disablePbr\": 0,\n \"onlyGenerateMesh\": false,\n \"mesh_quality\": \"high\",\n \"faceNum\": 1000000\n }"))
.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 := strings.NewReader("{\n \"prompt\": \"people\",\n \"modelCount\": 1,\n \"disablePbr\": 0,\n \"onlyGenerateMesh\": false,\n \"mesh_quality\": \"high\",\n \"faceNum\": 1000000\n}")
req, _ := http.NewRequest("POST", "https://alb.neural4d.com:3000/api/generateModelWithText", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
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/generateModelWithText")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}.to_json
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/generateModelWithText");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"prompt\": \"people\",\n \"modelCount\": 1,\n \"disablePbr\": 0,\n \"onlyGenerateMesh\": false,\n \"mesh_quality\": \"high\",\n \"faceNum\": 1000000\n}",
]);
$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/generateModelWithText");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"prompt\": \"people\",\n \"modelCount\": 1,\n \"disablePbr\": 0,\n \"onlyGenerateMesh\": false,\n \"mesh_quality\": \"high\",\n \"faceNum\": 1000000\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
{
"type": "sys",
"message": "Generating",
"uuids": [
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
],
"generationConfig": {
"faceNum": {
"default": 1000000,
"min": 500000,
"max": 1000000,
"value": 1000000
}
},
"uploadedImageUrl": null
}
{
"limitType": 3,
"message": "Please check the prompt."
}
{
"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": "Generation is not available for the current account"
}
{
"message": "Too many requests from this user, please try again after a minute."
}
{
"error": "Internal server error"
}
授权
string
默认值:"Bearer ${YOUR_API_KEY}"
必填
使用 Neural4D 网站提供的 Bearer token。
请求体 application/json
- Option 1
- Option 2
string
必填
用于生成 3D 模型的文本提示词。示例:
"people"。enum<string>
必填
标准网格质量。可选值:
standard。integer
默认值:4
生成模型的数量。取值范围:
1 <= x <= 4。enum<integer>
默认值:0
PBR 开关。使用
0 开启 PBR,使用 1 关闭 PBR。可选值:0、1。boolean
默认值:false
是否仅生成网格,不生成纹理或 PBR 输出。
integer
标准质量的目标面数。取值范围:
100000 <= x <= 500000。默认值:500000。curl --request POST \
--url https://alb.neural4d.com:3000/api/generateModelWithText \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}
'
import requests
response = requests.request(
"POST",
"https://alb.neural4d.com:3000/api/generateModelWithText",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
},
)
print(response.json())
const response = await fetch("https://alb.neural4d.com:3000/api/generateModelWithText", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://alb.neural4d.com:3000/api/generateModelWithText", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}),
});
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/generateModelWithText"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"prompt\": \"people\",\n \"modelCount\": 1,\n \"disablePbr\": 0,\n \"onlyGenerateMesh\": false,\n \"mesh_quality\": \"high\",\n \"faceNum\": 1000000\n }"))
.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 := strings.NewReader("{\n \"prompt\": \"people\",\n \"modelCount\": 1,\n \"disablePbr\": 0,\n \"onlyGenerateMesh\": false,\n \"mesh_quality\": \"high\",\n \"faceNum\": 1000000\n}")
req, _ := http.NewRequest("POST", "https://alb.neural4d.com:3000/api/generateModelWithText", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
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/generateModelWithText")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}.to_json
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/generateModelWithText");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"prompt\": \"people\",\n \"modelCount\": 1,\n \"disablePbr\": 0,\n \"onlyGenerateMesh\": false,\n \"mesh_quality\": \"high\",\n \"faceNum\": 1000000\n}",
]);
$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/generateModelWithText");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"prompt\": \"people\",\n \"modelCount\": 1,\n \"disablePbr\": 0,\n \"onlyGenerateMesh\": false,\n \"mesh_quality\": \"high\",\n \"faceNum\": 1000000\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
响应
- 200
- 400
- 401
- 402
- 403
- 429
- 500
生成任务已接受,或请求未通过内容审核。
- Option 1
- Option 2
enum<string>
必填
响应来源或类型标记。可选值:
sys。示例:"sys"。string
必填
生成状态消息。可选值:
Generating。示例:"Generating"。string<uuid>[]
必填
可在后续查询模型时使用的 UUID 列表。数组长度:
1 - 4 个元素。string<uri> | null
必填
纯文本生成时始终为 null。
integer | null
可用时返回本次请求扣除的点数。
object
本次生成请求实际采用的标准化面数配置。
请求参数无效。
身份认证失败。
{
"type": "sys",
"message": "Generating",
"uuids": [
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
],
"generationConfig": {
"faceNum": {
"default": 1000000,
"min": 500000,
"max": 1000000,
"value": 1000000
}
},
"uploadedImageUrl": null
}
{
"limitType": 3,
"message": "Please check the prompt."
}
{
"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": "Generation is not available for the current account"
}
{
"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/generateModelWithText \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}
'
import requests
response = requests.request(
"POST",
"https://alb.neural4d.com:3000/api/generateModelWithText",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
},
)
print(response.json())
const response = await fetch("https://alb.neural4d.com:3000/api/generateModelWithText", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://alb.neural4d.com:3000/api/generateModelWithText", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}),
});
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/generateModelWithText"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"prompt\": \"people\",\n \"modelCount\": 1,\n \"disablePbr\": 0,\n \"onlyGenerateMesh\": false,\n \"mesh_quality\": \"high\",\n \"faceNum\": 1000000\n }"))
.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 := strings.NewReader("{\n \"prompt\": \"people\",\n \"modelCount\": 1,\n \"disablePbr\": 0,\n \"onlyGenerateMesh\": false,\n \"mesh_quality\": \"high\",\n \"faceNum\": 1000000\n}")
req, _ := http.NewRequest("POST", "https://alb.neural4d.com:3000/api/generateModelWithText", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
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/generateModelWithText")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}.to_json
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/generateModelWithText");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"prompt\": \"people\",\n \"modelCount\": 1,\n \"disablePbr\": 0,\n \"onlyGenerateMesh\": false,\n \"mesh_quality\": \"high\",\n \"faceNum\": 1000000\n}",
]);
$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/generateModelWithText");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"prompt\": \"people\",\n \"modelCount\": 1,\n \"disablePbr\": 0,\n \"onlyGenerateMesh\": false,\n \"mesh_quality\": \"high\",\n \"faceNum\": 1000000\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
{
"type": "sys",
"message": "Generating",
"uuids": [
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
],
"generationConfig": {
"faceNum": {
"default": 1000000,
"min": 500000,
"max": 1000000,
"value": 1000000
}
},
"uploadedImageUrl": null
}
{
"limitType": 3,
"message": "Please check the prompt."
}
{
"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": "Generation is not available for the current account"
}
{
"message": "Too many requests from this user, please try again after a minute."
}
{
"error": "Internal server error"
}

