Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions api-report/genai-node.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,7 @@ export interface GenerateVideosConfig {
personGeneration?: string;
pubsubTopic?: string;
referenceImages?: VideoGenerationReferenceImage[];
resizeMode?: ImageResizeMode;
resolution?: string;
seed?: number;
}
Expand Down Expand Up @@ -2082,6 +2083,12 @@ export enum ImagePromptLanguage {
zh = "zh"
}

// @public
export enum ImageResizeMode {
CROP = "CROP",
PAD = "PAD"
}

// @public
export interface ImageSearch {
}
Expand Down
7 changes: 7 additions & 0 deletions api-report/genai-web.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,7 @@ export interface GenerateVideosConfig {
personGeneration?: string;
pubsubTopic?: string;
referenceImages?: VideoGenerationReferenceImage[];
resizeMode?: ImageResizeMode;
resolution?: string;
seed?: number;
}
Expand Down Expand Up @@ -2082,6 +2083,12 @@ export enum ImagePromptLanguage {
zh = "zh"
}

// @public
export enum ImageResizeMode {
CROP = "CROP",
PAD = "PAD"
}

// @public
export interface ImageSearch {
}
Expand Down
7 changes: 7 additions & 0 deletions api-report/genai.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,7 @@ export interface GenerateVideosConfig {
personGeneration?: string;
pubsubTopic?: string;
referenceImages?: VideoGenerationReferenceImage[];
resizeMode?: ImageResizeMode;
resolution?: string;
seed?: number;
}
Expand Down Expand Up @@ -2082,6 +2083,12 @@ export enum ImagePromptLanguage {
zh = "zh"
}

// @public
export enum ImageResizeMode {
CROP = "CROP",
PAD = "PAD"
}

// @public
export interface ImageSearch {
}
Expand Down
13 changes: 13 additions & 0 deletions src/converters/_models_converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2771,6 +2771,10 @@ export function generateVideosConfigToMldev(
throw new Error('labels parameter is not supported in Gemini API.');
}

if (common.getValueByPath(fromObject, ['resizeMode']) !== undefined) {
throw new Error('resizeMode parameter is not supported in Gemini API.');
}

return toObject;
}

Expand Down Expand Up @@ -2944,6 +2948,15 @@ export function generateVideosConfigToVertex(
common.setValueByPath(parentObject, ['labels'], fromLabels);
}

const fromResizeMode = common.getValueByPath(fromObject, ['resizeMode']);
if (parentObject !== undefined && fromResizeMode != null) {
common.setValueByPath(
parentObject,
['parameters', 'resizeMode'],
fromResizeMode,
);
}

return toObject;
}

Expand Down
16 changes: 16 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,20 @@ export enum VideoCompressionQuality {
LOSSLESS = 'LOSSLESS',
}

/** Resize mode for the image input for video generation. */
export enum ImageResizeMode {
/**
* Crop the image to fit the correct aspect ratio (so we lose parts
of the image in the process).
*/
CROP = 'CROP',
/**
* Pad the image to fit the correct aspect ratio (so we don't lose
any parts of the image in the process).
*/
PAD = 'PAD',
}

/** Enum representing the tuning method. */
export enum TuningMethod {
/**
Expand Down Expand Up @@ -4534,6 +4548,8 @@ export declare interface GenerateVideosConfig {
compressionQuality?: VideoCompressionQuality;
/** User specified labels to track billing usage. */
labels?: Record<string, string>;
/** Resize mode of the image input for video generation. */
resizeMode?: ImageResizeMode;
}

/** Class that represents the parameters for generating videos. */
Expand Down
Loading