# Trellis 2 — API Reference Model ID: `model_trellis-2` --- ## Authentication - **API_KEY** and **API_SECRET** are found in your [Scenario Project Settings](https://app.scenario.com/team&tab=project_api_keys) under API Keys. - Set them as environment variables `SCENARIO_SDK_API_KEY` and `SCENARIO_SDK_API_SECRET` — both SDKs pick them up by default. - For raw HTTP (cURL), use Basic Auth: `Authorization: Basic base64(":")`. ### Install the SDK - JavaScript / TypeScript: `npm install @scenario-labs/sdk` - Python: `pip install scenario-sdk` --- ## Generate **Endpoint:** `POST https://api.cloud.scenario.com/v1/generate/custom/model_trellis-2` ### Parameters | Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | `image` | assetId | yes | - | Input image to generate 3D asset from | | `resolution` | number | - | `1024` | Output resolution; higher is slower but more detailed | | `ssGuidanceStrength` | number | - | `8.5` | Stage 1: Sparse Structure Generation - Guidance | | `ssGuidanceRescale` | number | - | `0.7` | Stage 1: Sparse Structure Generation - Guidance Rescale | | `ssSamplingSteps` | number | - | `20` | Stage 1: Sparse Structure Generation - Steps | | `ssRescaleT` | number | - | `5` | Stage 1: Sparse Structure Generation - Rescale T | | `shapeSlatGuidanceStrength` | number | - | `7.5` | Stage 2: Shape Structured Latent Generation - Guidance | | `shapeSlatGuidanceRescale` | number | - | `0.5` | Stage 2: Shape Structured Latent Generation - Guidance Rescale | | `shapeSlatSamplingSteps` | number | - | `20` | Stage 2: Shape Structured Latent Generation - Steps | | `texSlatGuidanceStrength` | number | - | `2` | Stage 3: Texture Structured Latent Generation - Guidance | | `texSlatGuidanceRescale` | number | - | `0` | Stage 3: Texture Structured Latent Generation - Guidance | | `texSlatSamplingSteps` | number | - | `20` | Stage 3: Texture Structured Latent Generation - Steps | | `texSlatRescaleT` | number | - | `3` | Stage 3: Texture Structured Latent Generation - Rescale T | | `decimationTarget` | number | - | `500000` | Target number of faces for mesh decimation | | `textureSize` | number | - | `2048` | Texture size for the generated 3D model | | `remesh` | boolean | - | `true` | Enable remeshing | | `remeshBand` | number | - | `1` | Remesh band parameter | | `seed` | number | - | - | Use a seed for reproducible results. Leave blank to use a random seed. | ### Example Requests **cURL** ```bash curl -X POST "https://api.cloud.scenario.com/v1/generate/custom/model_trellis-2" \ -H "Authorization: Basic $(echo -n ':' | base64)" \ -H "Content-Type: application/json" \ --data-binary @- <<'EOF' { "image": "", "resolution": 1024, "ssGuidanceStrength": 8.5, "ssGuidanceRescale": 0.7, "ssSamplingSteps": 20, "ssRescaleT": 5, "shapeSlatGuidanceStrength": 7.5, "shapeSlatGuidanceRescale": 0.5, "shapeSlatSamplingSteps": 20, "texSlatGuidanceStrength": 2, "texSlatGuidanceRescale": 0, "texSlatSamplingSteps": 20, "texSlatRescaleT": 3, "decimationTarget": 500000, "textureSize": 2048, "remesh": true, "remeshBand": 1 } EOF ``` **Python** ```python import os from scenario_sdk import Scenario client = Scenario( api_key=os.environ.get("SCENARIO_SDK_API_KEY"), api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"), ) body = { "image": "", "resolution": 1024, "ssGuidanceStrength": 8.5, "ssGuidanceRescale": 0.7, "ssSamplingSteps": 20, "ssRescaleT": 5, "shapeSlatGuidanceStrength": 7.5, "shapeSlatGuidanceRescale": 0.5, "shapeSlatSamplingSteps": 20, "texSlatGuidanceStrength": 2, "texSlatGuidanceRescale": 0, "texSlatSamplingSteps": 20, "texSlatRescaleT": 3, "decimationTarget": 500000, "textureSize": 2048, "remesh": True, "remeshBand": 1 } response = client.generate.run_model( model_id="model_trellis-2", body=body, ) print(response) ``` **JavaScript** ```javascript import Scenario from "@scenario-labs/sdk"; const client = new Scenario({ apiKey: process.env["SCENARIO_SDK_API_KEY"], apiSecret: process.env["SCENARIO_SDK_API_SECRET"], }); const body = { "image": "", "resolution": 1024, "ssGuidanceStrength": 8.5, "ssGuidanceRescale": 0.7, "ssSamplingSteps": 20, "ssRescaleT": 5, "shapeSlatGuidanceStrength": 7.5, "shapeSlatGuidanceRescale": 0.5, "shapeSlatSamplingSteps": 20, "texSlatGuidanceStrength": 2, "texSlatGuidanceRescale": 0, "texSlatSamplingSteps": 20, "texSlatRescaleT": 3, "decimationTarget": 500000, "textureSize": 2048, "remesh": true, "remeshBand": 1 }; const response = await client.generate.runModel("model_trellis-2", { body }); console.info(response); ``` --- ## Retrieve Results After submitting a generation request, you receive a `jobId`. Poll the job until `job.status` is `"success"`. The generated asset IDs are in `job.metadata.assetIds`. **Endpoint:** `GET https://api.cloud.scenario.com/v1/jobs/{jobId}` ### Example Requests **cURL** ```bash curl -X GET "https://api.cloud.scenario.com/v1/jobs/" \ -H "Authorization: Basic $(echo -n ':' | base64)" ``` **Python** ```python job = client.jobs.retrieve(job_id="") print(job.status) print(job.metadata.asset_ids) ``` **JavaScript** ```javascript // Option 1 — wait on the response from runModel using the SDK helper const completed = await response.job.wait(); console.info(completed.status); console.info(completed.metadata?.assetIds); // Option 2 — retrieve a job by its ID const job = await client.jobs.retrieve(""); console.info(job.status); console.info(job.metadata?.assetIds); ``` **Example response:** ```json { "job": { "jobId": "job_abc123", "status": "success", "metadata": { "assetIds": [ "asset_abc123" ] } } } ``` > **Important:** Generated asset URLs are **temporary** and expire after a short period. Download and store any images you wish to keep before the URL expires. More info: [Content Delivery Network (CDN)](https://docs.scenario.com/get-started/documentation/content-delivery-network-cdn). --- *Generated by [Scenario](https://app.scenario.com)*