docker-diffusers-api icon indicating copy to clipboard operation
docker-diffusers-api copied to clipboard

[storage] Cloudflare R2 support

Open gadicc opened this issue 2 years ago • 4 comments

There has been a lot of interest around Cloudflare's R2 support too... I don't use it personally but will happily accept a PR for this (see e.g. https://github.com/kiri-art/docker-diffusers-api/tree/dev/utils/storage), or if will implement it myself if no one else does provided there's sufficient interest among docker-diffusers-api users (you can thumbs up this issue if it's important to you).

gadicc avatar Nov 23 '22 12:11 gadicc

Lol, I didn't actually realise the Cloudflare R2 was S3-compatible. So, I'd be very, very surprised if this wasn't working already, just set the build-arg:

AWS_S3_ENDPOINT_URL="https://<accountid>.r2.cloudflarestorage.com"

and it should work out the box! (set also the other AWS_S3_ args too, of course, as per docs/storage.md).

@jd0713 if you already have a cloudflare account maybe you could let us know some speeds from banana, if relevant. (I guess it's only relevant if you're using the dreambooth training, or otherwise have some hosted model on R2... if not, let me know your use case ^_^)

gadicc avatar Dec 07 '22 20:12 gadicc

It is working, I'm using it. Region has to be set to auto but that's it

Hades32 avatar Jan 04 '23 16:01 Hades32

Speeds to banana are OK. Seem to be limited from Bananas side

Hades32 avatar Jan 04 '23 16:01 Hades32

Ah amazing, thanks for reporting back!

I've actually started using R2 too and am loving it (and host all our pre-built optimized models there). I still need to measure speeds to/from banana though.

gadicc avatar Jan 04 '23 16:01 gadicc