Skip to content

Commit 3ec67d7

Browse files
committed
Remove mention of returning data URLs from sync API
This change has now been reverted while we figure out how to provide a more consistent implementation.
1 parent 6a338aa commit 3ec67d7

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

README.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@ console.log(output.blob()); // Blob
6868
> A model that outputs file data returns a `FileOutput` object by default. This is an implementation
6969
> of `ReadableStream` that returns the file contents. It has a `.blob()` method for accessing a
7070
> `Blob` representation and a `.url()` method that will return the underlying data-source.
71-
>
72-
> **This data source can be either a remote URL or a data-uri with base64 encoded data. Check
73-
> out the documentation on [creating a prediction](https://replicate.com/docs/topics/predictions/create-a-prediction)
74-
> for more information.**
7571
7672
You can also run a model in the background:
7773

@@ -388,19 +384,6 @@ which is optimized for low latency requests to file models like `black-forest-la
388384
`black-forest-labs/flux-schnell`. When creating a prediction this will hold a connection open to the
389385
server and return a `FileObject` containing the generated file as quickly as possible.
390386

391-
> [!NOTE]
392-
> In this mode the `url()` method on the `FileObject` may refer to either a remote URL or
393-
> base64 encoded data-uri. The latter is an optimization we make on certain models to deliver
394-
> the files faster to the client.
395-
>
396-
> If you need the prediction URLs for whatever reason you can opt out of the sync mode by
397-
> passing `wait: { "type": "poll" }` to the `run()` method.
398-
>
399-
> ```js
400-
> const output = await replicate.run(model, { input, wait: { type: "poll" } });
401-
> output.url() // URL<https://...>
402-
> ```
403-
404387
### `replicate.stream`
405388

406389
Run a model and stream its output. Unlike [`replicate.prediction.create`](#replicatepredictionscreate), this method returns only the prediction output rather than the entire prediction object.
@@ -1238,7 +1221,7 @@ const [output] = await replicate.run("black-forest-labs/flux-schnell", {
12381221
input: { prompt: "astronaut riding a rocket like a horse" }
12391222
});
12401223

1241-
// To access the file URL (or data-uri):
1224+
// To access the file URL:
12421225
console.log(output.url()); //=> "http://example.com"
12431226

12441227
// To write the file to disk:
@@ -1261,7 +1244,7 @@ const replicate = new Replicate({ useFileOutput: false });
12611244

12621245
| method | returns | description |
12631246
| -------------------- | ------ | ------------------------------------------------------------ |
1264-
| `url()` | string | A `URL` object representing the HTTP URL or data-uri |
1247+
| `url()` | string | A `URL` object pointing to the underlying data source |
12651248
| `blob()` | object | A `Blob` instance containing the binary file |
12661249

12671250
## Troubleshooting

0 commit comments

Comments
 (0)