Skip to content

TRELLIS.2 mesh generation

sakalond edited this page Oct 28, 2026 · 3 revisions

With the TRELLIS.2 architecture, StableGen generates a 3D mesh from an image or a text prompt using Microsoft's TRELLIS.2 through the ComfyUI-TRELLIS2 custom node. It can then texture the mesh with TRELLIS.2's own texture model or with any diffusion architecture.

Install the node with package 8 of installer.py (see Installation). StableGen detects it by checking the server for the Trellis2ImageToShape node. If the node is missing, the generate button reads TRELLIS.2 nodes not found.

For a walkthrough, see Quick start.

Twelve assets generated with TRELLIS.2 and textured with Qwen Image 2.1: an inventor character, a log house, a windmill, a treasure chest, a market stall, a forge, a well, a hay cart, a pine tree, a lamp post, a rune obelisk and a stack of crates

Pipeline

A run has up to four phases:

  1. Input image. With Generate From set to Prompt, StableGen first generates an image from the prompt.
  2. Mesh. TRELLIS.2 removes the background, builds the shape and, in Native mode, the texture. StableGen downloads the result as a GLB, imports it and scales it to Import Scale (BU).
  3. Rigging. Optional; see Rigging and animation.
  4. Texturing. In a diffusion texture mode, StableGen places cameras around the new mesh and runs the selected texturing workflow.

Three phases of a prompt-to-asset run: the input image generated from the prompt, the untextured TRELLIS.2 mesh, and the mesh textured with Qwen Image 2.1

Input

Setting Purpose
Generate From Image builds the mesh from Input Image. Prompt generates the input image first.
Initial Image Architecture With Prompt and the None or Native texture mode, the architecture used to generate the input image. In diffusion texture modes, the texturing architecture is used.
Background Removal Auto (BiRefNet) removes the background; Skip (Use Alpha) uses the image's alpha channel.
Background Color Color placed behind transparent areas: Black, Gray or White.

The prompt and checkpoint for the input image are the normal texturing prompt and checkpoint. Enable Use separate texture prompt on the Texture page to texture with a different prompt.

Four input images and the meshes TRELLIS.2 builds from them: a cartoon fox, a panda, a sci-fi ammo crate and a brass automaton in a lace cape. Shapes, folds and the cape's open lattice come through; flat painted details stay for the texture

Preview gallery

With Generate From set to Prompt, enable Preview gallery to choose the input image before the mesh is built. StableGen generates Image count candidates (1 to 16, default 4) and shows them in the viewport. Click an image to continue with it, or click Generate More for another set. Cancel or Esc stops the run.

The candidates use seeds derived from the main Seed setting. With a seed of 0 they are random; otherwise the same seed gives the same candidates. The chosen image's seed is written back to Seed.

The preview gallery: four candidate input images generated from the prompt, numbered, with their seeds, and Generate More and Cancel below

Mesh settings

These are in the Mesh & Post-Processing section of the Mesh page.

Setting Default Purpose
Mesh generation resolution 1024 Cascade 512, 1024 Cascade or 1536 Cascade. Higher values give more geometric detail and use more time and memory.
Sparse voxel budget 49152 Token budget for the cascade modes.
Precision BF16 Auto, BF16, FP16 or FP32.
Attention Backend Auto Auto, Flash Attention, xFormers, SDPA or SageAttention.
Seed 0 TRELLIS.2 seed, separate from the image generation seed.
Structure guidance / steps 7.5 / 12 Sparse structure stage.
Shape guidance / steps 7.5 / 12 Shape stage.

One input image (a brass automaton in a lace cape) built at each Mesh generation resolution, raw output without post-processing, same seed: 512 (4.2M faces) is noisy and loses the cape's lace; 1024 Cascade (14.7M) is smoother; 1536 Cascade (35.2M) gives a crisp face and the cape's open lattice

Post-processing

Setting Default Purpose
Post-Processing On Enables the options below.
Decimation Method Server-Side QEM None (Raw), Server-Side QEM, or Collapse Decimate (Local) in Blender.
Remesh/Retopo Method QDC (Server) None (Trimesh), QDC (Server), or Quadriflow (Local) [Experimental].
Decimation Target 100000 Target face count.
Solidify Mesh Off Makes the mesh solid. Skipped when auto-rigging.

The 1024 Cascade automaton raw (14.7M faces, a dense voxel-stepped surface) and with the default post-processing, server-side decimation to 100k and QDC remesh (97k faces, a clean triangle mesh); the wireframe close-ups show the smoother surface and the fine neck mechanics it gives up

Run Local Post-Processing applies the local decimation and remeshing methods to the active mesh after import. Raise Mesh Generation Timeout in the preferences if server-side post-processing times out.

