Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dotnetv3/Bedrock-runtime/Actions/InvokeModelAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public static async Task<string> InvokeTitanTextG1Async(string prompt)
/// </remarks>
public static async Task<string?> 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);

Expand Down
2 changes: 1 addition & 1 deletion dotnetv4/Bedrock-runtime/Actions/InvokeModelAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ public static async Task<string> InvokeTitanTextG1Async(string prompt)
/// </remarks>
public static async Task<string?> 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);

Expand Down
2 changes: 1 addition & 1 deletion gov2/bedrock-runtime/actions/invoke_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion gov2/bedrock-runtime/actions/invoke_model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion gov2/bedrock-runtime/scenarios/scenario_invoke_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion gov2/bedrock-runtime/stubs/invoke_model_stubs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion php/example_code/bedrock-runtime/BedrockRuntimeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion python/test_tools/bedrock_runtime_stubber.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading