Saving images
samuelgdc opened this issue · 1 comments
Is it possible to save images on runpod? So I can be able to access them by the url returned?
To save all images on your Network Volume comment the rm -rf /workspace/outputs/files/*
in start.sh
and rebuild the image. Keep in mind you always need enough space on the volume to generate more and that we added this wiping to minimize storage footprint and cost.
Accessing them by URL, while technically possible, does not seem much practical on RunPod Serverless. You would have to do some modifications and make the node run long enough after the finished generation so your app can fetch it or start the node each time you would want an image. This is very inefficient.
A much better solution is to use this as a purely computing endpoint, return the images as Base64 in response and save/serve them from your app. For this use "require_base64": true"
in your request payload (see the new request_examples.js for more)
EDIT: Or you can modify your handler.py to save the results to some external storage or host. See this example for storing images to Amazon S3 bucket: https://docs.runpod.io/docs/using-s3-to-upload-files-with-serverless