Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add product advertising video generation use case preserving logo and text #22

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sgarcesv
Copy link

This PR introduces a new structure for image and video generation use cases with Amazon Nova Canvas and Amazon Nova Reel, including:

  • Initial use cases folder structure
  • First implementation: Product Advertising use case
  • Basic documentation and setup instructions

This use case focuses on addressing common challenges in product videography using Generative AI, specifically:

  • Background Transformation: Replacing product backgrounds seamlessly using outpainting techniques to create visually compelling environments.
  • Controlled Video Motion: Generating videos with background movement while keeping the product stationary, ideal for product showcases.
  • Logo and Text Preservation: Implementing a frame-by-frame overlay technique to prevent logo and text distortion during video generation.

By combining Amazon Bedrock's Nova Canvas and Reel models, we'll walk through a step-by-step process that enables creators and marketers to:

  • Dynamically place products in new, imaginative settings
  • Create short, engaging product videos
  • Maintain brand identity by preserving original product details

This workflow is particularly useful for:

  • E-commerce product marketing
  • Brand promotional content
  • Social media advertising
  • Product demonstration videos

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

@Krxtopher Krxtopher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File organization: Let's follow the patterns already used in the "multimodal-understanding" subfolder:

  1. Change "use-cases" folder name to "repeatable-patterns".
  2. Change "product-ad" to "01-product-video-ad".

Consistency: Multi-word folder names should use hyphens rather than underscores.

Consistency: Multi-word code files should use underscores rather than hyphens.

Remove extra files: We shouldn't store any contents of the "output" folder in this repo. Please delete the output folder and its contents.

@@ -0,0 +1,22 @@
# Amazon Nova Use Cases

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change title to "Amazon Nova Canvas and Nova Reel Repeatable Patterns".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

2. **Controlled Video Motion**: Generating videos with background movement while keeping the product stationary, ideal for product showcases.
3. **Logo and Text Preservation**: Implementing a frame-by-frame overlay technique to prevent logo and text distortion during video generation.

By combining Amazon Bedrock's Nova Canvas and Reel models, we'll walk through a step-by-step process that enables creators and marketers to:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to use the full name of the models on first mention. So rephrase to something like "By combining Amazon Nova Canvas and Nova Reel, accessed through Amazon Bedrock, we'll..."

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

- Social media advertising
- Product demonstration videos

This repository includes code examples for creating videos for product advertising using both Amazon Canvas image generation model and AmazonNova Reel video generation model. Follow the Jupyter Notebook [01_product_ad_generation.ipynb](01_product_ad_generation.ipynb) step by step guide. Sample images for use with these Jupyter Notebook have also been provided.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some model name, grammar, and formatting errors here. Should be "...both the Amazon Nova Canvas image generation model and Amazon Nova Reel video generation model."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, for consistency with the other read me, change "step by step" to "step-by-step".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small grammar error: Change "...with these Jupyter Notebook..." to "..with this Jupyter Notebook..."

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


### Prerequisites

- Your AWS account has been allow-listed for access to the model.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provide links whenever possible to help the customers who don't already have these prerequisites in place.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be a duplicate of "/multimodal-generation/image-generation/python/amazon_image_gen.py". I'd prefer that we don't duplicate code throughout the amazon-nova-samples repo due to the complexity in maintaining it. Is it possible to update your scripts to reference the other file instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I understand. Done, added:

sys.path.append('../../image-generation/python')
from amazon_image_gen import BedrockImageGenerator
import file_utils

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete all files in the "output" folder.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete all files in the "output" folder.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request 1: Let's not refer to the models as "Amazon Bedrock's Nova Canvas", etc. We wouldn't say "Amazon Bedrock's Claude Haiku" and we shouldn't attributed ownership of the Nova models to the Bedrock team, either. Just refer to them as "Amazon Nova Canvas" and "Amazon Nova Reel" (shortening to "Nova Canvas" and "Nova Reel" after first mention.)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request 2: Fix this copy-paste error:

It will replace the background behind the coffee maker...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request 3: Clear all cell outputs before committing the file to Git. When a user opens the Notebook, they shouldn't see any stale cell output.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request 4: In the resize_and_pad_image function definition, the pad_bottom and pad_right variables are set but never referenced, therefore, they are unnecessary and should be removed. If this doesn't seem correct, then there is a problem with that function's definition (Tip: I used VS Code to view this code and it pointed this out automatically to me.)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice-to-have (not critical!): It would be nice if the user could provide horizontal placement percentage rather than just "left", "center", "right" padding values. That way the user could shift the product anywhere they like, including 33% of the way from the left or right which is very common. See Rule of Thirds. Bonus points if they can also specify vertical position in the same way.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request 5: Find this sentence:

Modify the s3_destination_bucket and video_prompt variables at the start of the code below and then run the cell to start generating your video.

The video_prompt variable doesn't appear until one cell later. And the s3_destination_bucket variable doesn't appear until two cells later. Move the narrative references to these variables to immediately before the cell each appears in. Also, explain to the reader what you mean by "modify the (variable)". In the case of the S3 bucket, for example, the user has to specify the name of either a bucket that already exists in their account or a bucket name that is not likely to have already been used by another user.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request 6: Find the Markdown cell that begins...

The next code configures an asynchronous video generation process using Amazon Bedrock.

Move this to right above the cell it is describing. (Currently, it's appearing one cell too soon.)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request 7: When I ran through the notebook, when I finished generating the first video (before adding the overlay) there was some slight camera movement. Because of that, when I completed the overlay step, I got a video where. the overlay stood still but the rest of the video didn't which looked like a mistake. I suggest adding a note to the step where the initial video is create that warns users to regenerate the video if the output has camera movement in it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this video included in the repo? If it isn't needed, please remove it.

Copy link
Author

@sgarcesv sgarcesv Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove the folder, since it will get generated when generating the final video with the overlayed image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this video included in the repo? If it isn't needed, please remove it.

Copy link
Author

@sgarcesv sgarcesv Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove the folder, since it will get generated when generating the final video with the overlayed image

Copy link
Author

@sgarcesv sgarcesv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update after review as per suggested comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants