Skip to Content
AgentsTask guidesReuse Elements

Reuse Elements

An Element is a saved visual reference — a product, a character, a logo, a lighting setup — built from up to eight images in your Assets library, written guidelines, or both. Every change to it makes a new, immutable version, and a generation names the exact version it uses. That is what keeps output on-model: the reference cannot change underneath a job.

Reading and managing Elements costs no AI credits and touches no canvas. Applying one happens inside an image generation, which is paid.

This page shows only how Elements are passed into a generation. The approval rule, destinations, waiting and retries are in Generate images. Start a generation only when the user asked for it in the current turn.

Scopes. Reading — list, get, history, collection list: element:read. Changing anything — create, update, collections, archive, restore, and collection create, rename or delete: element:write, which a token can only hold together with element:read (the MCP tools ask for both). Applying Elements: the generation’s own scopes, plus element:read whenever elements is set.

Three handles

HandleNamesUsed by
element:<id>The Element itselfEvery change, and element_history
element:<id>@v<n>One immutable versionelement_get and generation
element-collection:<id>A collectionThe collection tools and collectionIds

Every Element result carries handle (element:<id>) and versionHandle (element:<id>@v<n>). Take the pinned handle from versionHandle: it means the same thing on every surface, while a version record’s handle differs between the raw API and the CLI/MCP client.

Where each operation lives

The tool names are identical on the hosted and local MCP servers; over the REST API these are /elements and /element-collections — see Elements.

OperationMCP toolCLI
Searchelement_listgavana element list [query]
Read one versionelement_getgavana element get element:<id>@v<n>
Version historyelement_historygavana element history element:<id>
Createelement_creategavana element create
New versionelement_updategavana element update element:<id>
Set collectionselement_update_collectionsgavana element collections element:<id>
Archive / restoreelement_archive / element_restoregavana element archive / gavana element restore
List / create collectionselement_collection_list / element_collection_creategavana element collection-list / collection-create
Rename / delete a collectionelement_collection_update / element_collection_deletegavana element collection-rename / collection-delete
Applyelements on hosted generate_image_in_canvas or local image_generategavana image generate --element

A hosted connection with no profile lists only element_list, element_get and element_create; the other nine answer to their exact name, and ?profile=advanced lists all twelve. ?profile=creative leaves Elements out entirely, so calls fail with toolset_not_enabled. A read-only connection offers element_list, element_get, element_history and element_collection_list.

Route A — Find an Element and apply it

Call sequence

element_list → element_get (versionHandle) → [approval] → generation with elements: [versionHandle]

Find it

MCP: element_list with query, optional state (active, the default, or archived), limit 1–100, and cursor from page.nextCursor. The query matches an Element’s name, type and guidelines.

gavana element list "travel bottle" --jq '.elements[].versionHandle' -r gavana element list --state archived

Check. One Element, named by the user or unambiguous from the brief. On that result:

  • lifecycle is active. An archived Element cannot be applied, not even through an old pinned handle.
  • sourceHealth.status is available. When it is unavailable, unavailableSourceAssetIds lists the missing images and a generation with that version is refused.
  • versionHandle is the version you will read next.

Read the exact version

gavana element get element:BOTTLE_ID@v3 --pretty

Over MCP, call element_get with elementId: "element:BOTTLE_ID@v3". Both only accept a pinned handle. To compare versions, element_history (or gavana element history element:BOTTLE_ID) lists every version, newest first.

Check. Read type, applicationMode, sourceAssetIds and guidelines, and confirm this is the reference the user means. If they named a version, use that one, not the latest.

applicationModeWhat a generation does with it
creativeBorrows the treatment — palette, light, texture. The subject may change
identityKeeps a subject recognisable across poses and scenes. Guided, not pixel-exact
exactIts image is never sent to the model, which is told to leave the placements empty. The one transparent PNG is composited there, unchanged

Get approval

State which Elements and versions, which canvas, and what will be produced, and that it runs on the connected AI provider. Then wait.

Pass the pinned handles to the generation

Hosted generate_image_in_canvas and local image_generate take an elements array. Each entry is a pinned handle or an object:

{ "destination": "canvas:OWNER_UID:CANVAS_ID", "prompt": "The travel bottle on a wet stone ledge at dawn, soft side light", "idempotencyKey": "bottle-dawn-2026-10-05-a", "elements": [ "element:BOTTLE_ID@v3", { "handle": "element:DAWN_LIGHT_ID@v1", "role": "style", "influence": 0.6 } ] }
gavana image generate \ --destination "$TASK_CANVAS" \ --prompt "The travel bottle on a wet stone ledge at dawn, soft side light" \ --element element:BOTTLE_ID@v3 \ --element element:DAWN_LIGHT_ID@v1 \ --idempotency-key bottle-dawn-2026-10-05-a

