文本生成 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.*;
String payload = String.join("\n",
"{",
" \"prompt\": \"people\",",
" \"modelCount\": 1,",
" \"disablePbr\": 0,",
" \"onlyGenerateMesh\": false,",
" \"mesh_quality\": \"high\",",
" \"faceNum\": 1000000",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}`)
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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'JSON'
{
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""prompt"": ""people"",
""modelCount"": 1,
""disablePbr"": 0,
""onlyGenerateMesh"": false,
""mesh_quality"": ""high"",
""faceNum"": 1000000
}";
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(
payload,
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"
}
授权
请求体 application/json
- Option 1
- Option 2
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.*;
String payload = String.join("\n",
"{",
" \"prompt\": \"people\",",
" \"modelCount\": 1,",
" \"disablePbr\": 0,",
" \"onlyGenerateMesh\": false,",
" \"mesh_quality\": \"high\",",
" \"faceNum\": 1000000",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}`)
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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'JSON'
{
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""prompt"": ""people"",
""modelCount"": 1,
""disablePbr"": 0,
""onlyGenerateMesh"": false,
""mesh_quality"": ""high"",
""faceNum"": 1000000
}";
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(
payload,
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
请求参数无效。
身份认证失败。
{
"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.*;
String payload = String.join("\n",
"{",
" \"prompt\": \"people\",",
" \"modelCount\": 1,",
" \"disablePbr\": 0,",
" \"onlyGenerateMesh\": false,",
" \"mesh_quality\": \"high\",",
" \"faceNum\": 1000000",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}`)
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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'JSON'
{
"prompt": "people",
"modelCount": 1,
"disablePbr": 0,
"onlyGenerateMesh": false,
"mesh_quality": "high",
"faceNum": 1000000
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""prompt"": ""people"",
""modelCount"": 1,
""disablePbr"": 0,
""onlyGenerateMesh"": false,
""mesh_quality"": ""high"",
""faceNum"": 1000000
}";
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(
payload,
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"
}