Skip to content

LumaImageModel

Namespace: Vercel.AI.Luma

public sealed class LumaImageModel : IImageModel

Luma Dream Machine image model. It submits a generation, polls it, and downloads the image.

Inheritance: object

Implements: IImageModel

View source

LumaImageModel(LumaProvider, string, Func<DateTimeOffset>?)

Section titled “LumaImageModel(LumaProvider, string, Func<DateTimeOffset>?)”
public LumaImageModel(LumaProvider provider, string modelId, Func<DateTimeOffset>? clock = null)

Creates an image model. <code class=“paramref”>clock</code> sets the response timestamp.

Parameters

Name Type Description
provider LumaProvider
modelId string
clock Func<DateTimeOffset>

View source

public int MaxImagesPerCall { get; }

Luma returns one image per call.

Value: int

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id.

Value: string

View source

DoGenerateAsync(ImageCallOptions, CancellationToken)

Section titled “DoGenerateAsync(ImageCallOptions, CancellationToken)”
public Task<ImageGenerationResult> DoGenerateAsync(ImageCallOptions options, CancellationToken cancellationToken)

Generates images. Maps to doGenerate on an image model.

Parameters

Name Type Description
options ImageCallOptions
cancellationToken CancellationToken

Returns: Task<ImageGenerationResult>

View source

GenerateAsync(LumaImageRequest, CancellationToken)

Section titled “GenerateAsync(LumaImageRequest, CancellationToken)”
public Task<LumaImageGeneration> GenerateAsync(LumaImageRequest request, CancellationToken cancellationToken)

Generates one image.

Parameters

Name Type Description
request LumaImageRequest
cancellationToken CancellationToken

Returns: Task<LumaImageGeneration>

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product