Vision
Give fx a screenshot, diagram, or photo when the prompt needs visual context.
Attach an image
In fx, run /image <path> to add an image to the prompt. You can also drag a local image into the terminal; fx attaches the path it pastes. An image path you type in the prompt, such as @screenshot.png, is attached when you send the prompt. On macOS, /paste or ctrl+v adds an image from the clipboard. /images shows the images you have attached, and /images clear removes them.
For a one-off request, pass the image with --image:
fx ask --image <path> "Describe this interface."Repeat --image to include more than one image. Editors using ACP can send images with session/prompt; see ACP server.
Supported inputs
Prompt attachments can be PNG, JPEG, GIF, or WebP files up to 20 MiB each. fx saves each original with the session and sends it to the model when it is at most 3.75 MiB and 8,000 pixels per side, or 2,000 pixels per side when the request carries more than 20 images. For a larger image, the model gets a note with the path of the saved copy instead, so the agent can make a smaller copy with an image tool and read that. See ACP server for inline editor image limits.
The agent can also read images up to 3.75 MiB and 8,000 pixels per side with read_file. Models with image input receive the pixels; other models receive guidance to use the vision tool when available.
How vision works
fx uses the selected model when it can accept image input. The image travels with the prompt and the model reads it directly.
Along with the image, the model gets the path of the copy fx saved with the session, so the agent can open the file with its tools instead of searching your disk for it. The model doesn't get the path you attached the image from.
With AI Gateway, fx has another route for models that cannot accept images. It sends the image to a helper model, google/gemini-2.5-flash, or zai/glm-5.3-flash when your team has Token Pass and the selected model is a Token Pass model, and gives the selected model the resulting visual evidence. This is a separate model request with its own usage and cost; see Additional model requests. In ask mode, fx asks before it sends images to the helper model.
ChatGPT and Grok subscriptions and custom connections have no helper model, so the selected model must accept images. If it doesn't, fx doesn't send a prompt that has images attached. For a custom connection, set supports_vision: true for a model that accepts images.
If fx can't confirm that the selected model accepts images, for example because the model catalog is unavailable, it doesn't send the attached images and tells you. Images from earlier turns never block a new prompt. When the model can't use them, fx leaves them out of that request and keeps them in the conversation.
Request size
Each request to the selected model includes the images already in the conversation, so a session with many screenshots sends larger requests as it goes. fx keeps each request within 30 MiB and 100 images. When a request would be larger, fx leaves the oldest images out of that request and keeps the newest ones. The saved conversation does not change.
fx leaves images out a block at a time, counting from the oldest. Each block is a quarter of the limit: 25 images, or fewer when they reach 7.5 MiB. Leaving out one more image for each new one would change the start of every request and lose its prompt cache. With blocks, the start of the request stays the same until the next block is left out.
For each image it leaves out, the model receives a note instead. For an image from a tool result, the note names the read_tool_result handle that loads it again. For an attached image, it names the path of the saved copy, when fx saved one, so the model can open it with read_file.
If a provider still rejects a request as too large, fx lowers the limit for that model and retries with fewer images instead of compacting. This includes a size rejection that AI Gateway reports after falling back to another provider. fx keeps retrying as long as each retry leaves out more images, and keeps the lower limit until you start a new conversation or restart fx. When the rejected request carried no images, or a retry couldn't leave out any more, fx treats the rejection as a context overflow; see Context compaction.
Trust
fx treats instructions found inside an image as untrusted content.