Remove object
pedra_remove_objectRemove unwanted objects from a photo using a mask image. Returns the cleaned image URL, or saves it to a Pedra property gallery when a propertyId is provided.
Instructions
Remove an object from an image using a mask. Returns the cleaned image URL. Pass propertyId to save the result into that property's gallery instead of only returning a URL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional name for the original photo (e.g. its file name), up to 200 characters. Only used with propertyId: if the photo isn't in that property yet, it's saved there under this name in the same call and returned as source.name. A photo already in the property keeps its name. Never shown on the image. | |
| maskUrl | Yes | Mask image marking the region to remove: a public https:// URL, a data: URI, or a local file path. | |
| imageUrl | Yes | Source image: a public https:// URL, a data: URI, or an absolute path to a local image file on this computer (the file is read and inlined automatically). If the photo is on the user's device and can't be read from here (e.g. it's on their phone), get a link from pedra_create_upload_link. | |
| propertyId | No | Optional id of the Pedra property (from pedra_list_properties) this photo belongs to. When set, the result is saved into that property's gallery — visible and editable from the app — instead of only being returned as a URL. | |
| preserveAspectRatio | No | By default the output comes back at whatever size the AI model produces, which may not match the input's aspect ratio or resolution. Set to true to get the result at the exact width and height of the input image (center-cropped to the original aspect ratio, never stretched). Defaults to false. |