The browser reads the image dimensions for immediate feedback. On upload, the server checks the actual image container, size, dimensions, and content moderation result, then stores the image under the signed-in account. Before generation, the server verifies that the stored reference belongs to that account.
The AI task sends the stored reference and the controlled scene instruction to the provider. The finished image is served through the authenticated result route, and task state, output ownership, credits, and refund handling stay in the existing server workflow. The provider is billed in USD; the site charges credits.
Credits are checked and consumed by the server for the replacement task. At the current provider rate of about $0.015 per 1K image, a 15-credit charge keeps a healthy margin above payment fees and storage costs.