seedinteger
Random seed for reproducibility
meta/sam-3/3d-objectsSam 3 3d Objects by Meta - convert 2D images into 3D models with AI. Generate textured 3D assets from single photos for games, AR/VR, e-commerce, and digital content creation.
Thử model
PNG, JPEG, WebP hoặc GIF · tối đa 20 MiB
Bạn muốn làm gì tiếp theo?
Chọn một ví dụ để nạp đầu vào và kết quả của nó vào playground.
{
"image": "https://static.sandbase.ai/examples/adec1dd5-efca-4f0a-bb23-01f828c4988c/input/01b105f2-a252-49d4-bea2-b473619d9110.jpeg",
"prompt": "car"
}SAM 3D Objects reconstructs a segmented object from a single image as a 3D model.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | car | What to reconstruct. |
image | image URL, required | — | Image containing the object. JPEG, PNG, or WebP URL. |
point_prompts | object[] | [] | Point prompts for auto-segmentation when no masks provided |
detection_threshold | number 0.1–1 | — | Detection confidence threshold (0.1-1.0). |
box_prompts | object[] | [] | Box prompts for auto-segmentation when no masks provided. |
pointmap_url | string | — | Optional URL to external pointmap/depth data (NPY or NPZ format) for improved 3D reconstruction depth estimation |
export_textured_glb | boolean | false | Export a textured GLB. |
mask_urls | image URL[] | — | Optional list of mask URLs (one per object). |
seed | integer | random | Fix it to compare prompt changes. |
$0.024 per object.
| Request | Price |
|---|---|
| One object | $0.024 |
Failed runs are not charged.
Related: meta/sam-3/image.
Bắt đầu xây dựng
Gửi model này qua SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "meta/sam-3/3d-objects",
"image": "https://static.sandbase.ai/examples/meta/sam-3/3d-objects/input_image_0.jpeg",
"prompt": "car",
"box_prompts": [],
"point_prompts": [],
"export_textured_glb": false
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Tạo một SandBase API key và đặt nó trong môi trường máy chủ của bạn. Tất cả request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key trên máy chủ. Không hiển thị trong mã trình duyệt hoặc commit vào repository.
POST tới /v1/run với model ID này và các đầu vào của nó. Ví dụ request ở trên bao gồm cả bước gửi và polling.
Dùng run ID được trả về để poll cho đến khi trạng thái là completed, failed hoặc timeout. Chỉ đọc đầu ra sau khi completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Cung cấp một URL tệp có thể truy cập công khai trong trường image, video hoặc audio của model. Các định dạng và giới hạn được hỗ trợ hiển thị bên cạnh từng input trong Playground.
Dùng điều khiển upload hoặc replace trên các trường image được hỗ trợ trong Playground. Trường URL video chấp nhận một video driving được host; điều này không đồng nghĩa hỗ trợ tải lên video.
seedintegerRandom seed for reproducibility
imagestringbắt buộcURL of the image to reconstruct in 3D
promptstringbắt buộcText prompt for auto-segmentation when no masks provided (e.g., 'chair', 'lamp')
Mặc định: "car"
mask_urlsarrayOptional list of mask URLs (one per object). If not provided, use prompt/point_prompts/box_prompts to auto-segment, or entire image will be used.
box_promptsarrayBox prompts for auto-segmentation when no masks provided. Multiple boxes supported - each produces a separate object mask for 3D reconstruction.
Mặc định: []
pointmap_urlstringOptional URL to external pointmap/depth data (NPY or NPZ format) for improved 3D reconstruction depth estimation
point_promptsarrayPoint prompts for auto-segmentation when no masks provided
Mặc định: []
detection_thresholdnumberDetection confidence threshold (0.1-1.0). Lower = more detections but less precise. If not set, uses the model's default.
Tối thiểu: 0.1
Tối đa: 1
export_textured_glbbooleanIf True, exports GLB with baked texture and UVs instead of vertex colors.
Mặc định: false
{
"model": "meta/sam-3/3d-objects",
"image": "https://static.sandbase.ai/examples/meta/sam-3/3d-objects/input_image_0.jpeg",
"prompt": "car",
"box_prompts": [],
"point_prompts": [],
"export_textured_glb": false
}Một run đã hoàn tất sẽ hiển thị kết quả trong output. Phần sau là ví dụ đã lưu của model, không phải một lần tạo mới.
[
{
"poster": "https://static.sandbase.ai/examples/adec1dd5-efca-4f0a-bb23-01f828c4988c/output/15642b8b-3842-4520-bf1b-11fb2c0e98fd.png",
"source": "Self organization completed prediction",
"source_url": "https://www.sandbase.ai",
"url": "https://static.sandbase.ai/examples/adec1dd5-efca-4f0a-bb23-01f828c4988c/output/733c862a-794e-4e7d-8013-dfa65d8c126f.glb"
}
]