Stability AI’s best image generating models now in Amazon Bedrock - LEARNALLFIX

Stability AI’s best image generating models now in Amazon Bedrock

Stability AI’s best image generating models now in Amazon Bedrock

Stability AI’s best image generating models now in Amazon Bedrock

Starting today, you can use three new text-to-image models from Stability AI in Amazon Bedrock: Stable Image Ultra, Stable Diffusion 3 Large, and Stable Image Core. These models significantly improve multi-subject prompts, image quality, and typography performance. They can rapidly generate high-quality visuals for various use cases across marketing, advertising, media, entertainment, retail, and more.

These models produce images with stunning photorealism, boasting exceptional detail, color, and lighting. They address common challenges like rendering realistic hands and faces. The models’ advanced prompt understanding allows them to interpret complex instructions involving spatial reasoning, composition, and style.

The three new Stability AI models available in Amazon Bedrock cover different use cases:

Stable Image Ultra produces the highest–quality, photorealistic outputs, perfect for professional print media and large-format applications. It excels at rendering exceptional detail and realism.

Stable Diffusion 3 Large strikes a balance between generation speed and output quality. It is ideal for creating high-volume, high-quality digital assets like websites, newsletters, and marketing materials.

Stable Image Core—Optimized for fast and affordable image generation, this core is great for rapidly iterating on concepts during ideation.

This table summarizes the model’s key features:

Features Stable Image Ultra Stable Diffusion 3 Large Stable Image Core
Parameters 16 billion 8 billion 2.6 billion
Input Text Text or Image Text
Typography Tailored for
large-scale display
Tailored for
large-scale display
Versatility and readability across
different sizes and applications
Visual
aesthetics
Photorealistic
image output
Highly realistic with
finer attention to detail
Good rendering;
not as detail-oriented

One of the critical improvements of Stable Image Ultra and Stable Diffusion 3 Large compared to Stable Diffusion XL (SDXL) is text quality in generated images, with fewer errors in spelling and typography thanks to its innovative Diffusion Transformer architecture, which implements two separate sets of weights for Image and text but enables information flow between the two modalities.

Here are a few images created with these models.

Stable Image Ultra – Prompt: photo, realistic, a woman sitting in a field watching a kite fly in the sky, stormy sky, highly detailed, concept art, intricate, professional composition.

bedrock-sd3-ultra-example-1-300x300 Stability AI’s best image generating models now in Amazon Bedrock

Stable Diffusion 3 Large—Prompt: Comic-style illustration, male detective standing under a streetlamp, noir city, wearing a trench coat and fedora, dark and rainy, neon signs, reflections on wet pavement, detailed, moody lighting.

bedrock-sd3-large-example-300x300 Stability AI’s best image generating models now in Amazon Bedrock

Stable Image Core – Prompt: professional 3d render of a white and orange sneaker, floating in the center, hovering, floating, high quality, photorealistic.

Professional-3d-render-of-a-white-and-orange-sneaker-floating-in-center-hovering-floating-high-quality-photorealistic-300x300 Stability AI’s best image generating models now in Amazon Bedrock

Use cases for the new Stability AI models in Amazon Bedrock
Text-to-image models offer transformative potential for businesses across various industries and can significantly streamline creative workflows in marketing and advertising departments. They enable the rapid generation of high-quality visuals for campaigns, social media content, and product mockups. By expediting the creative process, companies can respond more quickly to market trends and reduce time-to-market for new initiatives. Additionally, these models can enhance brainstorming sessions, providing instant visual representations of concepts that can spark further innovation.

For e-commerce businesses, AI-generated images can help create diverse product showcases and personalized marketing materials at scale. In user experience and interface design, these tools can quickly produce wireframes and prototypes, accelerating the design iteration process. Adopting text-to-image models can lead to significant cost savings, increased productivity, and a competitive edge in visual communication across various business functions.

Here are some example use cases across different industries:

Advertising and Marketing

  • Stable Image Ultra for luxury brand advertising and photorealistic product showcases
  • Stable Diffusion 3 Large for high-quality product marketing images and print campaigns
  • Use Stable Image Core for rapid A/B testing of visual concepts for social media ads.

E-commerce

  • Stable Image Ultra for high-end product customization and made-to-order items
  • Stable Diffusion 3 Large for most product visuals across an e-commerce site
  • Stable Image Core to quickly generate product images and keep listings up-to-date

Media and Entertainment

  • Stable Image Ultra for ultra-realistic key art, marketing materials, and game visuals
  • Stable Diffusion 3 Large for environment textures, character art, and in-game assets
  • Stable Image Core for rapid prototyping and concept art exploration

Let’s see these new models in action, first using the AWS Management Console, then with the AWS Command Line Interface (AWS CLI) and AWS SDKs.

Using the new Stability AI models in the Amazon Bedrock console
I choose Model Access from the navigation pane in the Amazon Bedrock console to enable access to the three new models in the Stability AI section.

