Remove background
A Revemaker account is required. Media processing uses account credits. Paid subscriptions or additional credits may incur charges.
Read revemaker-rules first.
If you cannot run shell commands, say this host cannot upload local files, ask the user to try again from a host that can run them, and stop.
- Call
revemaker_accountand tell the user their plan and balance. - Call
revemaker_uploadwith the file's name, size and type, then send it:curl -fsS -X PUT --upload-file "<path>" "<upload_url>". Ifupload_headersare returned, add each as a-H "<name>: <value>"argument exactly as given. A successful upload may have an empty response. Pollrevemaker_assetevery 2 seconds untilready, for up to 60 seconds, before calling the tool. If still pending, stop and report that validation is pending. If the asset is refused or missing, request a new upload. - Ask the user for any creative choice the tool lists.
- Create one new
idempotency_keyand callrevemaker_remove_backgroundwith the ready asset, those choices and that key. The call runs at once and charges the price in the tool description. Report the job ID and the credits it returns; retry only with the same key. - Poll
revemaker_jobevery 2 seconds, up to 60 seconds. Stop polling atdoneorfailed. Onfailed, tell the user it failed and nothing was charged, then stop. If 60 seconds pass withoutdone, tell the user the job is still running and give them its job ID so they can ask for it later; never submit the request again. - Only for
donewith a returned URL, download to a temporary file:curl -fsSL "<url>" -o "<name>-cutout.png.part". Check it is a non-empty PNG, then rename it to<name>-cutout.png. If the download fails, is empty or is not a PNG, delete only the.partfile and keep any earlier cutout. Ifdonecarries no URL and says the result expired, tell the user the output is no longer available and stop; a new run needs their say-so. Never read the image bytes into the conversation. - On any refusal, follow revemaker-rules: open
action.urlonly if present, wait forretry_after, stop oncontact_support, otherwise retry the same call with the same arguments and key. The same refusal again means the action is still pending. - Give the user the saved path. Apart from steps 4 and 5, do not mention tool names or job IDs.
