Skip to content
Merged
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
9 changes: 7 additions & 2 deletions examples/creative-studio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ Just run this script which has a step by step approach for you to deploy the inf
curl https://raw.githubusercontent.com/GoogleCloudPlatform/professional-services/refs/heads/main/examples/creative-studio/bootstrap.sh | bash
```

For better guidance, we recorded a video to showcase how to deploy Creative Studio in a completely new and fresh GCP Account:
https://the-deploy-example-video
For better guidance, [we recorded a video](./screenshots/how_to_deploy_creative_studio.mp4) to showcase how to deploy Creative Studio in a completely new and fresh GCP Account.

<video controls autoplay loop width="100%" style="max-width: 1200px;">
<source src="./screenshots/how_to_deploy_creative_studio.mp4" type="video/mp4">
Your browser does not support the video tag. You can <a href="./screenshots/how_to_deploy_creative_studio.mp4">download the video here</a>.
</video>


> **IMPORTANT:** In order to run this app, you will have to enable the [Vertex AI API](https://console.developers.google.com/apis/api/aiplatform.googleapis.com/overview) and the [IAM Service Account Credentials API](https://console.developers.google.com/apis/api/iamcredentials.googleapis.com/overview).

Expand Down
4 changes: 4 additions & 0 deletions examples/creative-studio/backend/src/auth/auth_guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def get_current_user(token: str = Depends(oauth2_scheme)) -> UserModel:
detail="Could not create or retrieve user profile.",
)

if not user_doc.picture:
user_doc.picture = picture
user_service.user_repo.update(user_doc.id, user_doc.model_dump())

return user_doc

except auth.ExpiredIdTokenError:
Expand Down
1 change: 1 addition & 0 deletions examples/creative-studio/backend/src/common/base_dto.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class GenerationModelEnum(str, Enum):
VTO = "virtual-try-on-preview-08-04"

# Video-Specific Models
VEO_3_1_PREVIEW = "veo-3.1-generate-preview"
VEO_3_FAST = "veo-3.0-fast-generate-001"
VEO_3_QUALITY = "veo-3.0-generate-001"
VEO_3_FAST_PREVIEW = "veo-3.0-fast-generate-preview"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CreateVeoDto(BaseDto):
min_length=1, description="The ID of the workspace for this generation."
)
generation_model: GenerationModelEnum = Field(
default=GenerationModelEnum.VEO_3_FAST,
default=GenerationModelEnum.VEO_3_1_PREVIEW,
description="Model used for image generation.",
)
aspect_ratio: AspectRatioEnum = Field(
Expand Down Expand Up @@ -213,6 +213,7 @@ def validate_video_generation_model(
) -> GenerationModelEnum:
"""Ensures that only supported generation models for video are used."""
valid_video_ratios = [
GenerationModelEnum.VEO_3_1_PREVIEW,
GenerationModelEnum.VEO_3_FAST,
GenerationModelEnum.VEO_3_QUALITY,
GenerationModelEnum.VEO_3_FAST_PREVIEW,
Expand Down
96 changes: 48 additions & 48 deletions examples/creative-studio/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/creative-studio/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"@angular/material": "^18.2.1",
"@angular/platform-browser": "^18.1.0",
"@angular/platform-browser-dynamic": "^18.1.0",
"@angular/platform-server": "^18.2.14",
"@angular/platform-server": "^18.1.0",
"@angular/router": "^18.1.0",
"@angular/ssr": "^18.2.21",
"@angular/ssr": "^18.1.2",
"express": "^4.18.2",
"file-saver": "^2.0.5",
"ngx-image-cropper": "^9.1.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export enum GenerationModelEnum {
IMAGEN_4_FAST = 'imagen-4.0-fast-generate-001',

// Video-Specific Models
VEO_3_1_PREVIEW = 'veo-3.1-generate-preview',
VEO_3_FAST = 'veo-3.0-fast-generate-001',
VEO_3_QUALITY = 'veo-3.0-generate-001',
VEO_2_FAST = 'veo-2.0-fast-generate-001',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
</div>

<div
class="grid grid-cols-1 lg:grid-cols-4 gap-4 mt-8"
class="grid grid-cols-1 lg:grid-cols-4 gap-4 mt-5"
[ngClass]="
(imagenDocuments?.presignedUrls?.length || 0) > 0 ? 'mb-8' : ''
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
</div>

<!-- Prompt Generator -->
<div class="grid grid-cols-1 lg:grid-cols-4 gap-4 my-8">
<div class="grid grid-cols-1 lg:grid-cols-4 gap-4 my-5">
<!-- Prompt Section -->
<div class="lg:col-span-2 flex flex-col justify-start items-start gap-4">
<div
Expand Down
26 changes: 15 additions & 11 deletions examples/creative-studio/frontend/src/app/video/video.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class VideoComponent implements AfterViewInit {
// This object holds the current state of all user selections.
searchRequest: VeoRequest = {
prompt: '',
generationModel: 'veo-3.0-generate-001',
generationModel: 'veo-3.1-generate-preview',
aspectRatio: '16:9',
numberOfMedia: 4,
style: null,
Expand All @@ -118,6 +118,10 @@ export class VideoComponent implements AfterViewInit {

// --- Dropdown Options ---
generationModels = [
{
value: 'veo-3.1-generate-preview',
viewValue: 'Veo 3.1 \n (Beta Audio)',
},
{
value: 'veo-3.0-generate-001',
viewValue: 'Veo 3 Quality \n (Beta Audio)',
Expand Down Expand Up @@ -415,16 +419,16 @@ export class VideoComponent implements AfterViewInit {
!this.isExtensionMode &&
!this.isConcatenateMode
) {
const veo2Model = this.generationModels.find(
m => m.value === 'veo-2.0-generate-001',
const veo31Model = this.generationModels.find(
m => m.value === 'veo-3.1-generate-preview',
);
if (veo2Model) {
this.selectModel(veo2Model);
if (veo31Model) {
this.selectModel(veo31Model);
this._snackBar.openFromComponent(ToastMessageComponent, {
panelClass: ['green-toast'],
duration: 8000,
data: {
text: "Veo 3 Fast doesn't support images as input, so we've switched to Veo 2 for you.",
text: "Veo 3 doesn't support images as input, so we've switched to Veo 3.1 for you.",
matIcon: 'info_outline',
},
});
Expand Down Expand Up @@ -1166,16 +1170,16 @@ export class VideoComponent implements AfterViewInit {
this._snackBar.open(snackbarMessage, 'OK', {duration: 5000});
}

const expModel = this.generationModels.find(
m => m.value === 'veo-2.0-generate-exp',
const veo31Model = this.generationModels.find(
m => m.value === 'veo-3.1-generate-preview',
);
if (expModel) {
this.selectModel(expModel);
if (veo31Model) {
this.selectModel(veo31Model);
this._snackBar.openFromComponent(ToastMessageComponent, {
panelClass: ['green-toast'],
duration: 8000,
data: {
text: "We've switched to the Veo 2 Exp model for you, as it's the only one that supports reference images.",
text: "We've switched to the Veo 3.1 model for you, as this one supports reference images.",
matIcon: 'info_outline',
},
});
Expand Down
2 changes: 1 addition & 1 deletion examples/creative-studio/infra/modules/platform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ module "frontend_service" {
resource_prefix = "cs-fe"
github_branch_name = var.github_branch_name
cloudbuild_yaml_path = "examples/creative-studio/frontend/cloudbuild-deploy.yaml"
included_files_glob = ["**/creative-studio/backend/**"]
included_files_glob = ["**/creative-studio/frontend/**"]

build_substitutions = merge(
var.fe_build_substitutions,
Expand Down
Binary file not shown.