diff --git a/dotnetv3/Bedrock-runtime/Actions/InvokeModelAsync.cs b/dotnetv3/Bedrock-runtime/Actions/InvokeModelAsync.cs index 4838b916cd7..e2197db85c2 100644 --- a/dotnetv3/Bedrock-runtime/Actions/InvokeModelAsync.cs +++ b/dotnetv3/Bedrock-runtime/Actions/InvokeModelAsync.cs @@ -405,7 +405,7 @@ public static async Task InvokeTitanTextG1Async(string prompt) /// public static async Task InvokeTitanImageGeneratorG1Async(string prompt, int seed) { - string titanImageGeneratorG1ModelId = "amazon.titan-image-generator-v1"; + string titanImageGeneratorG1ModelId = "amazon.titan-image-generator-v2:0"; AmazonBedrockRuntimeClient client = new(RegionEndpoint.USEast1); diff --git a/dotnetv4/Bedrock-runtime/Actions/InvokeModelAsync.cs b/dotnetv4/Bedrock-runtime/Actions/InvokeModelAsync.cs index cf27b03b6d6..0e9164cc848 100644 --- a/dotnetv4/Bedrock-runtime/Actions/InvokeModelAsync.cs +++ b/dotnetv4/Bedrock-runtime/Actions/InvokeModelAsync.cs @@ -461,7 +461,7 @@ public static async Task InvokeTitanTextG1Async(string prompt) /// public static async Task InvokeTitanImageGeneratorG1Async(string prompt, int seed) { - string titanImageGeneratorG1ModelId = "amazon.titan-image-generator-v1"; + string titanImageGeneratorG1ModelId = "amazon.titan-image-generator-v2:0"; AmazonBedrockRuntimeClient client = new(RegionEndpoint.USEast1); diff --git a/gov2/bedrock-runtime/actions/invoke_model.go b/gov2/bedrock-runtime/actions/invoke_model.go index 338a9e84ae1..25ffea670b3 100644 --- a/gov2/bedrock-runtime/actions/invoke_model.go +++ b/gov2/bedrock-runtime/actions/invoke_model.go @@ -106,7 +106,7 @@ type TitanImageResponse struct { // Invokes the Titan Image model to create an image using the input provided // in the request body. func (wrapper InvokeModelWrapper) InvokeTitanImage(ctx context.Context, prompt string, seed int64) (string, error) { - modelId := "amazon.titan-image-generator-v1" + modelId := "amazon.titan-image-generator-v2:0" body, err := json.Marshal(TitanImageRequest{ TaskType: "TEXT_IMAGE", diff --git a/gov2/bedrock-runtime/actions/invoke_model_test.go b/gov2/bedrock-runtime/actions/invoke_model_test.go index c0aede5a8d2..86919469130 100644 --- a/gov2/bedrock-runtime/actions/invoke_model_test.go +++ b/gov2/bedrock-runtime/actions/invoke_model_test.go @@ -18,7 +18,7 @@ import ( ) const CLAUDE_MODEL_ID = "anthropic.claude-v2" -const TITAN_IMAGE_MODEL_ID = "amazon.titan-image-generator-v1" +const TITAN_IMAGE_MODEL_ID = "amazon.titan-image-generator-v2:0" const prompt = "A test prompt" diff --git a/gov2/bedrock-runtime/scenarios/scenario_invoke_models.go b/gov2/bedrock-runtime/scenarios/scenario_invoke_models.go index c995d71d4bc..dd192a777ef 100644 --- a/gov2/bedrock-runtime/scenarios/scenario_invoke_models.go +++ b/gov2/bedrock-runtime/scenarios/scenario_invoke_models.go @@ -112,7 +112,7 @@ func (scenario InvokeModelsScenario) InvokeTitanImage(ctx context.Context, promp if err != nil { panic(err) } - imagePath := saveImage(base64ImageData, "amazon.titan-image-generator-v1") + imagePath := saveImage(base64ImageData, "amazon.titan-image-generator-v2") fmt.Printf("The generated image has been saved to %s\n", imagePath) } diff --git a/gov2/bedrock-runtime/stubs/invoke_model_stubs.go b/gov2/bedrock-runtime/stubs/invoke_model_stubs.go index ea07ccf5923..7a6fa80f475 100644 --- a/gov2/bedrock-runtime/stubs/invoke_model_stubs.go +++ b/gov2/bedrock-runtime/stubs/invoke_model_stubs.go @@ -47,7 +47,7 @@ func StubInvokeModel(params StubInvokeModelParams) testtools.Stub { // OperationName: "InvokeModel", // Input: &bedrockruntime.InvokeModelInput{ // Body: requestBytes, -// ModelId: aws.String("amazon.titan-image-generator-v1"), +// ModelId: aws.String("amazon.titan-image-generator-v2:0"), // ContentType: aws.String("application/json"), // }, // Output: &bedrockruntime.InvokeModelOutput{ diff --git a/javav2/example_code/bedrock-runtime/src/main/java/com/example/bedrockruntime/models/amazonTitanImage/InvokeModel.java b/javav2/example_code/bedrock-runtime/src/main/java/com/example/bedrockruntime/models/amazonTitanImage/InvokeModel.java index c1dbe12aecb..7e47690fc31 100644 --- a/javav2/example_code/bedrock-runtime/src/main/java/com/example/bedrockruntime/models/amazonTitanImage/InvokeModel.java +++ b/javav2/example_code/bedrock-runtime/src/main/java/com/example/bedrockruntime/models/amazonTitanImage/InvokeModel.java @@ -30,8 +30,8 @@ public static String invokeModel() { .region(Region.US_EAST_1) .build(); - // Set the model ID, e.g., Titan Image G1. - var modelId = "amazon.titan-image-generator-v1"; + // Set the model ID, e.g., Titan Image G2. + var modelId = "amazon.titan-image-generator-v2:0"; // The InvokeModel API uses the model's native payload. // Learn more about the available inference parameters and response fields at: diff --git a/php/example_code/bedrock-runtime/BedrockRuntimeService.php b/php/example_code/bedrock-runtime/BedrockRuntimeService.php index c201f73e25b..ac3043eca18 100644 --- a/php/example_code/bedrock-runtime/BedrockRuntimeService.php +++ b/php/example_code/bedrock-runtime/BedrockRuntimeService.php @@ -109,7 +109,7 @@ public function invokeTitanImage(string $prompt, int $seed) $base64_image_data = ""; try { - $modelId = 'amazon.titan-image-generator-v1'; + $modelId = 'amazon.titan-image-generator-v2:0'; $request = json_encode([ 'taskType' => 'TEXT_IMAGE', 'textToImageParams' => [ diff --git a/php/example_code/bedrock-runtime/GettingStartedWithBedrockRuntime.php b/php/example_code/bedrock-runtime/GettingStartedWithBedrockRuntime.php index 787c2244a27..b7d5b16fcd0 100644 --- a/php/example_code/bedrock-runtime/GettingStartedWithBedrockRuntime.php +++ b/php/example_code/bedrock-runtime/GettingStartedWithBedrockRuntime.php @@ -37,7 +37,7 @@ public function runExample() echo "\n\nAmazon Titan Image Generation:\n"; $titanSeed = rand(0, 2147483647); $base64 = $bedrockRuntimeService->invokeTitanImage($image_prompt, $titanSeed); - $image_path = $this->saveImage($base64, 'amazon.titan-image-generator-v1'); + $image_path = $this->saveImage($base64, 'amazon.titan-image-generator-v2'); echo "The generated image has been saved to $image_path"; } diff --git a/python/example_code/bedrock-runtime/models/amazon_titan_image_generator/invoke_model.py b/python/example_code/bedrock-runtime/models/amazon_titan_image_generator/invoke_model.py index 8552a2f6650..40b6bc6fc2f 100644 --- a/python/example_code/bedrock-runtime/models/amazon_titan_image_generator/invoke_model.py +++ b/python/example_code/bedrock-runtime/models/amazon_titan_image_generator/invoke_model.py @@ -14,7 +14,7 @@ client = boto3.client("bedrock-runtime", region_name="us-east-1") # Set the model ID, e.g., Titan Image Generator G1. -model_id = "amazon.titan-image-generator-v1" +model_id = "amazon.titan-image-generator-v2:0" # Define the image generation prompt for the model. prompt = "A stylized picture of a cute old steampunk robot." diff --git a/python/test_tools/bedrock_runtime_stubber.py b/python/test_tools/bedrock_runtime_stubber.py index e9e0109cd1c..4e5cb83ddcf 100644 --- a/python/test_tools/bedrock_runtime_stubber.py +++ b/python/test_tools/bedrock_runtime_stubber.py @@ -150,7 +150,7 @@ def stub_invoke_stable_diffusion(self, prompt, style_preset, seed, error_code=No def stub_invoke_titan_image(self, prompt, seed, error_code=None): expected_params = { - "modelId": "amazon.titan-image-generator-v1", + "modelId": "amazon.titan-image-generator-v2:0", "body": json.dumps( { "taskType": "TEXT_IMAGE",