Repository navigation
Conversation
…down remove.bg's self-service API stops on December 1, 2026 and background removal moves to Leonardo.Ai. Move the request into src/lib/remove-bg.js and point it at Leonardo's sync remove-bg endpoint, following the official migration guide: https://docs.leonardo.ai/docs/migrate-from-the-removebg-api-to-leonardoai remove.bg keys don't carry over, so the key now comes from --api-key, LEONARDO_API_KEY or the leonardoApiKey config value. The command still gets PNG bytes back (the result URL is downloaded), so the Figma side is unchanged. Adds tests with a mocked fetch. Signed-off-by: Anand Biju <169837340+Anandb71@users.noreply.github.com>
silships
pushed a commit
that referenced
this pull request
Nov 19, 2026
…down (#62) remove.bg moves background removal to Leonardo.Ai on December 1 2026. Old remove.bg keys found in REMOVEBG_API_KEY or config are reported as unused instead of silently ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thank you! This is in figma-cli 2.4.0 on npm: the Leonardo.Ai switch. An old remove.bg key now gets a clear message instead of being ignored. Commit 7ae7e65 keeps you as the author |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey! remove.bg is shutting down its self service API on December 1, 2026. The banner on https://www.remove.bg/api says "Starting December 1, 2026, background removal moves to Leonardo.Ai", so
figma-cli remove-bgwill start failing after that date.This moves the command over to Leonardo's sync API, following their official migration guide: https://docs.leonardo.ai/docs/migrate-from-the-removebg-api-to-leonardoai
What changed
src/lib/remove-bg.jsso it can be tested on its own. It sends JSON tohttps://cloud.leonardo.ai/api/rest/v2/generationssyncwith"model": "remove-bg", the exported PNG as BASE64 underparameters.guidances.image_reference,size: auto,format: pngandephemeral: true(so nothing is kept in the Leonardo library, same as remove.bg). It downloadsresults[0].urland returns the PNG bytes, so the Figma side of the command is untouched.--api-key,LEONARDO_API_KEYorconfig set leonardoApiKey, and the "key required" help points to the Leonardo API Access page and explains why an old key stops working.errors[], so those messages get surfaced, and a 401/403 says to use a Leonardo key.REFERENCE.md,SECURITY.md(outbound requests) and theconfig setexample mention Leonardo now. I didn't touchCHANGELOG.mdsince you write it per release.Testing
tests/remove-bg.test.jswith a mockedfetch: it checks the request shape and the downloaded bytes, theerrors[]case, a 401 and an emptyresults. It fails on the current code and passes with this change.npm teston Node 22: 553 tests, 552 pass, 0 fail, 1 skipped. The skip is the existing roundtrip test that needs a connected Figma (main gives 549 / 548 / 1 skipped).node --checkloop from the CI workflow passes.remove-bgon a selected image would be great before merging.Thanks for the tool!