Skip to content

Commit 3e850fd

Browse files
matthew29tangcopybara-github
authored andcommitted
feat: Add VideoGenerationMaskMode enum for Veo 2 Editing
PiperOrigin-RevId: 806364189
1 parent 6d29c4c commit 3e850fd

File tree

5 files changed

+57
-6
lines changed

5 files changed

+57
-6
lines changed

api-report/genai-node.api.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3199,7 +3199,15 @@ export enum VideoCompressionQuality {
31993199
// @public
32003200
export interface VideoGenerationMask {
32013201
image?: Image_2;
3202-
maskMode?: string;
3202+
maskMode?: VideoGenerationMaskMode;
3203+
}
3204+
3205+
// @public
3206+
export enum VideoGenerationMaskMode {
3207+
INSERT = "INSERT",
3208+
OUTPAINT = "OUTPAINT",
3209+
REMOVE = "REMOVE",
3210+
REMOVE_STATIC = "REMOVE_STATIC"
32033211
}
32043212

32053213
// @public

api-report/genai-web.api.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3199,7 +3199,15 @@ export enum VideoCompressionQuality {
31993199
// @public
32003200
export interface VideoGenerationMask {
32013201
image?: Image_2;
3202-
maskMode?: string;
3202+
maskMode?: VideoGenerationMaskMode;
3203+
}
3204+
3205+
// @public
3206+
export enum VideoGenerationMaskMode {
3207+
INSERT = "INSERT",
3208+
OUTPAINT = "OUTPAINT",
3209+
REMOVE = "REMOVE",
3210+
REMOVE_STATIC = "REMOVE_STATIC"
32033211
}
32043212

32053213
// @public

api-report/genai.api.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3199,7 +3199,15 @@ export enum VideoCompressionQuality {
31993199
// @public
32003200
export interface VideoGenerationMask {
32013201
image?: Image_2;
3202-
maskMode?: string;
3202+
maskMode?: VideoGenerationMaskMode;
3203+
}
3204+
3205+
// @public
3206+
export enum VideoGenerationMaskMode {
3207+
INSERT = "INSERT",
3208+
OUTPAINT = "OUTPAINT",
3209+
REMOVE = "REMOVE",
3210+
REMOVE_STATIC = "REMOVE_STATIC"
32033211
}
32043212

32053213
// @public

sdk-samples/generate_videos_edit_outpaint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright 2025 Google LLC
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6-
import {GoogleGenAI} from '@google/genai';
6+
import {GoogleGenAI, VideoGenerationMaskMode} from '@google/genai';
77

88
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
99
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION;
@@ -35,7 +35,7 @@ async function generateVideosEditOutpaintFromVertexAI() {
3535
gcsUri: 'gs://genai-sdk-tests/inputs/videos/video_outpaint_mask.png',
3636
mimeType: 'image/png',
3737
},
38-
maskMode: 'OUTPAINT',
38+
maskMode: VideoGenerationMaskMode.OUTPAINT,
3939
},
4040
},
4141
});

src/types.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,33 @@ export enum VideoGenerationReferenceType {
733733
STYLE = 'STYLE',
734734
}
735735

736+
/** Enum for the mask mode of a video generation mask. */
737+
export enum VideoGenerationMaskMode {
738+
/**
739+
* The image mask contains a masked rectangular region which is
740+
applied on the first frame of the input video. The object described in
741+
the prompt is inserted into this region and will appear in subsequent
742+
frames.
743+
*/
744+
INSERT = 'INSERT',
745+
/**
746+
* The image mask is used to determine an object in the
747+
first video frame to track. This object is removed from the video.
748+
*/
749+
REMOVE = 'REMOVE',
750+
/**
751+
* The image mask is used to determine a region in the
752+
video. Objects in this region will be removed.
753+
*/
754+
REMOVE_STATIC = 'REMOVE_STATIC',
755+
/**
756+
* The image mask contains a masked rectangular region where
757+
the input video will go. The remaining area will be generated. Video
758+
masks are not supported.
759+
*/
760+
OUTPAINT = 'OUTPAINT',
761+
}
762+
736763
/** Enum that controls the compression quality of the generated videos. */
737764
export enum VideoCompressionQuality {
738765
/**
@@ -3414,7 +3441,7 @@ export declare interface VideoGenerationMask {
34143441
/** Describes how the mask will be used. Inpainting masks must
34153442
match the aspect ratio of the input video. Outpainting masks can be
34163443
either 9:16 or 16:9. */
3417-
maskMode?: string;
3444+
maskMode?: VideoGenerationMaskMode;
34183445
}
34193446

34203447
/** Configuration for generating videos. */

0 commit comments

Comments
 (0)