Segment Anything
Precise image segmentation with Meta's SAM on Clore.ai GPUs
Use Meta's SAM for precise image segmentation on GPU.
All examples can be run on GPU servers rented through CLORE.AI Marketplace.
Renting on CLORE.AI
Visit CLORE.AI Marketplace
Filter by GPU type, VRAM, and price
Choose On-Demand (fixed rate) or Spot (bid price)
Configure your order:
Select Docker image
Set ports (TCP for SSH, HTTP for web UIs)
Add environment variables if needed
Enter startup command
Select payment: CLORE, BTC, or USDT/USDC
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
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:
Go to My Orders page
Click on your order
Find the
http_pubURL (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
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):
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 Marketplace for current rates.
Save money:
Use the Spot market for interruptible work — about a third of servers price spot below on-demand (median ~13% off), the rest match it
Pay with CLORE tokens
Compare prices across different providers
Next Steps
Stable Diffusion Inpainting
Last updated
Was this helpful?