TRELLIS.2
Generate high-fidelity 3D models with PBR materials from a single image using Microsoft's TRELLIS.2-4B model.
Generate 3D Model
POST/v1/3d-models/trellis2/generate/
Generates a 3D model (GLB) from a single input image. Supports geometry-only output for fast results, or full PBR-textured output with base color, roughness, metallic, and opacity maps. All generation is asynchronous — submit a request, receive a task ID, and poll for results.
curl -X POST https://api.3daistudio.com/v1/3d-models/trellis2/generate/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://example.com/my-object.png",
"resolution": "1024",
"textures": true,
"texture_size": 2048
}'{
"task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"created_at": "2026-02-26T12:00:00Z"
}Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| image | string | Conditional | — | Base64-encoded image (data:image/png;base64,...). Required if image_url is not provided. |
| image_url | string | Conditional | — | URL to a publicly accessible image. Required if image is not provided. |
| resolution | string | No | "1024" | Voxel grid resolution. Options: "512", "1024", "1536". Higher values produce finer geometric detail but take longer. |
| steps | integer | No | 12 | Number of sampling steps per generation stage (1–50). Higher values improve quality with diminishing returns. 12 is recommended. |
| textures | boolean | No | false | When true, generates a GLB with full PBR materials (base color, roughness, metallic, opacity). When false, returns geometry only (faster). |
| texture_size | integer | No | 2048 | Texture map resolution. Options: 1024, 2048, 4096. Only applies when textures is true. |
| decimation_target | integer | No | 1000000 | Target face count for mesh simplification (1,000–16,000,000). Lower values produce smaller files. |
| seed | integer | No | random | Random seed for reproducible generation. Omit for a random result. |
| generate_thumbnail | boolean | No | false | When true, renders a 400×400 thumbnail image of the generated model. Adds 2 credits. |
Image Input
Provide either a base64-encoded image or a public URL — not both. For best results, use an image with a clean background or a transparent (alpha-masked) foreground object. The model automatically removes backgrounds when needed, but pre-masked images produce better results. Supported formats: PNG, JPEG, WebP.
// Option A: Base64 image
{
"image": "data:image/png;base64,iVBORw0KGgo..."
}
// Option B: Image URL
{
"image_url": "https://example.com/my-object.png"
}Resolution Guide
Resolution controls the voxel grid density used during 3D generation. Higher resolutions capture finer geometric details but increase processing time.
| Resolution | Detail Level | Best For | Approx. Time |
|---|---|---|---|
| 512 | Good | Fast drafts, iteration, previews | ~20–25s |
| 1024 | Great (recommended) | Production assets, general use | ~30–50s |
| 1536 | Maximum | Hero assets, close-up renders | ~70–130s |
Geometry vs. Textured Output
Setting textures to false returns a clean, remeshed GLB with smooth geometry and vertex normals — no UV maps or materials. This is significantly faster and ideal for workflows where you apply your own textures downstream. Setting textures to true produces a fully UV-unwrapped GLB with baked PBR texture maps (base color, roughness, metallic, opacity).
| Mode | Output | Speed | Use Case |
|---|---|---|---|
| textures: false | Geometry-only GLB (no materials) | Fast (~15s export) | Shape preview, custom texturing, 3D printing |
| textures: true | PBR-textured GLB with UV maps | Slower (~40–70s export) | Production-ready assets, rendering, AR/VR |
Checking Status
GET/v1/generation-request/<task_id>/status/
Poll this endpoint with the task_id from the generation response. When status is "FINISHED", the results array contains your 3D model with a download URL. Results expire after 24 hours.
curl https://api.3daistudio.com/v1/generation-request/YOUR_TASK_ID/status/ \
-H "Authorization: Bearer YOUR_API_KEY"{
"status": "FINISHED",
"progress": 100,
"results": [
{
"asset_url": null,
"asset": "https://storage.3daistudio.com/assets/abc123.glb",
"asset_type": "3D_MODEL",
"thumbnail": "https://storage.3daistudio.com/thumbnails/abc123.png"
}
]
}Credit Costs
Credits are deducted when you submit a request. If generation fails, credits are refunded automatically. Costs vary by resolution, texture mode, and texture size.
| Resolution | Geometry Only | Textured (1024) | Textured (2048) | Textured (4096) |
|---|---|---|---|---|
| 512 | 15 credits | 25 credits | 25 credits | 30 credits |
| 1024 | 20 credits | 30 credits | 30 credits | 40 credits |
| 1536 | 25 credits | 40 credits | 40 credits | 55 credits |
Additional Credit Costs
| Option | Credits | Description |
|---|---|---|
| generate_thumbnail | +2 | Renders a 400×400 preview image of the generated 3D model. |
Full Example
Generate a high-quality textured 3D model at 1024 resolution with a thumbnail:
# Submit generation request (30 + 2 = 32 credits)
curl -X POST https://api.3daistudio.com/v1/3d-models/trellis2/generate/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://example.com/chair.png",
"resolution": "1024",
"textures": true,
"texture_size": 2048,
"generate_thumbnail": true
}'
# Poll until finished
curl https://api.3daistudio.com/v1/generation-request/TASK_ID/status/ \
-H "Authorization: Bearer YOUR_API_KEY"Processing Times
Processing typically takes 25–35 seconds for geometry-only output at 1024 resolution, or 50–70 seconds with PBR textures enabled. Higher resolutions (1536) may take up to 3–4 minutes with textures. Generating a thumbnail adds roughly 10 seconds. Processing times can vary depending on image complexity and the resulting mesh density. The first request after a period of inactivity may take an additional 30–60 seconds as the GPU model is loaded into memory. Subsequent requests within a few minutes will process immediately without this startup delay.
Errors
Common errors for TRELLIS.2 generation.
| Status | Description |
|---|---|
| 400 | Missing or invalid parameters (e.g., no image provided, invalid resolution). |
| 401 | Invalid or missing API key. |
| 402 | Insufficient credits. Top up your wallet. |
| 429 | Rate limit exceeded. Wait and retry. |
| 500 | Generation failed (GPU error, model error). Credits are refunded automatically. |