Skip to content

Bedrock playground issue: generation_error sagemaker_inference.errors.BaseInferenceToolkitError: (400, 'generation_error', 'image dimensions must be multiples of 64, got 480x640')

0

Hi everyone,

I would like to try out an image generation model on playground and upload a image 480x640. but I keep getting this error message:

generation_error sagemaker_inference.errors.BaseInferenceToolkitError: (400, 'generation_error', 'image dimensions must be multiples of 64, got 480x640')

but if I know well 480x640 is multiplies of 64....

asked a year ago115 views

1 Answer
0
Accepted Answer

The error you're encountering is related to image dimension requirements for the Amazon Bedrock image generation model you're using. While 480 and 640 are indeed divisible by 64 individually (480 = 64 × 7.5 and 640 = 64 × 10), some image generation models in Amazon Bedrock require that both dimensions be exact multiples of 64, not decimal multiples.

In your case, 480 is not an exact multiple of 64 (as 7.5 is not an integer). The model is expecting dimensions that are precise integer multiples of 64, such as 512×640, 512×512, or 768×768.

To resolve this issue, you should resize your image to dimensions that are exact multiples of 64. For example, you could resize your 480×640 image to 512×640 (both dimensions are now exact multiples of 64: 512 = 64 × 8 and 640 = 64 × 10).

When using the Amazon Bedrock image and video playground, you can specify image dimensions and orientation for the generated images. Make sure to select dimensions that comply with the model's requirements to avoid this error.
Sources
Resolve errors when I fine-tune models on Amazon Bedrock | AWS re:Post
Generate an image with the Amazon Bedrock image and video playground - Amazon SageMaker Unified Studio

answered a year ago

EXPERT

reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.