--element takes plain handles only. For role, influence or placements, put elements in JSON with --json or --file — one form or the other, not both.

  • Up to 8 Elements per job, each pinned, no duplicates.
  • 16 images in total. Element source images and direct references share one limit of 16 per job, and the model may allow fewer.
  • role is identity, construction, texture, fit or style. Left out, it follows the type: identity for characters, products and brand marks, construction for environments, texture for materials, style otherwise. An Element is never the image being edited — that is source.
  • influence is a number from 0 to 1.
  • applicationMode overrides the stored mode only together with currentTurnUserModeOverride: true, and only when the user asked for it in this turn.
  • Guidelines of every Element are added to the prompt, and the prompt with its reference and Element instructions must fit 8,000 characters.

Exact Elements need placements: 1–16 normalized { x, y, width, height } rectangles inside the output, so x + width and y + height are at most 1. The CLI accepts them only as JSON:

gavana image generate --destination "$TASK_CANVAS" --idempotency-key launch-hero-2026-10-05-a --json '{ "prompt": "Launch hero: the bottle on a pale linen backdrop", "elements": [ "element:BOTTLE_ID@v3", { "handle": "element:LOGO_ID@v2", "placements": [{ "x": 0.72, "y": 0.05, "width": 0.22, "height": 0.1 }] } ] }'

Do not ask the model to redraw the mark in the same prompt: Gavana refuses an exact Element with redesign instructions.

Check before paying. preflight: true (hosted with a targetNodeId, local with targetNodeIds) or --preflight --target node:<id> resolves the Elements, applies every limit above and returns referencePlan and plannedResultClass without starting paid work. It needs an existing canvas and target node.

Read what you got

The finished image job reports resultClass: exact-composed only when an exact Element’s original pixels were composited, identity-guided when an identity reference guided the model, generated otherwise. Report identity-guided as guidance, not a guarantee of identical pixels.

Route B — Create and maintain Elements

Call sequence

asset upload | save_image_to_canvas → element_create → element_update (new versionHandle) element_collection_create → element_update_collections element_get (show it) → [approval] → element_archive ⇄ element_restore

Get the image in as an asset

An Element’s sources are asset: handles of images in your own Assets library. Nothing else is accepted, and creating an Element never extracts or cuts out a subject. Upload a local file with gavana asset upload ./bottle.png or the local asset_upload tool (filePath), or import a URL with hosted save_image_to_canvas and use the returned image.assetId. Save an image covers both routes and their scopes.

Create the Element

Run element_list first. element_create takes no idempotency key, so a repeated call makes a second Element.

{ "name": "Matte black travel bottle", "type": "product/object", "sourceAssetIds": ["asset:FRONT_ID", "asset:SIDE_ID"], "guidelines": "Matte black finish, brushed steel cap, embossed wordmark on the shoulder.", "collectionIds": ["element-collection:CAMPAIGN_ID"] }
gavana element create --name "Matte black travel bottle" --type product/object \ --source-asset asset:FRONT_ID --source-asset asset:SIDE_ID \ --guidelines "Matte black finish, brushed steel cap, embossed wordmark on the shoulder." \ --collection element-collection:CAMPAIGN_ID \ --jq '.element.versionHandle' -r
FieldRules
name1–160 characters. Required
typecharacter, product/object, environment, style, material/texture, lighting or brand/mark. Required
sourceAssetIdsUp to 8 unique asset: images you own. At least one source or guidelines
guidelinesUp to 2,000 characters
applicationModecreative, identity or exact. Omitted, it follows the type: exact for brand/mark, identity for character and product/object, creative for the rest
collectionIdsUp to 24 element-collection: handles. Only at creation; later, use the collections operation

A brand/mark Element defaults to exact, which needs exactly one PNG source. A mark made from guidelines alone, or from several images, is refused unless you set applicationMode to identity or creative. Transparency is checked later, when the exact composition runs.

Check. element.versionHandle in the response ends in @v1.

Make a new version

element_update (or gavana element update element:<id>) writes the next version, and it replaces the whole definition. Send name, type and every source and guideline you want to keep: an omitted applicationMode falls back to the type’s default, and omitted guidelines are removed. Element records list sources as bare ids, so send them back as asset:<id>.

