Mesh Renderer (3D to Image)
The nvdiffrast renderer with five looks
- mesh
- camera_trajectory
- background_color
- rendered_image
MeshRenderer is where a TRELLIS mesh stops being a data blob and becomes something you can actually look at. Feed it a TRELLIS_MESH (from Trellis2Predict) plus a CAMERA_TRAJECTORY (from CameraTrajectory_T2), and it renders the mesh from that viewpoint to a standard ComfyUI image - the thing you can preview, save, or feed into an upscaler.
It's the node that makes the whole pack feel like magic on the single-image path. LoadImage → Trellis2Predict → MeshRenderer → SaveImage, with a CameraTrajectory feeding the middle - that's the pack's own single_image_novel_view.json workflow, and it's the fastest way to see what you're building.
How it works
Rendering is done with nvdiffrast, NVIDIA's differentiable CUDA rasterizer - the same workhorse the TRELLIS pipeline itself uses, which is why this pack leans on it. The node builds the camera's MVP matrix from your trajectory, rasterizes the mesh's triangles, interpolates vertex attributes (normals, colors, textures) across the surface, and shades the result.
The clever bit is the five render modes, all implemented right in the node:
- pbr - full lighting pass using the mesh's PBR data and one of four lighting presets (studio, outdoor, dramatic, flat). Studio is the default and it's the look you'll want for a product shot;
flatis what you want before cel shading. - wireframe - edge visualization, great for checking topology or that low-poly aesthetic. Triangles only, white-on-background.
- cel - quantized shading with a clean toon look, computed straight from light intensity bands.
- normal - RGB-encoded surface normals, the texture-baker's friend.
- depth - normalized grayscale depth map.
The node also auto-frames the subject: if you leave distance and the center at their defaults, it estimates the mesh's center and a good camera distance from the actual vertices, so even a "static, default everything" render lands on the object instead of in empty space.
The inputs that matter
- mesh and camera_trajectory - the only required inputs, and they're exactly the outputs of Trellis2Predict and CameraTrajectory_T2. This is the one wiring you can't get wrong.
- output_width / output_height - default 1920×1080, range 256–4096. If you're just previewing, drop to 512 and save the VRAM; the render itself is fast (~0.1s per frame at 512 on an A100 per the README).
- render_mode - the five looks above. This is where the pack earns its "advanced rendering effects" billing.
- lighting_preset - studio / outdoor / dramatic / flat.
- background_color - hex color behind the mesh. Default black; set it to white if you're compositing.
- num_frames - 1 by default. Raise it (up to 300) to render an animated trajectory as a sequence of frames; each frame gets its own camera pose if
animatewas on in the trajectory.
The output is rendered_image (IMAGE) - one image for a static shot, an image batch for a multi-frame render, ready for SaveImage or VHS_VideoCombine.
Installing
The standard pack setup:
cd ComfyUI/custom_nodes
git clone https://github.com/styletransfer/ComfyUI-TRELLIS2_Motion
cd ComfyUI-TRELLIS2_Motion
python install.py --full
pip install git+https://github.com/microsoft/TRELLIS.git
pip install git+https://github.com/NVlabs/nvdiffrast.git
Restart ComfyUI; the node is under TRELLIS2/Render.
Common issues
- "nvdiffrast is not available." This node is the one that needs it, so this error is its signature.
pip install git+https://github.com/NVlabs/nvdiffrast.gitis the fix - it's a CUDA wheel, so make sure your torch/CUDA build is compatible or you'll be compiling it yourself. - Black or blank render with the right wire. Check
background_color(black default is easy to mistake for a failure) and that the mesh actually has vertices - an errored Trellis2Predict upstream will hand you an empty mesh and MeshRenderer will render exactly that. - Slow multi-frame renders. At 1024 with
num_framesin the hundreds you're paying for every pixel times every frame. Preview at 512, then render big when you're happy. - "CUDA is required" even though you're on a GPU. The node hard-checks
torch.cuda.is_available(). If your ComfyUI is running in CPU mode, fix that first - this pack has no CPU path, and MeshRenderer is where you'll find out.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| mesh | TRELLIS_MESH | 3D mesh from TRELLIS2 | |
| camera_trajectory | CAMERA_TRAJECTORY | Camera parameters from CameraTrajectory node | |
| output_widthopt | INT | 1920256–4096 | Output image width |
| output_heightopt | INT | 1080256–4096 | Output image height |
| render_modeopt | COMBO | pbr | Rendering style |
| background_coloropt | COLOR | #000000 | Background color for rendered image |
| lighting_presetopt | COMBO | studio | Lighting configuration |
| num_framesopt | INT | 11–300 | Number of frames to render (for animated trajectories) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| rendered_image | IMAGE | — |