reduce serverless execution time

My runpod api generation text to image. image generation is just use 1 sec but upload the generated image api call spend 4sec. How to reduce it? We have to provide image file to the user
3 Replies
justin
justin8mo ago
I don't think you'll get around the upload time, but you could do some testing with lazy loading in a placeholder image / do a preview image streaming? / maybe can you send over a compressed version of the image vs, and in the background load in the higher quality image This i think is just UX design, since the problem of large image uploading etc, is just a generic problem on the web
streamize
streamizeOP8mo ago
we want to reduce for execution time for reduce serverless api pricing not user experience so we don't consider fix UI. Just want to reduce execution time. Can we hosting network volume file or return base64 encoding image?
justin
justin8mo ago
I don't understand the workflow? You said the image generation is 1 second, but the upload is 4 seconds? so I assume you are uploading the file to some sort of data storage externally? Yes, you can return just the base64 directly - nothing stopping that as long as it is within the output size constraint of runpod Network storage, would probably just slow you down more, I don't know why that would decrease execution time? I'm assuming your current workflow looks like: def handler: 1. Generate image 2. Upload to external data source -> when the image is uploaded to external data source, your client is pulling that image down.
Want results from more Discord servers?
Add your server