TRELLIS.2

3D AI Studio

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.

Request
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
  }'
Response
{
  "task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "created_at": "2026-02-26T12:00:00Z"
}

Parameters

ParameterTypeRequiredDefaultDescription
imagestringConditionalBase64-encoded image (data:image/png;base64,...). Required if image_url is not provided.
image_urlstringConditionalURL to a publicly accessible image. Required if image is not provided.
resolutionstringNo"1024"Voxel grid resolution. Options: "512", "1024", "1536". Higher values produce finer geometric detail but take longer.
stepsintegerNo12Number of sampling steps per generation stage (1–50). Higher values improve quality with diminishing returns. 12 is recommended.
texturesbooleanNofalseWhen true, generates a GLB with full PBR materials (base color, roughness, metallic, opacity). When false, returns geometry only (faster).
texture_sizeintegerNo2048Texture map resolution. Options: 1024, 2048, 4096. Only applies when textures is true.
decimation_targetintegerNo1000000Target face count for mesh simplification (1,000–16,000,000). Lower values produce smaller files.
seedintegerNorandomRandom seed for reproducible generation. Omit for a random result.
generate_thumbnailbooleanNofalseWhen 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.

Request
// 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.

ResolutionDetail LevelBest ForApprox. Time
512GoodFast drafts, iteration, previews~20–25s
1024Great (recommended)Production assets, general use~30–50s
1536MaximumHero 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).

ModeOutputSpeedUse Case
textures: falseGeometry-only GLB (no materials)Fast (~15s export)Shape preview, custom texturing, 3D printing
textures: truePBR-textured GLB with UV mapsSlower (~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.

Request
curl https://api.3daistudio.com/v1/generation-request/YOUR_TASK_ID/status/ \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "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.

ResolutionGeometry OnlyTextured (1024)Textured (2048)Textured (4096)
51215 credits25 credits25 credits30 credits
102420 credits30 credits30 credits40 credits
153625 credits40 credits40 credits55 credits

Additional Credit Costs

OptionCreditsDescription
generate_thumbnail+2Renders 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:

Request
# 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.

StatusDescription
400Missing or invalid parameters (e.g., no image provided, invalid resolution).
401Invalid or missing API key.
402Insufficient credits. Top up your wallet.
429Rate limit exceeded. Wait and retry.
500Generation failed (GPU error, model error). Credits are refunded automatically.