Segment Anything
Use SAM (Segment Anything Model) to remove image backgrounds and extract foreground subjects as transparent PNGs. Use when users want to remove backgrounds,... Skill: Segment Anything Owner: scikkk Summary: Use SAM (Segment Anything Model) to remove image backgrounds and extract foreground subjects as transparent PNGs. Use when users want to remove backgrounds,... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-03-14T12:50:37.505Z | user - Initial release of "sam-segmentation" skill for background removal and image segmentation. - Extracts foreground subjects from images
Rank
62
Safety
84
Downloads
1.1k
Updated
Oct 11, 2026
Version
1.0.0
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 11, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 11, 2026
- Adoption signal
- 1.1K downloadsadoption · observed Oct 11, 2026
- Latest release
- 1.0.0release · observed Mar 14, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s171sgccp6wt09makas274ye9584ktsf:sam- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-scikkk-sam/snapshot"
Documentation
CLAWHUB
6,336 characters of source documentation, loaded on request.
Extracted files
3 files captured from the source.
SKILL.md
---
name: sam-segmentation
description: Use SAM (Segment Anything Model) to remove image backgrounds and extract foreground subjects as transparent PNGs. Use when users want to remove backgrounds, cut out objects, extract foreground subjects, or perform image segmentation.
metadata:
openclaw:
requires:
bins:
- python3
install:
- kind: uv
package: pillow
- kind: uv
package: numpy
- kind: uv
package: torch
- kind: uv
package: torchvision
---
# SAM Background Removal
Extract foreground subjects from images using Meta's Segment Anything Model, outputting transparent PNGs.
## Quick Start
```bash
python3 scripts/segment.py <input_image> <output.png>
```
Defaults to the image center as the foreground hint — works well for portraits and product shots where the subject is centered.
## Parameters
| Param | Description | Default |
|---|---|---|
| `input` | Input image path | required |
| `output` | Output PNG path (single mode) or directory (`--all` mode) | required |
| `--model` | Model size: `vit_b` (fast) · `vit_l` (medium) · `vit_h` (best quality) | `vit_h` |
| `--checkpoint` | Local checkpoint path; auto-downloaded if omitted | auto |
| `--points` | Foreground hint points as `x,y`, multiple allowed | center |
| `--all` | Grid-sweep mode: extract all distinct elements | off |
| `--grid` | Grid density for `--all`; 16 means 16×16=256 probe points | `16` |
| `--iou-thresh` | Minimum predicted IoU to accept a mask (`--all`) | `0.88` |
| `--min-area` | Minimum mask area as fraction of image (`--all`) | `0.001` |
## Examples
```bash
# Basic background removal (auto-downloads vit_h ~2.5GB)
python3 scripts/segment.py photo.jpg output.png
# Specify hint point when subject is off-center
python3 scripts/segment.py photo.jpg output.png --points 320,240
# Multiple hints with lightweight model
python3 scripts/segment.py photo.jpg output.png --model vit_b --points 320,240 400,300
# Extract all elements (one PNG per element)
python3 scripts/segment.py photo.jpg ./elements/ --all
# Denser grid to capture small objects
python3 scripts/segment.py photo.jpg ./elements/ --all --grid 32
# Use a local checkpoint
python3 scripts/segment.py photo.jpg output.png --checkpoint /path/to/sam_vit_h_4b8939.pth
```
## Dependencies
`segment_anything` is auto-installed on first run, or install manually:
```bash
pip install git+https://github.com/facebookresearch/segment-anything.git
pip install pillow numpy torch torchvision
```
## Workflow
1. User provides image path
2. Ask if hint points are needed (when subject is off-center)
3. Run script; checkpoint auto-downloads on first use to `~/.cache/sam/`
4. Output transparent-background PNG
## Model Selection
| Model | Size | Speed | Quality |
|---|---|---|---|
| `vit_b` | ~375 MB | fastest | good |
| `vit_l` | ~1.25 GB | medium | better |
| `vit_h` | ~2.5 GB | slower | best |
CUDA is used automatically when a GPU is available._meta.json
{
"ownerId": "kn78vxgbf838q8g7h25g6d84md82v700",
"slug": "sam",
"version": "1.0.0",
"publishedAt": 1773492637505
}skill-card.md
## Description: Uses SAM (Segment Anything Model) to remove image backgrounds and extract foreground subjects as transparent PNGs. This skill is ready for commercial/non-commercial use. ## Publisher: [scikkk](https://clawhub.ai/user/scikkk) ### License/Terms of Use: MIT-0 ## Use Case: Developers, designers, and content operations teams use this skill to run SAM on local image files for background removal, subject cutouts, foreground extraction, and multi-element segmentation. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: First-run execution can install mutable remote code. Mitigation: Use an isolated Python environment and preinstall a pinned, reviewed segment_anything dependency before running the skill. Risk: Model checkpoints can be downloaded as large unverified files into a local cache. Mitigation: Use locally verified SAM checkpoints and pass them with the --checkpoint option. ## Reference(s): - [ClawHub skill page](https://clawhub.ai/scikkk/skills/sam) - [Segment Anything dependency](https://github.com/facebookresearch/segment-anything.git) - [SAM ViT-B checkpoint](https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth) - [SAM ViT-L checkpoint](https://dl.fbaipublicfiles.com/segment_anything/sam_vit_l_0b3195.pth) - [SAM ViT-H checkpoint](https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth) ## Skill Output: **Output Type(s):** [text, markdown, shell commands, configuration, files, guidance] **Output Format:** [Markdown guidance with bash commands; runtime output is transparent PNG image files.] **Output Parameters:** [1D] **Other Properties Related to Output:** [Single-subject mode writes one PNG file; all-elements mode writes one PNG per detected element.] ## Skill Version(s): 1.0.0 (source: server release metadata) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/scikkk/skills/sam",
"sourceUrl": "https://clawhub.ai/scikkk/skills/sam",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T13:21:41.206Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-scikkk-sam/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-scikkk-sam/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-11T13:21:41.206Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.1K downloads",
"href": "https://clawhub.ai/scikkk/sam",
"sourceUrl": "https://clawhub.ai/scikkk/sam",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T13:21:41.206Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.0.0",
"href": "https://clawhub.ai/scikkk/sam",
"sourceUrl": "https://clawhub.ai/scikkk/sam",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-03-14T12:50:37.505Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-scikkk-sam/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-scikkk-sam/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.0.0",
"description": "- Initial release of \"sam-segmentation\" skill for background removal and image segmentation. - Extracts foreground subjects from images using Meta's Segment Anything Model (SAM) and saves as transparent PNGs. - Supports multiple model sizes (`vit_b`, `vit_l`, `vit_h`) for different speed and quality needs. - Allows foreground hint points, grid-sweep mode for extracting all distinct elements, and various mask filtering parameters. - Automatically installs needed dependencies (`segment_anything`, Pillow, numpy, torch, torchvision) on first use. - Model checkpoint is auto-downloaded if not provided.",
"href": "https://clawhub.ai/scikkk/sam",
"sourceUrl": "https://clawhub.ai/scikkk/sam",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-03-14T12:50:37.505Z",
"isPublic": true
}
]
}Record generated Oct 11, 2026.
