ComfyUI Node

SAM 3D Objects

The 'turn this one object into a 3D model' node

By Runware·Created 2 years ago·Updated about a month ago· 140
SAM 3D Objects
  • image
  • mask
  • file_path
positivePrompt
seed0
numberResults1
ttlfalse
ttl_value60
outputFormatGLB

Full-frame 3D reconstruction is impressive but useless when you only care about the chair, not the room. This node is built around that distinction: you tell it which object matters - via a mask - and Meta's SAM-3D pipeline turns just that object into a textured GLB. It's the most "point at it" 3D node in the Runware pack, and the mask input is the superpower.

How it works

A 3dInference node with three required inputs, and they're all image-based:

  • image (IMAGE) - your source photo.
  • mask (IMAGE) - a mask of the object you want reconstructed. Note the type: it's an IMAGE, not the MASK socket type, so your mask has to be an image (black background, white object). A MediaPipe mask node from this same pack, a hand-drawn mask, or a segmentation output all work as long as it lands as an IMAGE.
  • positivePrompt (STRING) - what the object is. It's required, so even though the mask does most of the work, you still tell the model "a wooden chair."

Optional inputs are the usual pack plumbing: seed, numberResults (variations, each with its own seed), ttl/ttl_value, and outputFormat (locked to GLB). The model runs on Runware's cloud (Meta's SAM-3D), so there's no local mesh pipeline. Output is a file_path string - the GLB gets saved to your ComfyUI output folder, and the node points you at it.

The mask + prompt split is worth understanding before you run: the mask carves the object out of the scene, and the prompt tells the reconstructor what it's looking at so the mesh comes back recognizable. Get the mask right and the whole thing is magic; skimp on it and you'll get a lumpy amalgam of chair plus floor.

Install

One pack, all the Runware nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Runware/ComfyUI-Runware
pip install -r ComfyUI-Runware/requirements.txt

Restart (or ComfyUI Manager → search "Runware"). Then a Runware API key: Settings → Runware API key, RUNWARE_API_KEY, or runware auth login.

Gotchas

3D inference is the priciest category in the pack - the title bar's cost readout will remind you, especially if you set numberResults above 1. The output is a file path, not a tensor, so wire it into a file/path consumer and find your GLB in the output folder. And the mask is IMAGE-typed: if you built a proper MASK somewhere else, convert it (core MaskToImage) before wiring in. A clean, tight mask is the difference between "nice, a chair" and "what is that".

CategoryRunware/3D/meta

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
maskIMAGE
positivePromptSTRINGText prompt describing elements to include in the generated output.
seedoptINT00–9223372036854776000Random seed for reproducible generation. When not provided, a random seed is generated in the unsigned 32-bit range.
numberResultsoptINT11–4Number of results to generate. Each result uses a different seed, producing variations of the same parameters.
ttloptBOOLEANfalseEnable to set ttl. Off uses the model's default.
ttl_valueoptINT60Time-to-live (TTL) in seconds for generated content. Only applies when `outputType` is `URL`.
outputFormatoptCOMBOGLBFile format for the generated 3D model.

Outputs (1)

NameTypeDescription
file_pathSTRING