gavana element update element:BOTTLE_ID --name "Matte black travel bottle" --type product/object \ --source-asset asset:FRONT_ID --source-asset asset:SIDE_ID --source-asset asset:NEW_CAP_ID \ --application-mode identity \ --guidelines "Matte black finish, knurled steel cap, embossed wordmark on the shoulder."

Changes take the unpinned element:<id>; a pinned handle is refused. An archived Element must be restored before it can be edited.

Check. Note the new versionHandle. Earlier outputs keep the version they were made with, and earlier pinned handles stay readable. Move to the new version only where the user wants it.

Organize into collections

Element collections are the same collections your Assets library uses. Create one with element_collection_create (name, 1–120 characters) or gavana element collection-create --name "Spring campaign"; rename with element_collection_update or collection-rename; list with element_collection_list or collection-list.

element_update_collections (elementId, collectionIds) and gavana element collections element:<id> --collection … replace the Element’s memberships rather than adding one. Read the current collectionIds from element_list, add the new one, and send the full list as element-collection:<id> handles. With no --collection at all, the CLI command clears every membership. Membership changes create no new version.

Deleting a collection (element_collection_delete with confirm: true, or gavana element collection-delete … --yes) removes the collection, never its Elements. Like archiving, it needs the user’s approval first.

Archive and restore

Archiving is recoverable, but it stops the Element being applied through any of its versions. Show the Element to the user and get explicit approval, then:

  • MCP: element_archive with elementId: "element:<id>" and confirm: true.
  • CLI: gavana element archive element:<id>. It asks interactively; a script passes --yes.

Restore with element_restore or gavana element restore element:<id>. It works only while every source image is still available in Assets.

Check. Archive and restore each add a version with unchanged content, so the current versionHandle moves on: re-read it before applying. No surface deletes an Element permanently.

What you end up with

  • A pinned element:<id>@v<n> the user confirmed, and the stable element:<id> behind it
  • Outputs whose resultClass says what the Elements actually did
  • After maintenance, a new versionHandle per change and element-collection: handles

When it fails

CLI exit codes: 2 invalid input, 3 missing scope, 4 conflict, 5 not found.

MessageCodeWhat to do
The Gavana tool input is invalid. (hosted MCP)request_failed, status 400fields names the problem — usually a handle in the wrong form, or neither sources nor guidelines
element get requires an exact element:<id>@v<n> revision handle. · Element mutations require the current element:<id> handle, not a pinned version.CLI usage errorReads and generation take @v<n>; changes take element:<id>
Add at least one source image or prompt instruction.input_validation_errorGive a source asset, guidelines, or both
Exact Elements require exactly one source image. · Exact Elements require one available PNG source image. …input_validation_errorGive one PNG, or set applicationMode — common with brand/mark
Every Element source must be an available image in your Assets library.input_validation_errorUpload or import the image first; it must be an image you own that is still available. Also blocks restore
Every Element collection must exist in your Assets library.input_validation_errorUse handles from element_collection_list
Use the Element collections operation to change collection membership.CLI usage errorelement update takes no --collection; use element collections
Restore this Element before editing it.conflictRestore it first, with the user’s approval
This Element was not found. · This Element version was not found.not_foundRe-list; never guess an id or a version number
element archive is destructive. Re-run with --yes in non-interactive mode.CLI usage errorPass --yes only after the user approved
Reconnect Gavana with the required permission: element:write. · This agent token is missing required permissions: …insufficient_scope (hosted) · forbiddenAsk the user to reconnect or issue a token with the scope
The Gavana tool element_archive is not enabled on this connection. …toolset_not_enabledThe connection’s profile or toolsets exclude Elements
Element references must be version-pinned handles. · Each --element must be a version-pinned element:<id>@v<n> handle.input_validation_error · CLI usage errorPass versionHandle
An image job can use up to 8 Elements. · An image job can use up to 16 combined direct and Element reference images.input_validation_errorDrop Elements or references
Exact Elements require at least one normalized placement. · Exact Element … must contain transparent pixels.input_validation_errorAdd placements; replace an opaque source with a cut-out PNG in a new version
Changing an Element mode requires explicit current-turn user confirmation.input_validation_errorLeave the stored mode, or ask the user
Canvas Control request failed. on a generation with Elementsinternal_errorAn archived Element, a missing version or source image, or more than 16 Element images is refused before the provider is called, but at origin/main that refusal is not mapped to a typed error. Re-read lifecycle and sourceHealth, fix it, and ask before trying again
Last updated on