diff --git a/README.md b/README.md index 88b15a85..2943a532 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,19 @@ You can list all the predictions you've run: [, ] ``` +Output files are returned as HTTPS URLs. You can load an output file as a buffer: + +```python +import replicate +from urllib.request import urlretrieve + +model = replicate.models.get("stability-ai/stable-diffusion") +version = model.versions.get("27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478") +out = version.predict(prompt="wavy colorful abstract patterns, cgsociety" +urlretrieve(out[0], "/tmp/out.png") +background = Image.open("/tmp/out.png") +``` + ## Install ```sh