![]() |
As we previewed at AWS re:Invent 2024, you can now use Stable Diffusion 3.5 Large in Amazon Bedrock to generate high-quality images from text descriptions in a wide variety of styles to accelerate the creation of concepts, visual effects, and detailed products. images for customers in media, gaming, advertising and retail.
In October 2024, Stability AI introduced Stable Diffusion 3.5 Large, the most powerful model in the Stable Diffusion family with 8.1 billion parameters trained on Amazon SageMaker HyperPod, with excellent quality and fast adhesion. Stable Diffusion 3.5 Large can accelerate storyboarding, concept creation and rapid prototyping of visual effects. You can quickly generate high-quality 1-megapixel images for campaigns, social media posts and ads, saving time and resources while maintaining creative control.
Stable Diffusion 3.5 Large offers users almost endless creative possibilities, including:
- Versatile styles – You can generate images in a wide variety of styles and aesthetics, including 3-dimensional, photography, painting, line art, and virtually any visual style you can imagine.
- Fast adhesion – You can use Stable Diffusion 3.5 Large’s advanced fast compliance to accurately track text prompts, making it the best choice for efficient and high-quality performance.
- Various outputs – You can create images that represent the diverse world around you, depicting people with different skin tones and features, without the need for extensive challenges.
Today, Stable Image Ultra in Amazon Bedrock was updated to include Stable Diffusion 3.5 Large in the base model architecture. Powered by the most advanced Stability AI models, including Stable Diffusion 3.5, Stable Image Ultra sets a new standard in image generation. It stands out for its typography, complex compositions, dynamic lighting, vivid colors and artistic coherence.
With the latest update to Stable Diffusion models in Amazon Bedrock, you have a broader set of solutions to boost your creativity and speed up your image generation workflows.
Start with Stable Diffusion 3.5 Large in Amazon Bedrock
Before you begin, if you’re new to Stability AI models, go to the Amazon Bedrock console and select Access to the model in the lower left panel. To access the latest Stability AI models, request access for Stable diffusion 3.5 Wide in Stability AI.
To test Stability AI models in Amazon Bedrock, select Picture under Children’s playgrounds in the left menu pane. Then take your pick Select a model and select AI stability as category a Stable diffusion 3.5 Wide like a model.
You can use the prompt to generate an image. Here is a sample call to create an image:
High-energy street scene in a neon-lit Tokyo alley at night, where steam rises from food carts, and colorful neon signs illuminate the rain-slicked pavement.
By choosing View API requestyou can also access the model using code examples in the AWS Command Line Interface (AWS CLI) and the AWS SDK. You can use stability.sd3-5-large-v1:0
as the model ID.
To get the image with a single command, I write the output JSON file to stdout and use jq to extract the encoded image so it can be decoded on the fly. The output is written in the img.png file.
Here is a sample AWS CLI command:
$ aws bedrock-runtime invoke-model \
--model-id stability.sd3-5-large-v1:0 \
--body "{\"prompt\":\"High-energy street scene in a neon-lit Tokyo alley at night, where steam rises from food carts, and colorful neon signs illuminate the rain-slicked pavement.\",\"mode\":\"text-to-image\",\"aspect_ratio\":\"1:1\",\"output_format\":\"jpeg\",\"seed\":0}" \
--cli-binary-format raw-in-base64-out \
--region us-west-2 \
/dev/stdout | jq -r '.images(0)' | base64 --decode > img.jpg
Here’s how you can use Stable Image Ultra 1.1 to include Stable Diffusion 3.5 Large in your base model architecture using 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 stability.stable-image-ultra-v1:1
as the model ID.
import base64
import boto3
import json
import os
MODEL_ID = "stability.stable-image-ultra-v1:1"
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 to a file output
directory that is created if not present. To avoid overwriting existing files, the code checks existing files to find the first file name available with the extension img_<number>.png
format.
To learn more, visit the Invoke API examples using the AWS SDKs to build image generation applications using different programming languages.
Interesting examples
Here are some images created with Stable Diffusion 3.5 Large.
![]() |
![]() |
Prompt: Full-body university students working on a tech project with the words Stable Diffusion 3.5 in Amazon Bedrock, cheerful cursive typography font in the foreground. |
Prompt: Photo of three potions: the first potion is blue with the label "MANA", the second potion is red with the label "HEALTH", the third potion is green with the label "POISON". Old apothecary. |
![]() |
![]() |
Prompt: Photography, pink rose flowers in the twilight, glowing, tile houses in the background. |
Prompt: 3D animation scene of an adventurer traveling the world with his pet dog. |
Now available
The Stable Diffusion 3.5 Large model is now generally available from Amazon Bedrock in the AWS West USA (Oregon) region. Check out the full list of regions for future updates. To learn more, see the Stability AI at Amazon Bedrock product page and the Amazon Bedrock Pricing page.
Try Stable Diffusion 3.5 Large in the Amazon Bedrock console today and submit your feedback to AWS re:Post for Amazon Bedrock or through your usual AWS support contacts.
— Channy
Updated December 19, 2024 — Fixed the AWS CLI command to invoke the model.