> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maition.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Image Resizer Filter

> Configure the Image Resizer Filter, which downscales oversized images in chat messages before they reach the model.

The **Image Resizer Filter** (`image_resizer`) is a mAItion **Filter**, not a Workspace Tool. It runs automatically on every **incoming** message, before the model ever sees it.

## Valves

| Field           | Required | Default | Description                                                                                                                                  |
| --------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `max_dimension` | no       | `768`   | Maximum image dimension, in pixels. Minimum `1`, no upper bound. Images with a larger dimension are downscaled; smaller ones are left as-is. |

The `max_dimension` valve can be edited after install from the filter's settings in mAItion.

## Enabling via ENV

Single-gate opt-in. Set in `.env`:

```bash theme={null}
FUNCTION_IMAGE_RESIZER_ENABLED=True
```

`FUNCTION_IMAGE_RESIZER_ENABLED=True` is the only required condition to install. `max_dimension` is UI-only and stays at its default until changed from the filter's settings.

<Note>
  This installs only during first-start initialization — the setup that runs only once, the first time the container boots, gated on a marker file. Setting `FUNCTION_IMAGE_RESIZER_ENABLED=True` on an already-running instance does not install it retroactively.
</Note>
