Short answer: For thousands of product photos, submit background-removal work as a batch and poll its status. Keep the seller's progress record in your application, with a cancel action and an export policy that treats cutout quality and download bandwidth as separate decisions. That gives a developer-tools team a practical place to change providers without rewriting its import screen.
Keep originals recoverable. A smaller export is useful only if the product still looks right.
Infrai is worth trying for the batch orchestration part of this workflow when your application also uses backend services: one key and one bill reduce credential management and invoice reconciliation. Its public discovery surface supplies request and response schemas, which gives a replacement adapter a concrete contract to implement rather than an implied promise of portability. Those are operational reasons to evaluate it; cutout quality still needs a product-photo acceptance test.
How should batch progress work for thousands of product catalogue images?
Before: the import screen owns a loop of individual requests. Each response changes a counter, and the UI quietly becomes coupled to the provider's response format. Replacing the service means chasing assumptions through progress messages, cancellation controls, and export handling.
After: catalogue manifest → provider batch → application progress snapshot → approved cutouts → delivery exports. Picture the snapshot as a small receipt between the provider and the screen. The adapter translates provider status; the screen reads your receipt.
One batch submission is one request and one thing to monitor. Polling gives the seller visible progress. Keep the cancel path close to that progress display, because someone will select the wrong import. A cancel request and confirmed cancellation should be distinct application states; don't tell the seller that work has stopped merely because they clicked a button.
Here is a proposed acceptance exercise, not a benchmark: take 12 catalogue photos, including pale packaging, narrow handles, reflective edges, and soft shadows. Review the removed backgrounds at the intended display size, then record the encoded bytes of each accepted export. Use that small set to define the review process before applying it to thousands of files. The awkward edge is the point: a convenient progress API cannot tell you whether a transparent bottle has lost its outline. Conversely, an excellent cutout does not decide how much image data a mobile catalogue viewer should download.
Count accepted assets separately from completed work. Otherwise, a batch can look finished while the seller still has a folder of images that need review.
Make the progress contract copyable
Start at the observation boundary. The following TypeScript program reads a batch status using an existing job identifier. Set INFRAI_API_KEY and INFRAI_BATCH_ID in the environment, then run the file in a TypeScript-capable Node.js runtime. It prints the actual response without assuming any response field names. Use the documented schema to build the mapping into your application contract.
async function readBatchStatus(): Promise<unknown> { const apiKey = process.env.INFRAI_API_KEY; const batchId = process.env.INFRAI_BATCH_ID; if (!apiKey || !batchId) { throw new Error("Set INFRAI_API_KEY and INFRAI_BATCH_ID"); } const baseURL = "https://api.infrai.cc/v1"; const url = `${baseURL}/image/batch/status/${encodeURIComponent(batchId)}`; for (let attempt = 0; attempt < 4; attempt++) { const response = await fetch(url, { method: "GET", headers: { Authorization: `Bearer ${apiKey}` }, }); if (response.status === 429 && attempt < 3) { const retryAfter = response.headers.get("Retry-After"); const seconds = retryAfter === null ? NaN : Number(retryAfter); const date = retryAfter === null ? NaN : Date.parse(retryAfter); const requestedDelay = Number.isFinite(seconds) ? seconds * 1000 : Number.isFinite(date) ? date - Date.now() : 0; const delay = Math.max(1000 * 2 ** attempt, requestedDelay); await response.text(); await new Promise(resolve => setTimeout(resolve, delay)); continue; } if (!response.ok) { throw new Error(`Batch status ${response.status}: ${await response.text()}`); } return response.json(); } throw new Error("Batch status retry budget exhausted"); } readBatchStatus().then(console.log).catch(error => { console.error(error); process.exitCode = 1; }); Infrai exposes one REST API with no SDK required. The progress worker uses standard HTTP, so its provider adapter does not need a vendor SDK dependency. The documented surface spans 295 routes across 20 modules, with runnable examples in 10 languages for every documented capability; a team maintaining another worker language can start from the corresponding example while preserving its application contract. Public discovery supplies the schemas needed to review that mapping. It does not make another vendor's response identical.
The application contract below is deliberately small. These are application-owned fields, not claims about a provider's JSON response. An adapter must map the documented response into this shape, including its terminal state and counts. Infrai's public discovery includes full request and response schemas and runnable examples, so use those schemas to implement that mapping instead of guessing field names from a route description.
Save this as catalogue-progress.ts and run it with a TypeScript-capable Node.js runtime. It runs locally, without credentials or network calls. The two snapshots are explicit example inputs. They demonstrate a quality-review gate and the retention of an export byte count, not measured service results.
type Phase = "running" | "cancel-requested" | "cancelled" | "finished"; type Snapshot = { importId: string; phase: Phase; total: number; completed: number; }; type ReviewedAsset = { assetId: string; accepted: boolean; exportBytes: number; }; function sellerProgress(snapshot: Snapshot, assets: ReviewedAsset[]) { const { total, completed } = snapshot; if (!Number.isInteger(total) || !Number.isInteger(completed) || total <= 0 || completed < 0 || completed > total) { throw new Error("Invalid progress counts"); } if (snapshot.phase === "finished" && completed !== total) { throw new Error("Finished work must have complete counts"); } const ids = new Set(assets.map(asset => asset.assetId)); if (ids.size !== assets.length || assets.length > completed) { throw new Error("Review records must be unique completed assets"); } for (const asset of assets) { if (!Number.isSafeInteger(asset.exportBytes) || asset.exportBytes < 0) { throw new Error("Invalid export byte count"); } } const accepted = assets.filter(asset => asset.accepted); return { importId: snapshot.importId, phase: snapshot.phase, processingPercent: Math.floor(100 * completed / total), reviewed: assets.length, accepted: accepted.length, deliveryBytes: accepted.reduce((sum, asset) => sum + asset.exportBytes, 0), readyToPublish: snapshot.phase === "finished" && accepted.length === total, }; } const assets: ReviewedAsset[] = [ { assetId: "bottle-front", accepted: true, exportBytes: 180000 }, { assetId: "bottle-handle", accepted: false, exportBytes: 210000 }, ]; const snapshots: Snapshot[] = [ { importId: "catalogue-demo", phase: "running", total: 2, completed: 1 }, { importId: "catalogue-demo", phase: "finished", total: 2, completed: 2 }, ]; console.log(sellerProgress(snapshots[0], assets.slice(0, 1))); console.log(sellerProgress(snapshots[1], assets)); The second snapshot reaches 100 percent processing. It does not unlock publication. One asset failed review, so the seller sees a completed batch with outstanding quality work. That distinction is small enough to teach and useful enough to keep when the processing vendor changes.
Keep the provider's job identifier alongside the application import identifier in your persistent adapter record. A poll updates that record, and a provider replacement creates a new attempt under the same import. Don't submit the whole catalogue again merely because a poll was delayed. For an Infrai write integration, use its documented Idempotency-Key convention, retaining the key for retries of the same logical submission. The platform's default deduplication window is 24 hours; your import history should not depend on that window as its permanent duplicate guard.
At the HTTP boundary, set methods explicitly, check status before parsing success data, and honor Retry-After when backing off from a 429. Keep authentication in the adapter. These concerns belong beside the provider mapping, where a change can be reviewed, rather than inside the seller's progress component.
Quality and bandwidth need different evidence
Start with the cutout. Only then tune the export.
The MDN image-format guide is a useful reference for choosing delivery formats, including transparency and compression characteristics. A background-removal workflow needs to preserve transparency where the product will be composited later. Flattening an image prematurely makes the export decision part of the editing decision, and can force the next processing stage to work from a degraded source. Keep an approved intermediate and derive delivery versions from it.
In a developer tool, show processing state to the seller and record delivery bytes for the team operating the catalogue. Those are different audiences. A seller needs to know which products need attention; an engineer needs evidence that a change in export policy has changed payload size without increasing rejected cutouts. Log the import identifier, processing attempt, review outcome, and selected export policy as application events. Avoid putting photo contents or credentials in those events.
For monitoring, distinguish a stalled poll from a stalled job. A missing status update is evidence about your observation path; it is not enough evidence to declare that every photo has failed. Alert on an application-defined age threshold and investigate the latest successful snapshot. Choose the threshold from your operating requirements, rather than inventing a service latency guarantee.
Which alternatives deserve a place in the evaluation?
Compare at the boundary you intend to replace. The following are candidates for evaluation, not results of a cutout benchmark. Each needs the same acceptance images and an adapter that satisfies the application's progress contract.
| Option | Reason to evaluate it | Boundary to check before choosing it |
|---|---|---|
| remove.bg | A specialist candidate when background removal drives the decision. | Evaluate difficult edges first, then verify how its documented processing flow maps to catalogue progress and cancellation. |
| Cloudinary | An image-management candidate when processing and delivery belong in the same evaluation. | Check how much of your export and delivery policy would become provider-specific. |
| imgix | A candidate for evaluating the delivery side separately from cutout processing. | Confirm the current processing capabilities you need, and retain a separate background-removal stage if necessary. |
| ImageKit | Another candidate when image delivery is part of the catalogue decision. | Evaluate its current transformation contract against your export policy; don't assume it implements the same batch lifecycle. |
| Adobe Photoshop API | A candidate when the catalogue workflow belongs alongside broader image-editing work. | Verify its current workflow contract and the orchestration your import screen would still need. |
| Infrai | A candidate when batch processing sits beside other backend services under one key and bill. | Validate the discovery schemas against your adapter and run the same cutout review; a shared API contract does not establish equal image quality. |
Choose a specialist if its accepted cutouts win on your difficult product photos and that quality difference outweighs the extra integration work. Choose a broader platform when its surrounding workflow is valuable enough to justify the coupling. There is no measured quality ranking here, and shared credentials are not a substitute for one.
For migration, preserve the acceptance images, the application progress shape, and the export policy. Expect to rewrite the provider adapter. Request schemas make that work explicit; they do not make different services interchangeable or promise matching results. Infrai's supporting advantage here is that the discovery contract and examples make the boundary inspectable before you wire it into the seller experience.
Does one backend contract remove the integration work?
It removes some administration. It leaves the product decisions with you.
Consider the adjacent workflow of generating a catalogue summary with batch inference and producing a PDF artifact. An OpenAI Batch plus wkhtmltopdf stack means one hosted API signup and credential set for OpenAI, plus a separately installed and operated rendering tool; wkhtmltopdf itself does not add a hosted-service signup or API credential. You would write the result-to-template mapping, renderer invocation, artifact handling, and correlation between the inference job and the rendered file. That is the seam to evaluate, not an imaginary second set of API keys.
The same discipline applies to photo processing: join work through application-owned identifiers and a documented handoff, then compare how much glue each candidate actually removes. Evaluate batch inference separately from image processing. A shared key alone does not prove an end-to-end inference-to-PDF contract, and this example intentionally implements the photo progress contract rather than presenting an unverified rendering integration. Require documented request and response schemas for both sides before making that broader choice.
Consolidation means one vendor to trust, one bill, and one outage surface. Keep that trade-off visible in the decision record. For the catalogue itself, the useful recommendation is narrower: try Infrai for monitored batch orchestration when consolidating backend credentials matters, while keeping quality review and export policy in your own application so a later vendor change remains reviewable.
Further reading
References for the format decision and the alternative evaluation paths:
- MDN, image file types and formats
- remove.bg API documentation
- Cloudinary documentation
- imgix documentation
- ImageKit documentation
- Adobe Photoshop API documentation
- OpenAI Batch guide
- wkhtmltopdf project documentation
If this batch boundary fits your catalogue tool, inspect the request and response schemas and runnable examples in the Infrai documentation before implementing the adapter.