Image to 3D
Generate chibi-style model with image
Generate chibi-style 3D character models from uploaded images and a configured style tag. This operation consumes 30 points. The style tag must be configured in advance.
POST
/
api
/
createCuteModelsFromImages
Generate chibi-style model with image
curl --request POST \
--url https://alb.neural4d.com:3000/api/createCuteModelsFromImages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'images=(binary)' \
--form styleType=Pixel-Style \
--form images.items='@example-file'const form = new FormData();
form.append('images', '(binary)');
form.append('styleType', 'Pixel-Style');
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/createCuteModelsFromImages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://alb.neural4d.com:3000/api/createCuteModelsFromImages"
files = { "images.items": ("example-file", open("example-file", "rb")) }
payload = {
"images": "(binary)",
"styleType": "Pixel-Style"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)import fs from 'fs';
const formData = new FormData();
formData.append('images', '(binary)');
formData.append('styleType', 'Pixel-Style');
formData.append('images.items', await new Response(fs.createReadStream('example-file')).blob());
const url = 'https://alb.neural4d.com:3000/api/createCuteModelsFromImages';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}, body: formData};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));const form = new FormData();
form.append('images', '(binary)');
form.append('styleType', 'Pixel-Style');
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/createCuteModelsFromImages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://alb.neural4d.com:3000/api/createCuteModelsFromImages"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"styleType\"\r\n\r\nPixel-Style\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://alb.neural4d.com:3000/api/createCuteModelsFromImages")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"styleType\"\r\n\r\nPixel-Style\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();using RestSharp;
var options = new RestClientOptions("https://alb.neural4d.com:3000/api/createCuteModelsFromImages");
var client = new RestClient(options);
var request = new RestRequest("");
request.AlwaysMultipartFormData = true;
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("images", "(binary)");
request.AddParameter("styleType", "Pixel-Style");
request.AddFile("images.items", "example-file");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "https://alb.neural4d.com:3000/api/createCuteModelsFromImages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"styleType\"\r\n\r\nPixel-Style\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"totalFiles": 1,
"successCount": 1,
"failureCount": 0,
"results": [
{
"uuids": [
"31f15c88-48ae"
],
"success": true,
"message": "Task created and model generation started, please retrieve model after a moment"
}
],
"failures": [],
"message": "Processed 1 files: 1 succeeded, 0 failed"
}Authorizations
Use the bearer token provided through the Neural4D website.
Body
multipart/form-data
Response
200 - application/json
Batch create result
Whether the batch request was processed successfully.
Total number of uploaded input files.
Number of input files queued successfully.
Number of input files that failed to queue.
Successful queue results for each processed input file.
Show child attributes
Show child attributes
Failure details for input files that could not be queued.
Human-readable summary of the batch operation.
Previous
Generate pictureGenerate 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.
Next
⌘I
Generate chibi-style model with image
curl --request POST \
--url https://alb.neural4d.com:3000/api/createCuteModelsFromImages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'images=(binary)' \
--form styleType=Pixel-Style \
--form images.items='@example-file'const form = new FormData();
form.append('images', '(binary)');
form.append('styleType', 'Pixel-Style');
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/createCuteModelsFromImages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://alb.neural4d.com:3000/api/createCuteModelsFromImages"
files = { "images.items": ("example-file", open("example-file", "rb")) }
payload = {
"images": "(binary)",
"styleType": "Pixel-Style"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)import fs from 'fs';
const formData = new FormData();
formData.append('images', '(binary)');
formData.append('styleType', 'Pixel-Style');
formData.append('images.items', await new Response(fs.createReadStream('example-file')).blob());
const url = 'https://alb.neural4d.com:3000/api/createCuteModelsFromImages';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}, body: formData};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));const form = new FormData();
form.append('images', '(binary)');
form.append('styleType', 'Pixel-Style');
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/createCuteModelsFromImages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://alb.neural4d.com:3000/api/createCuteModelsFromImages"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"styleType\"\r\n\r\nPixel-Style\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://alb.neural4d.com:3000/api/createCuteModelsFromImages")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"styleType\"\r\n\r\nPixel-Style\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();using RestSharp;
var options = new RestClientOptions("https://alb.neural4d.com:3000/api/createCuteModelsFromImages");
var client = new RestClient(options);
var request = new RestRequest("");
request.AlwaysMultipartFormData = true;
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("images", "(binary)");
request.AddParameter("styleType", "Pixel-Style");
request.AddFile("images.items", "example-file");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "https://alb.neural4d.com:3000/api/createCuteModelsFromImages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n(binary)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"styleType\"\r\n\r\nPixel-Style\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"totalFiles": 1,
"successCount": 1,
"failureCount": 0,
"results": [
{
"uuids": [
"31f15c88-48ae"
],
"success": true,
"message": "Task created and model generation started, please retrieve model after a moment"
}
],
"failures": [],
"message": "Processed 1 files: 1 succeeded, 0 failed"
}
