kiri-art / docker-diffusers-api

Diffusers / Stable Diffusion in docker with a REST API, supporting various models, pipelines & schedulers.
https://kiri.art/
MIT License
203 stars 94 forks source link

[storage] Cloudflare R2 support #11

Open gadicc opened 1 year ago

gadicc commented 1 year ago

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 commented 1 year ago

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 AWSS3 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 ^_^)

Hades32 commented 1 year ago

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

Hades32 commented 1 year ago

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

gadicc commented 1 year ago

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.