Overview
Tool identifierimage_edit.
image_edit performs image-to-image editing on a source image following a text instruction (replace elements, change style, and so on). The agent extracts the source image and the edit request from user input — you don’t construct the parameters by hand. It uses its own edit-model environment variable, MODEL_EDIT_NAME (note: different from image_generate’s MODEL_IMAGE_NAME).
Import path: from veadk.tools.builtin_tools.image_edit import image_edit
Environment & prerequisites
Environment variables:MODEL_EDIT_API_KEY: API key for the image-editing model; falls back toMODEL_AGENT_API_KEYand then tomodel.api_keyfrom the config file when unsetMODEL_AGENT_API_KEY: API key for the agent’s reasoning modelMODEL_EDIT_NAME: image-editing model nameMODEL_EDIT_API_BASE: image-editing model API endpoint; defaults to the ModelArk endpoint
Credentials are resolved at tool execution time, not at import time. Importing the tool module does not initialize a client or require credentials to be present.
config.yaml keys:
config.yaml
CLOUD_PROVIDER overrides media configuration. Capabilities and parameter limits depend on the selected model service. The editing model uses separate MODEL_EDIT_* settings.
Before running the example, set SOURCE_IMAGE_URL to a real image URL accessible to the editing service. The image is sent to the model service for processing.
Usage
examples/tools/image_edit/agent.py
Parameters and results
image_edit(params, tool_context) is asynchronous. It requires params: list[dict], while tool_context: ToolContext is injected during execution. Each request supports:
The result contains
status, success_list, and error_list. Success items map names to image URLs. status can be success when some items failed, so inspect the error list as well. b64_json results are uploaded to TOS first and require writable object storage configuration; the default url skips that upload. A fixed seed does not guarantee identical images across model versions.