> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ovalbee.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ovalbee.com/_mcp/server.

# Remove assets

> Removes images and videos, with their annotations, from an OvalBee dataset - all of them, or only the ones a second dataset also holds.

## Overview

Removes images and videos, together with their annotations, from a dataset. The assets themselves stay in OvalBee, only their membership in that dataset is dropped.

Use it after filtering or sampling when a flow needs to drop a known batch from the working dataset.

When a second dataset is provided, the node removes only assets present in both datasets.

```mermaid
flowchart LR
  n1["Dataset"] --> n2["Remove assets"] --> n3["Dataset"]
```

If it is not provided, the node removes every image and video from the source dataset.

```mermaid
flowchart LR
  n1["Remove assets"] --> n2["Dataset"]
```

## How it works

Collects the images and videos in the source dataset.

Keeps only assets that also appear in the assets dataset when one is set. Otherwise, targets every source image and video.

Removes the matched assets and the annotations linked to them, then refreshes the source statistics.

## FAQ

#### What does the node remove without an assets dataset?

Every image and video in the source dataset, plus the annotations linked to them.

#### Does removing an asset also remove its annotations?

Yes. The annotations linked to each removed asset leave the dataset with it. The badge counts the removed images and videos, not the annotations.

#### Are the assets deleted from OvalBee?

No. They lose their membership in the source dataset, but the underlying assets and files stay in OvalBee.

#### Can I undo a removal?

Not from a version. The node changes the source dataset in place and doesn't create a new dataset version first. The removed assets still exist in OvalBee, so if another dataset still holds them, such as the assets dataset, [Copy](/node-library/nodes/dataset-ops-copy) can add them back.

#### What happens when nothing matches?

The node stops the flow and leaves the source dataset unchanged.

## Inputs

**`From dataset`** `dataset` — required

Dataset that loses the assets. Annotations attached to them are removed as well. Key: `SRC_DATASET`.

---

**`Dataset (assets to remove)`** `dataset`

Dataset naming which assets to remove: only the ones it shares with the source are taken out. Leave empty to remove everything from the source dataset. Key: `ASSETS_DATASET`.

---

## Outputs

**`Dataset`** `dataset`

ID of the source dataset after removal. Key: `DATASET`.

---

**`Last Removed Assets Count`** `string`

Short badge with the number of assets removed in the latest run. Shown on the node as a badge. Key: `LAST_REMOVED_ASSETS_COUNT`.

---

## JSON config

Machine-readable node interface for automation and advanced usage.

#### Show JSON

```json
{
  "name": "Remove assets",
  "description": "Removes images and videos, with their annotations, from an OvalBee dataset - all of them, or only the ones a second dataset also holds.",
  "category": "Assets",
  "namespace": "ovalbee",
  "templateKey": "asset_ops/remove_assets",
  "version": "v1",
  "inputs": [
    {
      "key": "SRC_DATASET",
      "label": "From dataset",
      "type": "dataset",
      "description": "Dataset that loses the assets. Annotations attached to them are removed as well.",
      "required": true,
      "default": null,
      "visibleWhen": null,
      "options": {
        "creatable": false
      }
    },
    {
      "key": "ASSETS_DATASET",
      "label": "Dataset (assets to remove)",
      "type": "dataset",
      "description": "Dataset naming which assets to remove: only the ones it shares with the source are taken out. Leave empty to remove everything from the source dataset.",
      "required": false,
      "default": null,
      "visibleWhen": null,
      "options": {
        "creatable": false
      }
    }
  ],
  "outputs": [
    {
      "key": "DATASET",
      "label": "Dataset",
      "type": "dataset",
      "description": "ID of the source dataset after removal.",
      "artifact": false,
      "badge": false,
      "badgeOpens": null,
      "hidden": false
    },
    {
      "key": "LAST_REMOVED_ASSETS_COUNT",
      "label": "Last Removed Assets Count",
      "type": "string",
      "description": "Short badge with the number of assets removed in the latest run.",
      "artifact": false,
      "badge": true,
      "badgeOpens": null,
      "hidden": false
    }
  ]
}
```