AWS lambda with large size library


I want to use "rembg" library with AWS lambda python function. I tried to upload rembg library code to lambda layer or function code. AWS says that library file size is too large to include to lambda. Could you tell me the way to use rembg library in AWS lambda?

asked a year ago1397 views
2 Answers

Have you tried using a Container image for Lambda - those can be up to 10 GB in size.

profile pictureAWS
answered a year ago

You have several limitations for AWS lambda

If your zip file is bigger that 50 MB and you can made a direct upload, upload de file to S3 and deploy from there.

Another option is use lambda layers. Package rembg as layer and you only need to upload the custom code.

If you are hitting the 250 MB limit for unzipped source code (including dependencies and lambdas), use a lambda container instead of .zip

answered 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.

Guidelines for Answering Questions