image-remove-background

Removes the background from an image, leaving the foreground subject with transparency. Use when you need to isolate subjects, create cutouts, or prepare images for compositing.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "image-remove-background" with this command: npx skills add agntswrm/agent-media/agntswrm-agent-media-image-remove-background

Image Remove Background

Removes the background from an image, leaving only the foreground subject with transparency.

Command

npx agent-media@latest image remove-background --in <path> [options]

Inputs

OptionRequiredDescription
--inYesInput file path or URL
--outNoOutput path, filename or directory (default: ./)
--providerNoProvider to use (local, fal, replicate)
--resolutionNoOutput resolution (e.g., "2048x2048"). Supported by fal Dynamic model.

Output

Returns a JSON object with the processed image path:

{
  "ok": true,
  "media_type": "image",
  "action": "remove-background",
  "provider": "fal",
  "output_path": "nobg_123_abc.png",
  "mime": "image/png",
  "bytes": 34567
}

Examples

Remove background from local file:

npx agent-media@latest image remove-background --in portrait.jpg

Remove background using specific provider:

npx agent-media@latest image remove-background --in portrait.jpg --provider replicate

Remove background at full resolution (fal Dynamic model):

npx agent-media@latest image remove-background --in portrait.jpg --provider fal --resolution 2048x2048

Providers

local

Runs locally on CPU using Transformers.js, no API key required.

  • Uses Xenova/modnet model
  • Models downloaded on first use (~25MB)
  • You may see a mutex lock failed error — ignore it, the output is correct if "ok": true
npx agent-media@latest image remove-background --in portrait.jpg --provider local

fal

  • Requires FAL_API_KEY
  • Uses birefnet/v2 model with General Use (Dynamic) variant
  • Supports --resolution option (e.g., "2048x2048") for processing at full input resolution

replicate

  • Requires REPLICATE_API_TOKEN
  • Uses birefnet model

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

audio-transcribe

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

video-generate

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

image-crop

No summary provided by upstream source.

Repository SourceNeeds Review