Reve API - Docs - v2/layouts

Layouts

With Reve's layout model, an image is a structure you can edit: every visual element is addressable in code. This page describes the layout object shared by the layout endpoints.

A layout (the layout field) is a structured JSON object describing the content and composition of an image. It has an optional prompt (the overall caption of the image), an optional normalized_edit_instruction (emitted by create_layout, and accepted by render_layout), optional width/height (the pixel dimensions of the layout's coordinate frame, emitted by the layout endpoints — always multiples of 32 — and used by render_layout to honor the layout's aspect ratio; when supplied on input, provide both, each a multiple of 32, with width * height between 30722560 and 40964096), and a regions array.

Regions

Each region describes a rectangular area within the image:

Overview

Every image input — a raw reference image, or the base image for extract_layout — is supplied as an object with exactly one of two fields:

Reference strings

References are intended mainly for reusing standard assets across many requests — scene backgrounds, logotypes, recurring characters, and the like — without re-sending the bytes every time.

Reference shape depends on the endpoint family: v2/image/create takes raw image objects directly in references. The layout pipeline endpoints take compound reference objects with an image and optional layout instead, so the model can relate pixels to structured regions.

Layout endpoints