Segment Anything

Use Meta's SAM for precise image segmentation on GPU.

circle-check

Renting on CLORE.AI

  1. Filter by GPU type, VRAM, and price

  2. Choose On-Demand (fixed rate) or Spot (bid price)

  3. Configure your order:

    • Select Docker image

    • Set ports (TCP for SSH, HTTP for web UIs)

    • Add environment variables if needed

    • Enter startup command

  4. Select payment: CLORE, BTC, or USDT/USDC

  5. Create order and wait for deployment

Access Your Server

  • Find connection details in My Orders

  • Web interfaces: Use the HTTP port URL

  • SSH: ssh -p <port> root@<proxy-address>

What is SAM?

Segment Anything Model (SAM) can:

  • Segment any object in images

  • Work with prompts (points, boxes, text)

  • Generate automatic masks

  • Handle any image type

Model Variants

Model
VRAM
Quality
Speed

SAM-H (huge)

8GB

Best

Slow

SAM-L (large)

6GB

Great

Medium

SAM-B (base)

4GB

Good

Fast

SAM2

8GB+

Best

Medium

Quick Deploy

Docker Image:

Ports:

Command:

Accessing Your Service

After deployment, find your http_pub URL in My Orders:

  1. Go to My Orders page

  2. Click on your order

  3. Find the http_pub URL (e.g., abc123.clorecloud.net)

Use https://YOUR_HTTP_PUB_URL instead of localhost in examples below.

Installation

Download Models

Python API

Basic Segmentation with Points

Box Prompt

Multiple Points

Combined Box + Point

Automatic Mask Generation

Generate all possible masks:

Visualize All Masks

SAM 2 (Latest Version)

Remove Background

Extract Object

Batch Processing

API Server

Integration with Stable Diffusion

Use SAM masks for inpainting:

Performance

Model
Image Size
GPU
Time

SAM-H

1024x1024

RTX 3090

~0.5s

SAM-L

1024x1024

RTX 3090

~0.3s

SAM-B

1024x1024

RTX 3090

~0.2s

SAM2

1024x1024

RTX 4090

~0.3s

Memory Optimization

Troubleshooting

CUDA Out of Memory

  • Use SAM-B instead of SAM-H

  • Reduce image size before processing

  • Clear cache: torch.cuda.empty_cache()

Poor Segmentation

  • Add more points (foreground + background)

  • Use box prompt for better guidance

  • Try multimask_output=True and pick best

Cost Estimate

Typical CLORE.AI marketplace rates (as of 2024):

GPU
Hourly Rate
Daily Rate
4-Hour Session

RTX 3060

~$0.03

~$0.70

~$0.12

RTX 3090

~$0.06

~$1.50

~$0.25

RTX 4090

~$0.10

~$2.30

~$0.40

A100 40GB

~$0.17

~$4.00

~$0.70

A100 80GB

~$0.25

~$6.00

~$1.00

Prices vary by provider and demand. Check CLORE.AI Marketplacearrow-up-right for current rates.

Save money:

  • Use Spot market for flexible workloads (often 30-50% cheaper)

  • Pay with CLORE tokens

  • Compare prices across different providers

Next Steps

Last updated

Was this helpful?