mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-19 18:42:09 +00:00
docs: document image attachment resizing
This commit is contained in:
@@ -385,6 +385,35 @@ You can also configure [local models](/docs/models#local). [Learn more](/docs/mo
|
||||
|
||||
---
|
||||
|
||||
### Image attachments
|
||||
|
||||
OpenCode normalizes image attachments before sending them to the model. By default, images are resized when they exceed `2000x2000` pixels or `4718592` base64 bytes.
|
||||
|
||||
Configure image attachment limits with the `attachment.image` option:
|
||||
|
||||
```json title="opencode.json"
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"attachment": {
|
||||
"image": {
|
||||
"auto_resize": true,
|
||||
"max_width": 2000,
|
||||
"max_height": 2000,
|
||||
"max_base64_bytes": 4718592
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- `auto_resize` - Resize images that exceed the configured limits before provider requests. Set to `false` to reject oversized images instead.
|
||||
- `max_width` - Maximum image width in pixels before resizing or rejection.
|
||||
- `max_height` - Maximum image height in pixels before resizing or rejection.
|
||||
- `max_base64_bytes` - Maximum encoded image payload size. This is the base64 payload size, not the original file size.
|
||||
|
||||
If an image still cannot fit after resizing, OpenCode omits oversized tool-result images or fails oversized user-provided images with an image size error.
|
||||
|
||||
---
|
||||
|
||||
#### Provider-Specific Options
|
||||
|
||||
Some providers support additional configuration options beyond the generic `timeout` and `apiKey` settings.
|
||||
|
||||
Reference in New Issue
Block a user