remove-ac

v1.3.3
io.github.szp2005/remove-ac Checked 28 minutes ago Published 2 hours ago

Drop-in /v1.0/removebg Cloud GPU background removal MCP server (25 MB / 50 MP zero-disk).

Zero-dependency official developer SDKs, hot-folder CLI, GitHub Action, and Model Context Protocol (MCP) server for remove.ac — the dual-mode background removal platform pairing a free on-device WebAssembly studio with a remove.bg-compatible Cloud GPU REST API (POST https://remove.ac/v1.0/removebg). The default output size is not the same on every surface. If you leave size out, the cost per successful image depends on which client you use. To get predictable output and billing, always pass size explicitly. Credit cost depends only on the size tier:

Summary extracted from the README.

remove.ac Official SDKs, CLI, GitHub Action & MCP Server (v1.3.3)

szp2005/remove-ac-sdk MCP server

Zero-dependency official developer SDKs, hot-folder CLI, GitHub Action, and Model Context Protocol (MCP) server for remove.ac — the dual-mode background removal platform pairing a free on-device WebAssembly studio with a remove.bg-compatible Cloud GPU REST API (POST https://remove.ac/v1.0/removebg).


Key Capabilities

  • 1:1 remove.bg v1.0 Field Compatibility: Swap https://api.remove.bg/v1.0/removebg to https://remove.ac/v1.0/removebg using standard X-Api-Key: rac_live_... headers and form fields (image_file, image_file_b64, image_url, size, format, channels, type, roi, crop, crop_margin, scale, position, bg_color, bg_image_file, bg_image_file_b64, bg_image_url, add_shadow, shadow_type, shadow_opacity, semitransparency), plus POST /v1.0/improve (submitImprove / submit_improve) for hard-case feedback submissions.
  • Up to 25 MB / 50 MP Zero-Disk Direct GPU Streaming: Single-call POST https://remove.ac/v1.0/removebg uploads up to 25 MB / 50 MP (size=25mp, size=50mp, size=full, size=auto) — including custom local background images (bgImageFile / bg_image_file) — stream transparently at the edge via 180-second single-use HMAC tickets (POST /v1.0/removebg/ticket) directly to ephemeral GPU RAM without disk or database blob persistence.
  • Atomic Credit Holds (Idempotency-Key): Upstream timeouts or errors automatically release held credits with zero charge. Every verified account starts with 10 full-resolution welcome credits (valid 30 days); pay-as-you-go credit packs never expire.
  • Zero External Runtime Dependencies: The Node.js 18+ SDK, CLI, GitHub Action, MCP stdio server, and Python 3.8+ SDK run purely on standard library primitives (fetch/crypto in Node, urllib in Python).
  • Warm Cloud GPU Latency & Cold-Start Timeout Guidance: Warm Cloud GPU cutouts complete in ~1–4 s end-to-end (0.88–1.04 s GPU / 1.58 s E2E at 2.2 MP and 1.49–2.01 s GPU / 2.26 s E2E at 4K on AIM-500). Because scale-to-zero Cloud GPU instances can take 30–55 s on a cold start after an idle window, set client HTTP timeouts to >= 90 s when migrating scripts from remove.bg (the Python SDK defaults to 90 s; Node 18+ fetch defaults to 300 s).
  • Free Interactive Cloud GPU Previews (~612px, 0 Credits): In the web studio (remove.ac/upload), inspect ~612px (~0.25 MP) Cloud GPU cutouts for 0 credits (5/day on free accounts, 30/day with paid credits; images already within preview dimensions deliver full original resolution free) before spending 1 credit to unlock full-resolution Max HD (up to 50 MP / 25 MB, keeping background/shadow/crop edits).
  • Dec 1 Migration Grant (30%-50% Off Through Dec 31, 2026) & 14-Day Self-Serve Refund: Self-serve checkout auto-applies 30% off Starter (10-75 PAYG, 40 mo/yr), 40% off Growth (200-500), and 50% off High-Volume (1,200-5,000 PAYG/mo + 1,200 yr) on first 3 monthly cycles, first annual year up to 1,200, or non-expiring PAYG packs (up to 3 orders/account, max 1 on 2,800/5,000; Enterprise 2,800/5,000 annual concierge-verified via support@remove.ac). Initial (non-renewal) orders include a 14-day self-serve refund (100% if 0 credits used; otherwise 1-click proportional refund of remaining unused credits, $0 fee, $0.50 min payout, up to 2 self-serve refunds/account; further requests via support@remove.ac).
  • Bug & Workflow Idea Credit Rewards: Report bugs, cutout edge cases, or workflow ideas on the remove.ac homepage (up to 3 submissions per 24h) to earn 5-20 non-expiring Cloud GPU credits automatically once verified and accepted.

Default size per Surface & Credit Cost

The default output size is not the same on every surface. If you leave size out, the cost per successful image depends on which client you use. To get predictable output and billing, always pass size explicitly.

Surface Default size when omitted Output cap Credits per successful image
REST POST /v1.0/removebg (curl or any HTTP client, remove.bg-compatible) preview ~0.25 MP 0.25
Node.js SDK RemoveAcClient.removeBackground() auto up to 50 MP 1
CLI remove-ac (--size) auto up to 50 MP 1
Python SDK RemoveAcClient.remove_background() auto up to 50 MP 1
Python RemoveBg drop-in shim (remove_background_from_img_file / _img_url / _base64_img) regular ~0.25 MP 0.25
MCP server tools (remove_background_file, remove_background_url) full up to 50 MP 1
GitHub Action (size input) full up to 50 MP 1
Desktop app full up to 50 MP 1

Credit cost depends only on the size tier:

  • preview, small, regular: output capped at ~0.25 MP (250,000 px). Costs 0.25 credit.
  • medium (1.5 MP), hd (4 MP), 4k (10 MP), 25mp (25 MP), 50mp, full, maximum, auto (up to 50 MP): costs 1 credit.
  • Failed, rejected (for example 413) or timed-out calls cost 0 credits. The response header X-Credits-Charged reports the actual charge.

Upload Size Limits

Limit Value Enforced by
Single image (foreground or background file) 25 MiB (26,214,400 bytes) and 50 MP (max 50,000 px per side) SDKs, CLI, MCP, Action, Desktop (before upload) and the remove.ac edge
Combined foreground + local background file in one request 29.5 MiB (30,932,992 bytes) of raw image bytes SDKs, CLI, MCP and Action (before upload). This leaves 512 KiB of headroom for multipart framing
Whole HTTP request body 32 MiB (33,554,432 bytes) remove.ac edge. Larger requests get 413 payload_too_large and X-Credits-Charged: 0

The client-side 29.5 MiB check always trips before the 32 MiB edge cap. Client error messages call this the "30 MB multipart envelope"; the byte values in the table above are the exact limits.


1. Quick curl Migration

curl -X POST https://remove.ac/v1.0/removebg \
  -H "X-Api-Key: rac_live_your_key_here" \
  -F "image_file=@photo.jpg" \
  -F "size=full" \
  -o cutout.png

2. Node.js / TypeScript SDK (Node 18+)

Install via npm or GitHub

npm install remove-ac
# via GitHub Packages npm registry (aliased as "remove-ac" for drop-in imports; requires //npm.pkg.github.com/:_authToken=YOUR_GITHUB_PAT in .npmrc):
npm install remove-ac@npm:@szp2005/remove-ac --@szp2005:registry=https://npm.pkg.github.com
# or directly from GitHub:
npm install github:szp2005/remove-ac-sdk

Usage (ESM & CommonJS)

Both native ESM (import) and CommonJS (require("remove-ac")) are supported out of the box on Node.js 18/20/22+, including drop-in helpers removeBackgroundFromImageFile, removeBackgroundFromImageUrl, and removeBackgroundFromImageBase64:

import fs from "node:fs";
import { RemoveAcClient } from "remove-ac";

const client = new RemoveAcClient({
  apiKey: process.env.REMOVE_AC_API_KEY, // rac_live_...
});

// Files > 4 MB (up to 25 MB / 50 MP) automatically use /v1.0/removebg/ticket zero-disk GPU streaming
const result = await client.removeBackground("./studio-shot-18mb.png", {
  size: "full",
  format: "png",
  bgImageFile: "./studio-backdrop.jpg", // optional path or Buffer/Uint8Array/ArrayBuffer
  shadowType: "contact",
});

fs.writeFileSync("./studio-shot-cutout.png", result.buffer);
console.log(`Saved ${result.width}x${result.height} (${result.creditsCharged} credit)`);
// CommonJS drop-in migration from npm "remove.bg"
const {
  removeBackgroundFromImageFile,
  removeBackgroundFromImageUrl,
  removeBackgroundFromImageBase64,
} = require("remove-ac");

async function main() {
  const result = await removeBackgroundFromImageFile({
    path: "./product.jpg",
    apiKey: process.env.REMOVE_AC_API_KEY,
    size: "regular",
    outputFile: "./product-nobg.png",
  });
  console.log(`Saved ${result.width}x${result.height} (${result.creditsCharged} credit)`);
}

main().catch((err) => {
  console.error(err);
  process.exit(1);
});

3. CLI & --watch Hot-Folder Batch Tool

export REMOVE_AC_API_KEY="rac_live_..."

# Process an entire folder with 4 parallel workers (up to 50 MP)
npx -y -p remove-ac remove-ac ./input-photos --output-dir ./output-pngs --concurrency=4 --size=50mp

# Watch a hot folder continuously and output transparent WebP cutouts
npx -y -p remove-ac remove-ac ./incoming --output-dir ./cutouts --watch --format=webp --crop

4. Python SDK (Python 3.8+, Zero External Dependencies)

Install via PyPI or GitHub

Migrating from legacy PyPI removebg (brilam/remove-bg)? Uninstall removebg first! Python always imports an existing site-packages/removebg/ package directory ahead of remove-ac's removebg.py shim — leaving the old package installed will silently keep sending your new rac_live_ key to the shut-down api.remove.bg endpoint.

pip uninstall -y removebg
pip install remove-ac
# or directly from GitHub:
pip install git+https://github.com/szp2005/remove-ac-sdk.git

Native Client

from remove_ac import RemoveAcClient

client = RemoveAcClient()  # reads REMOVE_AC_API_KEY
png_bytes = client.remove_background(
    "product.jpg",
    size="full",
    shadow_type="contact",
)
with open("product-nobg.png", "wb") as fh:
    fh.write(png_bytes)

1:1 removebg Drop-In Replacement Shim

Existing scripts written for from removebg import RemoveBg work without rewriting call sites (make sure pip uninstall -y removebg was run first). By default, remove_background_from_img_file("car.jpg") writes car.jpg_no_bg.png and accepts bg_color as the 3rd positional argument (matching legacy brilam/remove-bg), or pass new_file_name="..." as a keyword argument (pass new_file_name="" to return bytes without writing to disk):

from removebg import RemoveBg

rmbg = RemoveBg("rac_live_your_key_here")
# Writes car.jpg_no_bg.png by default (batch-safe, matches legacy brilam/remove-bg)
rmbg.remove_background_from_img_file("car.jpg", size="full")
# Or write to a custom path:
rmbg.remove_background_from_img_file("car.jpg", size="full", new_file_name="car-cutout.png")

5. MCP Server (Claude Desktop · Cursor · VS Code · Windsurf · Cline)

remove-ac includes a zero-dependency Model Context Protocol (MCP) stdio server (remove-ac-mcp, Official Registry ID io.github.szp2005/remove-ac) exposing three tools:

  • remove_background_file — remove background from any local .png / .jpg / .webp up to 25 MB / 50 MP (auto-streams >4 MB via /v1.0/removebg/ticket)
  • remove_background_url — remove background from a public https:// image URL and save locally
  • get_account_balance — inspect remaining remove.ac API credits

For Cline and other AI coding agents, see ./llms-install.md for deterministic step-by-step setup and a zero-key JSON-RPC handshake check.

Claude Desktop / Cursor / Cline Configuration

{
  "mcpServers": {
    "remove-ac": {
      "command": "npx",
      "args": ["-y", "remove-ac", "--mcp"],
      "env": {
        "REMOVE_AC_API_KEY": "rac_live_your_key_here"
      }
    }
  }
}

(You can also invoke the dedicated binary directly with "args": ["-y", "-p", "remove-ac", "remove-ac-mcp"].)


6. Official GitHub Action (CI/CD Asset Pipelines)

Automate storefront product cutouts or PR asset cleanup directly inside GitHub Actions:

- name: Remove product photo backgrounds
  uses: szp2005/remove-ac-sdk@v1
  with:
    api_key: ${{ secrets.REMOVE_AC_API_KEY }}
    input_path: "assets/raw-products"
    output_dir: "assets/transparent-pngs"
    size: "50mp"
    format: "png"
    crop: "true"

7. n8n Community Node (n8n-nodes-remove-ac v1.0.3)

In self-hosted or desktop n8n, open Settings → Community Nodes → Install and enter n8n-nodes-remove-ac (v1.0.3) to replace deprecated remove.bg workflow steps with native binary and URL support up to 25 MB / 50 MP.


8. Standalone Desktop App (Windows .exe · macOS Universal .dmg · Linux .AppImage)

desktop/ contains the official standalone Electron desktop application (Remove.ac) for bulk folder and multi-thousand-photo background removal up to 25 MB / 50 MP — requiring zero Node.js or Python installation on end-user machines:

  • Direct Downloads: https://remove.ac/plugins/desktop (or GitHub Releases)
  • Installers: remove-ac-for-windows-1.1.1.exe (NSIS x64), remove-ac-portable-1.1.1.exe (zero-install portable x64), remove-ac-for-macos-1.1.1.dmg (Universal Apple Silicon + Intel), and remove-ac-for-linux-1.1.1.AppImage (x64)
  • First launch: The installers are not code-signed, and the macOS build is not notarized. See Unsigned Binary Notes for SHA-256 verification and the macOS 15+ System Settings → Privacy & Security → Open Anyway steps.

License

MIT © remove.ac