One-click launcher for SAM 3 (Segment Anything Model 3) - a unified foundation model for promptable video segmentation. Requires HuggingFace model access and 16GB+ VRAM.
Build a complete Pinokio launcher for SAM 3 (Segment Anything Model 3), a unified foundation model for promptable video segmentation.
This skill helps you create a production-ready Pinokio launcher that:
Before running this launcher, users must:
1. Visit https://huggingface.co/facebook/sam3 and request access (gated model)
2. After approval, create an HF token and grant access to `facebook/sam3`
3. Create another token for `merve/SAM3-video-segmentation`
4. Have GPU with 16GB+ VRAM
Create a standard Pinokio launcher project:
```
project-root/
├── app/ # Self-contained app logic
│ ├── requirements.txt # Python dependencies
│ └── app.py # Main application code
├── README.md # User documentation
├── install.js # Installation script
├── start.js # Launch script
├── update.js # Update script
├── reset.js # Reset dependencies script
├── pinokio.js # UI generator script
└── pinokio.json # Metadata
```
The installation script must:
1. Check for GPU availability (16GB+ VRAM requirement)
2. Set up Python virtual environment in `app/env`
3. Verify HuggingFace token exists (check `HF_TOKEN` environment variable)
4. Clone or set up SAM3-video-segmentation repository
5. Install dependencies from `app/requirements.txt`
6. Verify model access to both required models
Example structure (follow examples in `C:\pinokio\prototype\system\examples`):
```javascript
module.exports = {
run: [
{
method: "shell.run",
params: {
message: "python -m venv env",
path: "app"
}
},
{
method: "shell.run",
params: {
venv: "env",
path: "app",
message: "pip install -r requirements.txt"
}
},
// Add HF token verification step
// Add GPU check step
// Add model access verification
]
}
```
**CRITICAL:** Follow the URL capture pattern exactly as specified in the development guide:
```javascript
module.exports = {
daemon: true,
run: [
{
method: "shell.run",
params: {
venv: "env",
path: "app",
message: "python app.py",
on: [{
event: "/(http:\\/\\/[0-9.:]+)/",
done: true
}]
}
},
{
method: "local.set",
params: {
url: "{{input.event[1]}}"
}
}
]
}
```
**Important:** The regex capture pattern and `local.set` usage must match this exact structure.
Remove the virtual environment and all installed dependencies:
```javascript
module.exports = {
run: [
{
method: "fs.remove",
params: {
path: "app/env"
}
}
]
}
```
Pull latest changes from the SAM3 repository and update dependencies:
```javascript
module.exports = {
run: [
{
method: "shell.run",
params: {
path: "app",
message: "git pull"
}
},
{
method: "shell.run",
params: {
venv: "env",
path: "app",
message: "pip install --upgrade -r requirements.txt"
}
}
]
}
```
UI generator that ties all scripts together:
```javascript
module.exports = {
title: "SAM 3 Video Segmentation",
description: "Promptable video segmentation with SAM 3",
menu: [
{
text: "Install",
href: "install.js"
},
{
text: "Start",
href: "start.js",
mode: "refresh"
},
{
when: "{{local.url}}",
text: "Open WebUI",
href: "{{local.url}}"
},
{
text: "Update",
href: "update.js"
},
{
text: "Reset",
href: "reset.js"
}
]
}
```
Metadata file:
```json
{
"title": "SAM 3 Video Segmentation",
"description": "Segment Anything Model 3 - promptable video segmentation with 16GB+ VRAM requirement",
"icon": "icon.png",
"version": "1.0.0"
}
```
Comprehensive documentation including:
Include all Python dependencies:
```
transformers>=4.30.0
torch>=2.0.0
gradio>=3.0.0
huggingface-hub>=0.16.0
```
Main application logic that:
Before finalizing, verify:
If issues occur:
1. Check logs folder for execution details
2. Verify HuggingFace token permissions
3. Confirm GPU memory meets requirements
4. Review `PINOKIO.md` at `C:\pinokio\prototype\PINOKIO.md` for API syntax
5. Compare against examples in `C:\pinokio\prototype\system\examples`
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/sam-3-video-segmentation-launcher-xa71hw/raw