Skip to content

Image handling ​

somora keeps every image in full resolution and shows models a scaled copy. Looking at a picture uses the copy. Working on a picture, such as editing it with an image model, uses the original.

What you get ​

  • Small requests. Every model is shown images at most attachments.maxImageEdge pixels on the longest side, 2048 by default.
  • Full quality where it counts. Tools that change an image get the original file, not the copy a model looked at.
  • Pictures an agent can hand on. A model is told where the original of every image in the chat is, so it can pass it to a tool.
  • One behaviour everywhere. The same rule holds on every engine and in every client.

How images arrive ​

Way inWhat is stored
Dragged or picked in the web clientThe original, in ~/.somora/attachments/
Picked or photographed in the mobile appThe original, in ~/.somora/attachments/
The screenshot button in the web clientThe full-resolution capture, stored like an upload
A file in the workspaceThe file itself
A browser screenshot (browser with op: "screenshot")A PNG in the workspace; the result names its path
An image an agent generatedA file in the images folder; the result names its path

Uploads are not scaled before they leave the browser. They are stored under a name made from their content, such as d8f1….jpg, so the same picture sent twice is kept once.

Looking at an image ​

Whatever path an image takes to a model, the model gets the scaled copy:

PathWhat the model gets
An image in the chat, for a model that can seeThe scaled copy, in the message
file_read on an imageThe scaled copy
analyze_fileThe scaled copy, described by a vision worker
decision_evaluate with imagesThe scaled copy, sent to the decision model
An image in the chat, for a model that cannot seeA vision worker's description of the scaled copy

The scaled copy is made once and kept next to the original as <original>.model-<edge>-<key>.<ext>. An image that already fits is sent as it is.

Working on an image ​

Tools that change or reuse a picture get the original file:

ToolWhat it gets
image_generate with reference_imagesThe original
video_generate with reference_imagesThe original

An agent names the file by its path. For a file in the workspace or a generated image that path is known. For an image sent in the chat, the model is told it.

The original path in the message ​

For every image in the chat, the model gets one line with the original:

text
[Image attachment "car.png" (6000×4000) — original, full resolution: /home/you/.somora/attachments/d8f1….png — what you are shown may be a scaled-down copy. Pass this path to tools that need the image file (for example image_generate reference_images); never pass a ".model-" copy.]

The line names the original's size as it is shown, so an upright phone photo reads as portrait, and its path. The size is left out when it cannot be read.

The line is part of the message on every engine, and later turns still see it, so the picture can be handed on. An attachment whose file is gone loses the line. An agent passes this path to tools. It never passes the path of a .model- copy: that is the small version.

Models without vision ​

A model without the image capability is not sent images. A vision worker describes each one, and its description goes into the message with the original path line. The description stays in the history. Without a vision worker, sending an image to such a model is refused.

Limits ​

SettingDefaultMeaning
attachments.maxImageEdge2048Longest side, in pixels, of the copy a model is shown. 0 sends images as they are.
attachments.maxImageBytes5 MBLargest image a model is sent, after scaling.
attachments.maxPerTurn10Attachments per message.

An upload may be larger than maxImageBytes: with scaling on, a source image of up to 50 MB is accepted and scaled before it reaches a model. Decision models have their own limits for images, listed on their page.

See also ​