Preflight the Pixels: Dry-Running an Upscale Batch So the Hold Matches Reality

A bulk upscale batch rarely fails because the model cannot scale pixels. It fails in the boring preflight: the manifest says 5,000 images, the folder holds 4,812, forty files are alpha-channel PNGs, and 600 inputs drift above the 1 MP pricing tier. The submit hold is calculated from the batch’s maximum billable units, not from the tidy story in the spreadsheet. That is why a dry run matters. It turns “about five thousand images” into a defensible count, a size distribution, and a hold estimate you can reconcile before you queue the real job.

For developers and operators, the goal is not to predict settlement to the cent. It is to make the gap between the hold and the actual bill small, explainable, and caused only by legitimate factors such as failures, cancellations, or alpha passes. The dry run is the evidence pack for that gap.

The Hold Is a Preflight Number, Not a Horror Story

Y-PAD’s published billing rule is specific: at submit, the platform holds the sum of max_units × list price; at settlement, you pay for succeeded units at the launch price if you hold a launch seat, otherwise at list; unused hold returns. Prices used are stored with the batch. For an upscale job, that means the hold is driven by the manifest’s maximum billable units, not by a vague “number of files” count. If your dry run inflates dimensions, ignores alpha channels, or includes duplicates, the hold can look scarier than the work. If it undercounts, the hold may not match the batch you actually submit.

Real-ESRGAN is a useful example because its published beta fare as of 7 Nov 2026 is simple: $0.0010 per image up to 1 MP input, pro rata above that up to 2 MP. List and launch are the same. One thousand opaque images at or below 1 MP cost $1.00 in the published worked example. An image with an alpha channel takes a second pass and costs the same, so the preflight must treat those files as two-pass items. Confirm the live pricing page before submitting, because these are provisional beta fares and may change; a submitted batch’s prices are fixed.

The hold is also a cash-flow and sequencing constraint. The first payment cannot exceed $25, and for seven days after first payment, the day’s charges and open holds together cannot pass $25. A dry run that predicts a $40 hold in that window is not a pricing problem; it is a scheduling problem. Split the batch, wait for the window, or reduce the first wave. This is why operators should calculate the hold before they upload the final set, not after the queue has already swallowed a large manifest.

Build a Dry Run That Reads the Files You Really Have

Start with a file inventory, not a filename list. For every candidate image, record format, file size, pixel dimensions, and whether it has an alpha channel. Real-ESRGAN accepts png, jpeg and webp, with a largest file size of 25 MB. Pricing runs up to 2 MP input, with pro-rata billing above 1 MP. That makes dimensions the variable that matters most: a folder of “small product shots” can contain a mix of 0.6 MP, 1.2 MP and 1.9 MP files, and each tier changes the estimated units. Alpha is the second multiplier; the published rule says a second pass costs the same.

Use the published model details to shape the manifest. The image upscale api page documents scale, formats and input limits, so the dry run can reject obviously out-of-scope files before they enter the batch. Then reconcile counts: the number of files in the upload set, the number of items in the batch, and the number of rows in your hold model should agree. Y-PAD allows up to 100 files a call and up to 2,000 items per batch; upload links last one hour. Those limits matter because a dry run that spans several calls can accidentally combine stale links, duplicate rows, or a partial folder.

Run a small pilot across the strata you care about: at least one sub-1 MP opaque image, one image above 1 MP, one alpha PNG, and one of each accepted format. Submit the pilot, poll for completion because there are no webhooks, and download the outputs. Compare the observed units and actual files against your estimate. The pilot will not prove model quality or guarantee latency; cold starts can take 10 to 30 seconds and occasionally minutes. It will prove that your manifest logic, file parsing and arithmetic survive contact with the API.

From Pilot to Production: A Worked Example and Edge Cases

Suppose a catalog team has 8,400 images. The dry run finds 6,000 opaque files at 0.8 MP, 2,000 opaque files at 1.4 MP, and 400 alpha PNGs at 0.8 MP. At the published Real-ESRGAN rate, the opaque 0.8 MP group estimates at 6,000 × $0.0010 = $6.00. The 1.4 MP group estimates at 2,000 × $0.0014 = $2.80. The alpha group takes two passes: 400 × $0.0010 × 2 = $0.80. The preflight hold estimate is $9.60. If 35 files fail validation or are cancelled, they cost nothing, and the unused hold returns at settlement. The point is not that $9.60 is a guarantee; it is that every dollar is traceable to a counted file and a published rule.

Edge cases should be handled before submission. Mixed formats can hide alpha in one format and not another, so inspect the decoded image rather than trusting the extension. Images above 2 MP sit outside the published Real-ESRGAN input range in the pricing notes, so flag them for resize or exclusion instead of letting them distort the hold. Duplicate filenames across upload calls can double-count items. If the batch exceeds 2,000 items, split it into explicit child batches and sum the holds, rather than relying on a single manifest that the API will not accept.

Finally, keep the operational boundaries visible. Failed and cancelled items cost nothing; only successful items are charged. Outputs stay seven days, so download promptly. The batch stores the prices used, which makes post-settlement reconciliation easier. Check the live pricing page before final submission because the beta fares carry check dates, and avoid comparing a launch seat price with a list price when you model the hold. Once the count, dimensions, alpha flags and hold estimate agree, submit the full batch. The hold should then match the images you actually have, not the images you assumed were in the folder.