docs: document the experimental image_generate tool (#60105)

This commit is contained in:
Aiden Cline
2026-10-29 00:07:40 -05:00
committed by GitHub
Unverified
parent ecc075a043
commit 0ab13468fd
3 changed files with 39 additions and 0 deletions
+19
View File
@@ -627,6 +627,7 @@ All experimental settings live under the `experimental` key:
"subagent_depth": 2,
"portable_shell_scanner": true,
"background_compaction": true,
"image_generate": true,
"location_idle_timeout": "4 hours",
},
}
@@ -660,6 +661,24 @@ automatic compaction doesn't pause the session. Defaults to `false`. See
}
```
### Image generation
Set `image_generate` to `true` to give agents the [`image_generate`](/tools#image-generate) tool for creating and
editing images. It is offered only while a connected provider has an image model. Defaults to `false`.
To set a default model, use an object with `model` as `providerID/modelID`, optionally with `#variant`. When that model
isn't available or can't handle a request, OpenCode picks another image model automatically.
```jsonc
{
"experimental": {
"image_generate": {
"model": "openai/gpt-image-2",
},
},
}
```
### Location idle timeout
`location_idle_timeout` controls how long a project location can go without session activity before OpenCode unloads
@@ -118,6 +118,7 @@ currently use these actions and resources:
| `question` | `*` |
| `webfetch` | Requested URL |
| `websearch` | Search query |
| `image_generate` | Selected image model as `providerID/modelID`, plus `#variant` when set |
| `external_directory` | Canonical external directory boundary, normally ending in `/*` |
| `<server>_<tool>` | `*` for an MCP tool; unsupported characters in both names become `_` |
| `opencode_list_mcp_resources` | MCP server name |
+19
View File
@@ -157,6 +157,25 @@ Search the web for the latest Bun release notes.
Permission: `websearch` with the query as its resource. See [Websearch](/websearch)
for providers, selection, rate limits, and disabling the tool.
## Images
### Image generate
`image_generate` creates a new image from a prompt, or edits existing ones. It
is experimental and off by default; turn it on with
[`experimental.image_generate`](/config#image-generation). It appears only
while a connected provider has an image model.
```text
Generate a flat app icon of a paper plane on a blue background and save it to assets/icon.png.
```
Give it a `prompt`, and optionally `images` to edit or use as references, a
specific `model`, or a `path` to save to. It runs in the background and
notifies the session with the saved path when the image is ready.
Permission: `image_generate` with the selected model as its resource.
## Interaction
### Question