Unlocking High-Quality Realistic Pictures: Tips and Tricks with AWS Bedrock
Tags: bedrock
Published: 2024-03-17 13:18:23

## Why you should be familiar with Bedrock:

70% of enterprises leverage AI services for business growth and communication.
68% of marketing and event organizations use Generative AI to enhance user experience and engagement.
90% of customers believe Generative AI enhances existing sales services both online and in-store.
If your business isn't utilizing Generative AI yet, it's time to explore AWS Bedrock.

<br/>
## What Generative AI enables you to do:

Generate ideas, concepts, and drafts to boost human creativity.
Tailor personalized content based on individual preferences, improving user experience.
Automate content generation at scale, facilitating the production of large volumes.
Create realistic simulations.

<br/>
## What is AWS Bedrock?

<u>A fully managed service.</u>
Offers a range of high-performing foundation models (FMs) for building generative AI applications.

<u>playgrounds </u>
Provides interactive playgrounds for text, chat, and image exploration.

<u>Orchestration knowledge base </u>
Allows customization and fine-tuning of FMs using your own data while ensuring privacy, security, and compliance with standards like GDPR and HIPAA.

<u>Single agent API</u>
Offers a user-friendly Single agent API for easy application inference.

<u>Serverless architecture</u>
pay as you go, no long-term commitments, no infrastructure management, and automatic scalability. Focus on what you want to accomplish without worrying about connecting FMs with code.

<br/>
## Available Foundation Models:

AI21 Labs: Jurassic
Anthropic: Claude
Cohere: Command & Embed
Meta: Llama 2
Mistral AI: Mixtral 8x7B and Mistral 7B
Stability AI: Stable Diffusion XL
Amazon: Amazon Titan
Latest Supported Model: Claude 3

<br/>
## My Role:

Assisting financial service companies in adopting generative AI for streamlined development workflows and production-ready systems.
Focusing on foundation models Titan v1 (lite & express) and Claude 3.

<br/>
## Leveraging the Free Bedrock Environment:

China AWS provides a free bedrock environment for exploring Generative AI capabilities.
Generate countless pictures at no cost to showcase the performance of bedrock.

<br/>
## Creating Realistic Conceptual Pictures:

Developed a two-day Hong Kong on-site conference project for proof of concept.
Picture optimized for social media sharing to engage and captivate audiences.
Utilizing FMs Titan v1 and Claude 3 on AWS bedrock.

<br/>
## Enhancing Accuracy Tips and tricks:
Here are some methods to improve picture accuracy according to your expectations.

1 Bedrock's Limited Background Understanding
2 Bedrock's Hand Gesture Representation
3 Bedrock's Eye Contact and Quality

<br/>
## Issue: Bedrock's Limited Background Understanding

Bedrock often generates images with default, less exciting backgrounds, like crowded environment: Meetup, summit, conference.
Lack of comprehension about the venue's activities leads to less engaging visuals.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kpx16p4unkyys9j2wbhj.png)

<u>Creating Interesting Backgrounds:</u>

Use vivid descriptions to help Bedrock capture your desired atmosphere and emotions.
Incorporate more generic environment details like outdoor, indoor, night, or sunny settings.

<u>Desired Image Types:</u>
Cloudy joyful after-parties, outdoor meetups, nightclubs, and restaurants.
Bedrock excels at producing amazing pictures with a joyful, chilly atmosphere and cloudy backgrounds.

<u>Tips for Bedrock Usage:</u>
Utilize exciting descriptions to convey your imagination and emotions effectively.
Avoid using generic or unexciting descriptions that may result in boring default images.

<u>Advanced Tip for Background Fine-Tuning:</u>
To further customize the background, include additional generic environment descriptions like outdoor, indoor, night, or sunshine settings.
Example: After-party
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/99ijsri0dd7m51flrpm8.png)



<br/>
## Issue: Bedrock's Hand Gesture Representation

Bedrock often produces images with strange hand gestures and unrealistic figures when holding props like cups and bags.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tufs3ujiuz70bzqtizz8.png)


<u>Understanding Bedrock's Limitations:</u>
Hand gestures pose a challenge for many foundation models, not just Titan.
Changing the model won't resolve this issue.

