FalImageModel
Namespace: Vercel.AI.Fal
public sealed class FalImageModel : IImageModel, IImageCallerFal image model. Posts to {baseURL}/{modelId} and downloads each returned image.
Inheritance: object
Implements: IImageModel, IImageCaller
Constructors
Section titled “Constructors”FalImageModel(FalProvider, string, Func<DateTime>?)
Section titled “FalImageModel(FalProvider, string, Func<DateTime>?)”public FalImageModel(FalProvider provider, string modelId, Func<DateTime>? clock = null)Creates an image model. <code class=“paramref”>clock</code> sets the response timestamp.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
FalProvider | |
modelId |
string | |
clock |
Func<DateTime> |
Properties
Section titled “Properties”MaxImagesPerCall
Section titled “MaxImagesPerCall”public int? MaxImagesPerCall { get; }Fal returns one image per call.
Value: int?
ModelId
Section titled “ModelId”public string ModelId { get; }Model id.
Value: string
Provider
Section titled “Provider”public string Provider { get; }Provider id.
Value: string
SpecificationVersion
Section titled “SpecificationVersion”public string SpecificationVersion { get; }Specification version.
Value: string
SupportsFileInputs
Section titled “SupportsFileInputs”public bool? SupportsFileInputs { get; }True when the model takes input images, false when it does not, null when unknown. Maps to supportsFileInputs.
Value: bool?
SupportsMaskInputs
Section titled “SupportsMaskInputs”public bool? SupportsMaskInputs { get; }True when the model takes a mask, false when it takes input images but no mask, null when unknown. Maps to supportsMaskInputs.
Value: bool?
Methods
Section titled “Methods”DoGenerateAsync(ImageModelCall, CancellationToken)
Section titled “DoGenerateAsync(ImageModelCall, CancellationToken)”public Task<ImageModelResult> DoGenerateAsync(ImageModelCall call, CancellationToken cancellationToken)Generates images.
Parameters
| Name | Type | Description |
|---|---|---|
call |
ImageModelCall | |
cancellationToken |
CancellationToken |
Returns: Task<ImageModelResult>
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>
ResolveMaxImagesPerCallAsync(CancellationToken)
Section titled “ResolveMaxImagesPerCallAsync(CancellationToken)”public Task<int?> ResolveMaxImagesPerCallAsync(CancellationToken cancellationToken)Resolves a functional per-call limit. The default returns MaxImagesPerCall.
Parameters
| Name | Type | Description |
|---|---|---|
cancellationToken |
CancellationToken |
Returns: Task<int?>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product