Skip to content

Commit 63764dc

Browse files
ReigenGothReigenmattt
authored
Update README to provide instructions for base64-encoding image inputs (#244)
### Context Update sign-off prior commit in git history (cd09db0) + Add basic base64 example --------- Signed-off-by: Mattt Zmuda <[email protected]> Co-authored-by: GothReigen <[email protected]> Co-authored-by: Mattt Zmuda <[email protected]>
1 parent 2f4f180 commit 63764dc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,15 @@ Create a new Python file and add the following code:
4242
['https://replicate.com/api/models/stability-ai/stable-diffusion/files/50fcac81-865d-499e-81ac-49de0cb79264/out-0.png']
4343
```
4444

45-
Some models, like [methexis-inc/img2prompt](https://replicate.com/methexis-inc/img2prompt), receive images as inputs. To pass a file as an input, use a file handle or URL:
45+
Some models, like [andreasjansson/blip-2](https://replicate.com/andreasjansson/blip-2), have files as inputs.
46+
To run a model that takes a file input,
47+
pass a URL to a publicly accessible file.
48+
Or, for smaller files (<10MB), you can pass a file handle directly.
4649

4750
```python
4851
>>> output = replicate.run(
49-
"salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746",
50-
input={"image": open("path/to/mystery.jpg", "rb")},
52+
"andreasjansson/blip-2:f677695e5e89f8b236e52ecd1d3f01beb44c34606419bcc19345e046d8f786f9",
53+
input={ "image": open("path/to/mystery.jpg") }
5154
)
5255

5356
"an astronaut riding a horse"

0 commit comments

Comments
 (0)