replicate-python icon indicating copy to clipboard operation
replicate-python copied to clipboard

How to deploy images to my own S3 server?

Open unsanny opened this issue 1 year ago • 2 comments

Hi, I do like to use text-to-image and image-to-image from replicate and I do have a very time consuming in terms of code and performance process to redeploy images from replicate to my own s3.

For example I do use upscaling

  • It runs on replicate for 1s
  • Image uploaded to replicate server and if request is done through api it removes from server during an hour or less
  • On backend part I do download an image and image can weight even 10mbs that takes another second
  • I do upload this image to my own s3 as it always expected from me, right?

In this case I need to upload from replicate endpoint image to my S3 server that will dramatically save my servers performance and speed by removing extra steps. I will really appreciate this feature and very believe that this is very desirable by community as a lot of similar services do provide this feature.

unsanny avatar Apr 01 '24 12:04 unsanny

If you currently use python to send request for Image Generation or upscaling purpose, you can use boto3 sdk or aiobotocore for asynchronous processing and send generated image to S3.

ghost avatar Nov 05 '24 06:11 ghost

This is not about to make things done on my server, I have no issues with it. It is more about to deploy images directly into S3 by replicate as it will improve the whole flow performance. Current flow:

  • You sent any image generation request

  • After a while you receive a web hook with image stored on replicate

  • You need to download an image from replicate storage

  • You upload it to S3 Flow that I need:

  • You sent any image generation request

  • In some way S3 settings is configured, for example in settings.

  • After a while you receive a web hook with image stored on your s3 bucket

unsanny avatar Nov 05 '24 13:11 unsanny