Import

Setting Default Purpose
Import Scale (BU) 2.0 Size of the imported mesh in Blender units. 0 keeps the original size.
Shading Flat Flat, Smooth or Auto Smooth.
Auto Studio Lighting On Adds a three-point light rig. Native texture mode only.

Texture modes

Texture mode is on the Texture page.

Mode Behavior
None Shape only. No texture is generated.
Native (TRELLIS.2) TRELLIS.2 generates PBR textures and bakes them to UV maps. Settings: Texture guidance, Texture steps and Texture size (px) (default 4096) in the Native Textures section. See the license note.
SDXL, Qwen Image Edit, Qwen Image 2.1 and the other texturing architectures The mesh is generated without texture, then textured by projection with the selected architecture, using the current texturing settings (workflow, sampling, blending and so on). The menu tags experimental and deprecated architectures; FLUX.1 and FLUX.2 Klein are listed only when deprecated architectures are enabled.

The automaton with Texture mode None (shape only) and Native (TRELLIS.2), both with the default post-processing: the native texture paints the brass body, the red neck cables and the cape's lace

Camera placement for diffusion texturing

The Camera Placement section on the Cameras page controls the cameras placed around the generated mesh. The options match Add Cameras; the defaults differ.

Setting Default
Import Scale (BU) 2. The generated mesh is scaled so its longest axis is this many Blender units; 0 keeps the original size.
Placement Mode Normal-Weighted
Camera Count 8 (2 to 32)
Camera coverage target, Max Cameras (Greedy) 0.95 and 12, used by Auto (Greedy Coverage)
Fan Angle 90°, used by Fan from Camera
Clamp Elevation Off. When on, avoids extreme top-down and bottom-up views.
Auto View Prompts On
Auto Aspect Ratio Per Camera
Occlusion Handling None (Fast)
Exclude Bottom Faces On
Consider Existing Cameras On
Delete Cameras After Off. When on, the placed cameras are deleted after texturing.

Batch generation from a folder

To generate one asset per image in a folder:

  1. Set Generate From to Image.
  2. Click the folder button next to Input Image and choose a folder. StableGen counts the .jpg, .jpeg, .png, .webp, .bmp, .tiff and .tif files in it. Subfolders are not searched.
  3. Optionally enable Name meshes after input files and Bake Textures after each model. Bake Settings sets the bake options for the batch.
  4. Click Generate Batch.

See Batch processing for how the results and log are stored.

Third-party licenses

This section applies only to the TRELLIS.2 feature. StableGen's standard texturing pipelines (SDXL, Qwen Image Edit, Qwen Image 2.1, the experimental architectures and the deprecated FLUX architectures) do not use any of the libraries listed below and are unaffected by these restrictions.

The TRELLIS.2 feature relies on several third-party components, each with its own license. Be aware of these licenses, particularly the non-commercial restrictions on the NVIDIA libraries used in the TRELLIS.2 native texture pipeline.

Component License Commercial use permitted
TRELLIS.2 (Microsoft) MIT Yes
TRELLIS.2-4B model weights MIT Yes
ComfyUI-TRELLIS2 MIT Yes
DINOv3 (Meta, image conditioning) DINOv3 License Yes
BiRefNet (background removal) MIT Yes
FlexGEMM (sparse convolutions) MIT Yes
CuMesh (mesh operations) MIT Yes
O-Voxel (voxel processing, part of TRELLIS.2) MIT Yes
nvdiffrast (NVIDIA) NVIDIA Source Code License No, non-commercial only
nvdiffrec (NVIDIA) NVIDIA Source Code License No, non-commercial only

The NVIDIA libraries nvdiffrast and nvdiffrec are used only when Texture mode is set to Native (TRELLIS.2), for UV rasterization and PBR texture baking. Their license restricts use to "research or evaluation purposes only and not for any direct or indirect monetary gain" (Section 3.3). Only NVIDIA and its affiliates may use these libraries commercially.

The other texture modes do not introduce these restrictions:

  • None (shape only) does not use nvdiffrast or nvdiffrec. All other pipeline components are permissively licensed (MIT or Apache 2.0, plus the DINOv3 License).
  • Projection-based texture modes (SDXL, Qwen Image Edit and the others) do not use nvdiffrast or nvdiffrec. The license terms of the selected diffusion model apply as usual; for example, Qwen Image 2.1 and FIBO 2.0 Edit are for non-commercial use only, independently of the TRELLIS.2 pipeline.

If you need to use the Native (TRELLIS.2) texture mode commercially, contact NVIDIA about commercial licensing for nvdiffrast and nvdiffrec.

Clone this wiki locally