<u>Tips for Better Hand Gestures:</u>
Avoid complex hand positions and actions like gripping a cup or holding a bag.
Foundation models excel at drawing fists or open palms without specific gestures.
Design tasks that involve props requiring a fist or open palm, such as controlling a joystick or holding a book.
Observe daily life to understand common hand gestures for more accurate representations.

<u>Good News:</u>
Foundation models can accurately depict hands forming a fist or showing the palm without any specific gesture.

<u>Examples of Avoiding Hand Gestures:</u>
Controlling a joystick (making a fist)
Holding a book (finger not interacting with the object, simple task)
Giving a thumbs-up (similar to making a fist)
DJ playing music on a panel (showing the back of the palm without any gesture)
Portrait shooting (crossing arms)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ubn6isom7j4tus424m90.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xqfxt3bvn0a6kz7tq9aa.png)




<u>Tips for Realistic Hand Gestures:</u>
Remember that foundation models lack human understanding and familiarity with human body structure.
Daily life observations can provide insights into natural hand gestures during various activities.

<u>Advanced Tip for Hand Gestures:</u>
To fine-tune hand gestures, consider using a backbone system that addresses both body and hand gestures directly.


<br/>
## Issue: Bedrock's Eye Contact and Quality

Bedrock often generates portrait images where models don't look at the camera or have unbalanced eye positions.
This results in odd and unprofessional pictures.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ggv12ny7ehvzfcuh3trb.png)


<u>Understanding the Eye Contact Challenge:</u>

Some foundation models struggle with portrait generation, and human sensitivity to eye contact exacerbates the issue.

<u>Improving Image Quality:</u>

Enhancing eye contact quality requires substantial effort and may not be suitable for proof of concept purposes.

<u>Utilizing Titan's Advantage:</u>

Titan produces better overall quality, including facial expressions and eye balance, especially for models wearing glasses.
Take advantage of this by incorporating "sunglasses" and specifying "under sunshine" to avoid strong eye contact.
This approach results in stylish and interesting images perfect for social media and conceptual art.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ef6tfaqiv2zdac5jf886.png)


<u>Making It More Engaging:</u>

Titan performs exceptionally well with specific topics like Formula 1 and engineering uniforms.
Utilize this expertise by creating images related to realistic engineering, leveraging the AWS community's engineering background.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3hix40kpt177dm4nhv6.png)


<br/>
## Tip for Random Results:

Generate images in batches of five and adjust the seed or introduce more random patterns to increase the chance of obtaining a masterpiece.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2e0g527vnx6sldgzi7qv.png)


<br/>
## Consider Singular vs. Plural:

Titan may overlook plural references, resulting in single individuals instead of groups.
To ensure accuracy, use phrases like "a group of models" to obtain the desired outcome.
Understanding Object Relationships:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c09r8p8bx4z8qumzwwsf.png)


<br/>
## Titan struggles to comprehend object relationships in images.

Avoid complex tasks involving multiple objects, as the results may be humorous or unexpected.
Simplify the tasks to ensure more accurate and reliable image generation

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xgggywuxcyjhutb5x0hi.png)



<br/>
## Why you need to learn prompt engineering:

<u>Importance of Prompt Engineering:</u>

Prompt engineering is an accessible skill to learn but requires effort to master.
It demands patience for trial and error, as well as luck to generate captivating images.

<u>Leveraging Model Advantages:</u>

Understand the model's strengths to generate high-quality images.
For example, Titan excels at depicting uniforms, sunglasses, and models in sunny environments.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5aapj6byy8ba6qzysadj.png)


<u>Avoiding Model Limitations:</u>

Identify the model's weaknesses and avoid utilizing them.
For instance, Titan struggles with hand gestures when holding cups or depicting closely grouped individuals.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2280ta351w29rkbcutt2.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ax3mgo9rm5cgmpnk8ctj.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p78ys87vxiyzgimbo3cl.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cu37msqbfqhbzk79w7q6.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xoa9ylrb597fck61shse.png)


<br/>
## Bedrock's Benefits: What bedrock can help you:

<u>Gaming Industry:</u>
 Quickly create conceptual art sets and demo videos for proof of concept projects.

<u>Entertainment Companies or Small Businesses: </u>
Generate venue visuals for floor plan collaboration with co-hosted parties.

<u>Multichannel Market Selling:</u>
 Create visually appealing graphics and context for upselling and cross-selling on platforms like Facebook, LinkedIn, and Twitter.