Now that I have access, I choose Image in the Playgrounds section of the navigation pane. For the model, I select AI Stability and Stable Image Ultra.

As prompt, I type:

A stylized picture of a cute old steampunk robot with in its hands a sign written in chalk that says "Stable Image Ultra in Amazon Bedrock".

I leave all other options to their default values and choose Run. After a few seconds, I got what I asked. Here’s the Image:

stability-ai-bedrock-robot-300x300 Stability AI’s best image generating models now in Amazon Bedrock

Using Stable Image Ultra with the AWS CLI
While still in the console Image playground, I choose the three small dots in the corner of the playground window and then View API request. In this way, I can see the AWS Command Line Interface (AWS CLI) command equivalent to what I just did in the console:

aws bedrock-runtime invoke-model \
--model-id stability.stable-image-ultra-v1:0 \
--body "{\"prompt\":\"A stylized picture of a cute old steampunk robot with in its hands a sign written in chalk that says \\\"Stable Image Ultra in Amazon Bedrock\\\".\",\"mode\":\"text-to-image\",\"aspect_ratio\":\"1:1\",\"output_format\":\"jpeg\"}" \
--cli-binary-format raw-in-base64-out \
--region us-west-2 \
invoke-model-output.txt

To use Stable Image Core or Stable Diffusion 3 Large, I can replace the model ID.

The previous command outputs the Image in Base64 format inside a JSON object in a text file.

To get the Image with a single command, I write the output JSON file to standard output and use the jq tool to extract the encoded Image and decode it on the fly. The output is written in the img.png file. Here’s the full command:

aws bedrock-runtime invoke-model \
--model-id stability.stable-image-ultra-v1:0 \
--body "{\"prompt\":\"A stylized picture of a cute old steampunk robot with in its hands a sign written in chalk that says \\\"Stable Image Ultra in Amazon Bedrock\\\".\",\"mode\":\"text-to-image\",\"aspect_ratio\":\"1:1\",\"output_format\":\"jpeg\"}" \
--cli-binary-format raw-in-base64-out \
--region us-west-2 \
/dev/stdout | jq -r '.images[0]' | base64 --decode > img.jpg

Using Stable Image Ultra with AWS SDKs
Here’s how to use Stable Image Ultra with the AWS SDK for Python (Boto3). This simple application interactively asks for a text-to-image prompt and then calls Amazon Bedrock to generate the Image.

import base64
import boto3
import json
import os

MODEL_ID = "stability.stable-image-ultra-v1:0"

bedrock_runtime = boto3.client("bedrock-runtime", region_name="us-west-2")

print("Enter a prompt for the text-to-image model:")
prompt = input()

body = {
    "prompt": prompt,
    "mode": "text-to-image"
}
response = bedrock_runtime.invoke_model(modelId=MODEL_ID, body=json.dumps(body))

model_response = json.loads(response["body"].read())

base64_image_data = model_response["images"][0]

i, output_dir = 1, "output"
if not os.path.exists(output_dir):
    os.makedirs(output_dir)
while os.path.exists(os.path.join(output_dir, f"img_{i}.png")):
    i += 1

image_data = base64.b64decode(base64_image_data)

image_path = os.path.join(output_dir, f"img_{i}.png")
with open(image_path, "wb") as file:
    file.write(image_data)

print(f"The generated image has been saved to {image_path}")

The application writes the resulting Image in a output directory that is created if not present. The code checks for existing files to avoid overwriting existing files to find the first file name available in the img_<number>.png format.

More examples of using Stable Diffusion models are available in the Code Library of the AWS Documentation.

Customer voices
Learn from Ken Hoge, Global Alliance Director, Stability AI, how Stable Diffusion models reshape the industry from text-to-image to video, audio, and 3D. Amazon Bedrock empowers customers with an all-in-one, secure, and scalable solution.

Step into a world where reading comes alive with Nicolette Han, Product Owner at Stride Learning. With support from Amazon Bedrock and AWS, Stride Learning’s Legend Library transforms how young minds engage with and comprehend literature by using AI to create stunning, safe illustrations for children’s stories.

Things to know
The new Stability AI models—Stable Image Ultra, Stable Diffusion 3 Large, and Stable Image Core—are available today in Amazon Bedrock in the US West (Oregon) AWS Region. With this launch, Amazon Bedrock offers broader solutions to boost creativity and accelerate content generation workflows. See the Amazon Bedrock pricing page to understand the costs for your use case.

The research paper describing the underlying technology provides more information on Stable Diffusion 3.

To start, see the Stability AI’s models section of the Amazon Bedrock User Guide. Visit the community to discover how others use generative AI in their solutions and learn from deep-dive technical content. Aws.

Share this content:

Leave a Reply

Your email address will not be published. Required fields are marked *