Skip to main content
Glama

Set up selfie segmentation

setup_segmentation

Loads MediaPipe selfie segmentation in TouchDesigner, building an alpha-mask Null TOP with optional inversion and feathering, plus a pre-keyed RGBA Null TOP for person-on-transparent.

Instructions

One-shot selfie segmentation via the MediaPipe TouchDesigner engine (install with tdmcp install mediapipe-touchdesigner). Loads the engine, enables Selfie Segmentation, and builds an adapter COMP with a clean alpha-mask Null TOP (optionally inverted and/or feathered) plus an optional pre-keyed RGBA Null TOP (person on transparent). Wire the mask into create_keyer, create_depth_silhouette, or any matte-consuming tool. The engine reuses an existing MediaPipe op if already loaded (idempotent). Keep the TD timeline PLAYING so the embedded browser captures the webcam; click Allow if macOS prompts for camera permission.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tox_pathNoPath to the MediaPipe ENGINE .tox (MediaPipe.tox). Defaults to the package staged by `tdmcp install mediapipe-touchdesigner`, falling back to the legacy ~/tdmcp-packages path.
parent_pathNoCOMP to load the engine into. Reuses the existing engine if MediaPipe already exists./project1
modelNoSelfie-segmentation model variant. 'general' works at any orientation; 'landscape' is tuned for wide-angle scenes.general
smoothNoEnable the engine's mask temporal smoothing parameter if present.
publish_prekeyedNoAlso build a person_rgba Null TOP (camera × mask) so you can drop 'person on transparent' straight into a comp.
invert_maskNoOutput 1 − mask (useful for background-only effects). Applied via a Level TOP on the mask branch.
feather_pxNoSoft-edge blur radius on the mask before publishing (Blur TOP). 0 = hard mask.
nameNoAdapter COMP name under parent_path. Defaults to 'mp_segmentation'.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses behavioral traits beyond annotations: idempotent, reuses existing engine, requires timeline playing, macOS camera permission. No contradiction with annotations (readOnlyHint=false, destructiveHint=false).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Efficiently structured: front-loads purpose and installation, then details behavior, parameters, and wiring instructions. Every sentence serves a clear purpose with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Comprehensive for a tool with 8 parameters and no output schema: explains what is created (mask Null TOP, optional prekeyed RGBA), how to wire to other tools, and handles edge cases (idempotency, camera permission).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Adds meaning beyond input schema: explains default paths, model variants (general vs landscape), smoothing behavior, and details on invert_mask (via Level TOP) and feather_px (via Blur TOP). High schema coverage (100%) complemented by operational context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it sets up selfie segmentation via MediaPipe TouchDesigner engine, listing specific capabilities (load engine, enable segmentation, build adapter COMP with mask) and distinguishes from siblings by referencing wiring into create_keyer, create_depth_silhouette.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides context on when to use (for segmentation setup), mentions idempotency and prerequisites (timeline playing, camera permission). Does not explicitly exclude alternatives but references specific matte-consuming tools, giving guidance on downstream use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Pantani/tdmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server