In a groundbreaking update announced at the AWS re:Invent 2024 conference, Amazon Bedrock has integrated the powerful Stable Diffusion 3.5 Large model, developed by Stability AI. This model is now accessible to users for generating high-quality images based on text descriptions. It is designed to enhance creative processes across industries such as media, gaming, advertising, and retail by facilitating the creation of concept art, visual effects, and detailed product imagery.
Unveiling Stable Diffusion 3.5 Large
Stability AI introduced the Stable Diffusion 3.5 Large model in October 2024, marking a significant advancement in the Stable Diffusion family. This sophisticated model, boasting 8.1 billion parameters, has been trained using Amazon SageMaker HyperPod, ensuring superior image quality and precise adherence to user prompts. Such capabilities make it an invaluable tool for storyboarding, crafting concept art, and rapidly prototyping visual effects. Users can effortlessly produce high-quality 1-megapixel images for various applications, including campaigns and social media, while maintaining creative control and saving valuable time and resources.
Features and Capabilities
Stable Diffusion 3.5 Large offers a wide array of creative possibilities:
- Versatile Styles: Users can generate images in a multitude of styles and aesthetics, ranging from three-dimensional renderings to line art and beyond.
- Prompt Adherence: The model excels in following text prompts closely, making it a preferred choice for those seeking efficiency and high-quality outcomes.
- Diverse Outputs: It can produce images that reflect the diversity of the world, featuring people of different skin tones and features, often without requiring detailed prompting.
Integration with Amazon Bedrock
Today, the integration of Stable Diffusion 3.5 Large into Amazon Bedrock’s architecture marks a new era in image generation. Known as Stable Image Ultra, this update promises excellence in typography, complex compositions, dynamic lighting, vibrant colors, and artistic cohesion. With this integration, users can leverage a broader array of solutions to boost creativity and streamline image generation workflows.
Getting Started with Stable Diffusion 3.5 Large
To begin using Stable Diffusion 3.5 Large in Amazon Bedrock, new users should navigate to the Amazon Bedrock console and select "Model access" from the menu. After requesting access to the latest Stability AI models, users can test these models by selecting "Image/Video" under "Playgrounds" in the left menu pane, and then choosing "Stability AI" as the category and "Stable Diffusion 3.5 Large" as the model.
For instance, to generate an image of a bustling Tokyo alley at night, users might input a prompt describing a scene where steam rises from food carts and colorful neon signs illuminate the rain-slicked pavement.
Utilizing the AWS CLI and SDKs
For those interested in accessing the model programmatically, Amazon provides examples using the AWS Command Line Interface (AWS CLI) and AWS SDKs. By utilizing the model ID
stability.sd3-5-large-v1:0
, users can generate images via single command executions. A sample AWS CLI command might look like this:bash<br /> aws bedrock-runtime invoke-model \<br /> --model-id stability.sd3-5-large-v1:0 \<br /> --body "\"text_prompts\":[{\"text\":\"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.\",\"weight\":1}],\"cfg_scale\":0,\"steps\":10,\"seed\":0,\"width\":1024,\"height\":1024,\"samples\":1" \<br /> --cli-binary-format raw-in-base64-out \<br /> --region us-west-2 \<br /> /dev/stdout | jq -r '.images[0]' | base64 --decode > img.jpg<br />
Implementing with Python
Developers can also use the AWS SDK for Python (Boto3) to create a simple application that prompts users for a text description and generates an image using Amazon Bedrock. The application saves the resulting image in an output directory, ensuring no existing files are overwritten.
python<br /> import base64<br /> import boto3<br /> import json<br /> import os<br /> <br /> MODEL_ID = "stability.stable-image-ultra-v1:1"<br /> <br /> bedrock_runtime = boto3.client("bedrock-runtime", region_name="us-west-2")<br /> <br /> print("Enter a prompt for the text-to-image model:")<br /> prompt = input()<br /> <br /> body = {<br /> "prompt": prompt,<br /> "mode": "text-to-image"<br /> }<br /> <br /> response = bedrock_runtime.invoke_model(modelId=MODEL_ID, body=json.dumps(body))<br /> <br /> model_response = json.loads(response["body"].read())<br /> <br /> base64_image_data = model_response["images"][0]<br /> <br /> i, output_dir = 1, "output"<br /> if not os.path.exists(output_dir):<br /> os.makedirs(output_dir)<br /> while os.path.exists(os.path.join(output_dir, f"img_{i}.png")):<br /> i += 1<br /> <br /> image_data = base64.b64decode(base64_image_data)<br /> <br /> image_path = os.path.join(output_dir, f"img_{i}.png")<br /> with open(image_path, "wb") as file:<br /> file.write(image_data)<br /> <br /> print(f"The generated image has been saved to {image_path}")<br />
Examples and Demonstrations
Below are some examples of images created using Stable Diffusion 3.5 Large, showcasing its ability to render diverse and complex scenes based on user prompts:
- Prompt: Full-body university students working on a tech project with the words "Stable Diffusion 3.5 in Amazon Bedrock" in cheerful cursive typography.
- Prompt: Photo of three potions in an old apothecary: a blue potion labeled "MANA," a red potion labeled "HEALTH," and a green potion labeled "POISON."
- Prompt: Photography of pink rose flowers in the twilight, with glowing tile houses in the background.
- Prompt: A 3D animation scene of an adventurer traveling the world with his pet dog.
Availability and Further Information
The Stable Diffusion 3.5 Large model is now generally available in Amazon Bedrock for the US West (Oregon) AWS region. Users are encouraged to check the full Region list for updates on future availability. To explore more about the model, visit the Stability AI in Amazon Bedrock product page and the Amazon Bedrock Pricing page.
For those ready to explore the capabilities of Stable Diffusion 3.5 Large, visit the Amazon Bedrock console. Feedback can be shared through AWS re:Post for Amazon Bedrock or via regular AWS Support channels.
This new integration marks a significant step forward in the field of AI-driven image generation, providing users with an unprecedented level of creativity and efficiency.
For more Information, Refer to this article.