Skip to content
lumalabs.ai
Videos

Video reframing

Reframe existing Ray 3.2 videos to a new aspect ratio with video_reframe.

type: "video_reframe" outpaints an existing video to a new target aspect ratio. The source video content is preserved frame-for-frame, and Ray 3.2 fills the newly exposed canvas area around it.

Reference a previous completed video generation with source.generation_id, then set the target aspect_ratio:

from luma_agents import Luma
client = Luma()
previous = client.generations.get("generation-id")
generation = client.generations.create(
model="ray-3.2",
type="video_reframe",
prompt="Extend the scene into cinematic widescreen",
aspect_ratio="21:9",
source={"generation_id": previous.id},
video={
"resolution": "720p",
},
)

Reframe needs exactly one source video, provided several ways.

A prior Luma generation — the completed generation’s top-level id:

{
"source": { "generation_id": "d290f1ee-6c54-4b01-90e6-d701748f0851" }
}

A hosted video URL — with a video/* source.media_type:

{
"source": {
"url": "https://example.com/source.mp4",
"media_type": "video/mp4"
}
}

Inline base64 video — with a video/* source.media_type:

{
"source": {
"data": "AAAAIGZ0eXBtcDQy...",
"media_type": "video/mp4"
}
}

An uploaded file — a video uploaded via the Files API, by its file_id (no media_type needed — it’s recorded at upload):

{
"source": { "file_id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789" }
}

A text description of how the new canvas area should be filled, 1-6,000 characters.

The target aspect ratio. Use one of the six Ray 3.2 video ratios:

ValueOrientation
9:16Standard portrait
3:4Portrait
1:1Square
4:3Classic landscape
16:9Standard widescreen
21:9Cinematic ultrawide

Output duration. Defaults to 5s.

ValueNotes
5sDefault
10sMaximum reframe output length

Reframe cannot produce output longer than 10s, and the source video is capped at the same 10s ceiling. To reframe a longer clip, split it into ≤10s segments and reframe each one.

Output resolution. Defaults to 720p; accepts 360p, 540p, 720p, and 1080p. 360p is the draft tier (fast, low-cost previews). 1080p works for landscape and square aspect ratios; vertical targets (9:16, 3:4) at 1080p are not yet available — use 720p, 540p, or 360p for those.

By default, Ray 3.2 fits the source video into the new canvas with a centered crop and outpaints the exposed area. To control exactly where the source sits inside the output canvas, pass video.source_position — a normalized rectangle measured as fractions of the output canvas:

FieldRangeMeaning
x_norm-2.02.0Left edge of the source rectangle, as a fraction of canvas width
y_norm-2.02.0Top edge of the source rectangle, as a fraction of canvas height
w_norm> 02.0Source rectangle width, as a fraction of canvas width
h_norm> 02.0Source rectangle height, as a fraction of canvas height

All four fields are required when source_position is present. x_norm / y_norm may be negative and w_norm / h_norm may exceed 1.0 (up to 2.0) when the source bleeds off-canvas — the model outpaints only the visible portion. Omit source_position to let the model pick its own centered-fit crop.

{
"video": {
"source_position": {
"x_norm": 0.25,
"y_norm": 0.0,
"w_norm": 0.5,
"h_norm": 1.0
}
}
}

video.source_position is only valid for type: "video_reframe"; setting it on any other type returns HTTP 400 with "video.source_position is only valid for type 'video_reframe'".

RuleConstraint
modelMust be ray-3.2
typeMust be "video_reframe"
promptRequired, 1-6,000 characters
aspect_ratioRequired; must be one of the Ray 3.2 video aspect ratios
sourceRequired. Provide exactly one of source.generation_id, source.url, or source.data
source.generation_idUUID of a prior completed video generation owned by the same client. No upload size limit — references stored media. The ≤10s duration cap still applies
source.urlPublicly reachable video URL. Requires source.media_type set to a video/* MIME (e.g. "video/mp4"). Max 200 MB, ≤10s
source.dataInline base64 video. Requires source.media_type set to a video/* MIME. Max 200 MB, ≤10s
video.durationOne of 5s, 10s, or omitted (defaults 5s). 10s is the maximum reframe output length
video.resolutionOne of 360p, 540p, 720p, 1080p, or omitted. 360p is the draft tier. 1080p works for landscape/square; vertical targets (9:16, 3:4) at 1080p return a “coming soon” 400
video.source_positionOptional normalized source rectangle (x_norm, y_norm, w_norm, h_norm). Only valid for video_reframe
video.hdr / video.exr_exportRejected — reframe is standard dynamic range only
video.loopRejected
video.editRejected
video.start_frame / video.end_frameRejected

A successful submit returns HTTP 201 with the same envelope as other generation requests. Poll GET /v1/generations/{id} until state is completed or failed; on completion, output[].url contains the presigned MP4 URL.

Reframe is priced per second at the standard-only reframe tier. HDR and EXR pricing do not apply because video_reframe rejects HDR and EXR. See Pricing — ray-3.2 per-video pricing.

  • Video generation — Generate videos from text, anchor images, or extend a prior video
  • Video editing — Restyle or reinterpret an existing video
  • Models — Capability matrix for every model
  • Pricing — Per-video pricing for Ray 3.2 video
  • Error handling — Every error code with troubleshooting steps
  • API Reference — Complete endpoint specifications