Part 6 of 7 · Product image cleaner series ~6 min read

What the product image cleaner costs

A cleaner that costs more than the time it saves is a toy. This post is the cost breakdown: every AWS service this system touches, what each one adds up to at around 400 images a month, why the background-removal container is the single line that grows with use, and what happens to the total when the volume goes up tenfold.

Key takeaways

  • About $3.40/month at roughly 400 images, and almost nothing runs when no photos are coming in.
  • The single biggest variable line is the background-removal container Lambda, billed on memory × duration.
  • The only real fixed cost is Secrets Manager, at $0.40 per secret per month for the Drive and hosted-model keys.
  • Everything after the cutout — cropping, resizing, watermarking, publishing — rounds to cents, because it’s plain image arithmetic.
  • At ten times the volume (around 4,000 images) the bill lands near $13 — it scales with images processed, not with idle time.

Where the money goes

The cleaner is serverless end to end, so there’s no instance idling overnight and no bill while the folder is empty. You pay for a photo only when a photo arrives. At a typical small-shop volume — call it 400 images a month, of which most clear cleanly and a handful go to review — here’s the whole bill, line by line.

AWS serviceWhat it does hereMonthly
Lambda — background removalContainer image, arm64, ~6 GB, ~20–30s per image (~400)$0.90
Secrets ManagerTwo secrets — Drive sync key, hosted-model key ($0.40 each)$0.80
S3 (versioned)Originals plus the variant set per image, with lifecycle expiry on work/$0.55
Lambda — everything elseIngest, variants, publish, sweep — small Pillow zip functions$0.35
CloudWatch LogsFunction logs, 7-day retention$0.30
DynamoDB (on-demand)Job-status table — small reads and writes per job$0.20
SES / SNSOne ready-or-review notification per job$0.18
SQS + DLQBuffering between ingest, cutout, variants, and publish$0.07
EventBridgeS3 upload events plus the daily review sweep$0.05
AWS BudgetsCost alarm (first two budgets are free)$0.00
Total~400 images/month$3.40

The shape of that bill is the point. The one step that runs a model and chews real CPU — the cutout container — is the largest usage-priced line, and it’s still only a quarter of the total. Everything that does the visible work of making catalogue images — trimming, resizing, compositing, watermarking, publishing — barely registers, because it’s deterministic Pillow arithmetic running for a second or two in a small function. The biggest line on the whole table isn’t compute at all; it’s two secrets sitting in Secrets Manager whether or not a single photo arrives.

The container Lambda is the variable

Background removal is the only line that genuinely moves with how many photos you process, and it’s worth understanding why it costs what it does. Lambda bills on gigabyte-seconds: memory allocated multiplied by the time the function runs. At around 6 GB and twenty to thirty seconds per image, each cutout is on the order of 150 GB-seconds, and arm64 prices that at a fraction of a cent — so 400 of them land near $0.90. That’s also the lever you’d pull if the bill ever mattered: capping the working image’s longest edge in the ingest step (Part 2) directly shortens each cutout’s run, and the memory setting trades against duration, since more memory buys more CPU and a shorter run. The other functions don’t move the needle — they’re measured in single-digit cents no matter how busy you get.

Monthly cost split at about 400 images A single horizontal bar divided into proportional segments showing the $3.40 monthly total. From left: the background-removal container Lambda is the largest segment at $0.90; Secrets Manager $0.80; S3 $0.55; the other Lambdas combined $0.35; CloudWatch Logs $0.30; DynamoDB $0.20; and a final combined segment for SES/SNS, SQS, and EventBridge at $0.30. Labels sit around each segment. A note reads: only the background-removal container scales with volume; the largest fixed line is Secrets Manager at $0.40 per secret. Cutout $0.90 Secrets $0.80 S3 $0.55 Lambdas $0.35 Logs $0.30 DDB $0.20 rest $0.30 Monthly cost — ~400 images — total $3.40 Only the cutout container scales with volume; the largest fixed line is Secrets Manager, $0.40 per secret.
Fig 6. The monthly bill at about 400 images. The background-removal container and two secrets are nearly half of it; everything that builds and ships the catalogue images rounds to cents.

The one real fixed cost

It’s worth dwelling on Secrets Manager, because it’s the only thing here that costs money while the system sleeps. Two secrets at $0.40 each is $0.80 a month no matter what — nearly a quarter of the bill at this volume. One holds the Google Drive key for the watched-folder sync; the other holds the hosted-model key, and if you stick to the local U^2-Net engine you can drop that secret and shave $0.40 off. Everything else on the list is genuinely usage-priced and rounds toward zero at idle, which is exactly what you want from a system that only works when a photo lands.

One cost that is not an AWS line: if you choose the hosted background-removal API over the local model, that vendor charges per image, and those fees sit with them, not with AWS. The local engine is the default precisely so that a cutout costs only the Lambda seconds it runs for — no per-image third-party fee — which is what keeps the marginal cost of one more product photo down in the fraction of a cent.

What ten times the volume costs

Push this to a busy shop — 4,000 images a month, ten times the volume — and the bill lands somewhere near $13, not $34. It’s sub-linear because the fixed lines don’t move: Secrets Manager stays at $0.80, EventBridge stays at a few cents, and AWS Budgets stays free. What scales is the genuinely usage-priced work — roughly $9 of cutout compute for ten times the images, a bit more S3 storage, a little more in logs, DynamoDB, and notifications. Even then, the container Lambda is still the dominant cost, and the thing that does the visible work — the variants — stays close to free.

The honest way to read this: the AWS bill is rounding error against the alternative. Cleaning up 400 product photos a month by hand — cut out, square off, resize three ways, watermark — is a full day of dull editing every month; at 4,000 it’s a part-time job nobody wants. $3.40, or even $13, buys those hours back — and the few photos that genuinely came out wrong still get a human’s eye, with the original and the failed cutout already in front of them.

Design rules that shaped the cost

  • Pay per photo, not per hour. No always-on compute means no idle bill.
  • One heavy line, and you can tune it. The cutout’s cost is memory × duration; cap the input size to shorten the run.
  • Keep the cheap work cheap. Cropping, resizing, and watermarking are deterministic ops that run for a second or two.
  • Know your one fixed cost. Secrets Manager is the only line that bills while the folder is empty.
  • Prefer the local model. The default cutout has no per-image fee; a hosted API trades cents per image for quality.
All posts