@@ -69,9 +69,8 @@ console.log(output.blob()); // Blob
69
69
> of ` ReadableStream ` that returns the file contents. It has a ` .blob() ` method for accessing a
70
70
> ` Blob ` representation and a ` .url() ` method that will return the underlying data-source.
71
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.**
72
+ > We recommend accessing file data directly either as readable stream or via ` .blob() ` as the
73
+ > ` .url() ` property may not always return a HTTP URL in future.
75
74
76
75
You can also run a model in the background:
77
76
@@ -388,19 +387,6 @@ which is optimized for low latency requests to file models like `black-forest-la
388
387
` black-forest-labs/flux-schnell ` . When creating a prediction this will hold a connection open to the
389
388
server and return a ` FileObject ` containing the generated file as quickly as possible.
390
389
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
-
404
390
### ` replicate.stream `
405
391
406
392
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 +1224,7 @@ const [output] = await replicate.run("black-forest-labs/flux-schnell", {
1238
1224
input: { prompt: " astronaut riding a rocket like a horse" }
1239
1225
});
1240
1226
1241
- // To access the file URL (or data-uri) :
1227
+ // To access the file URL:
1242
1228
console .log (output .url ()); // => "http://example.com"
1243
1229
1244
1230
// To write the file to disk:
@@ -1261,8 +1247,8 @@ const replicate = new Replicate({ useFileOutput: false });
1261
1247
1262
1248
| method | returns | description |
1263
1249
| -------------------- | ------ | ------------------------------------------------------------ |
1264
- | ` url() ` | string | A ` URL ` object representing the HTTP URL or data-uri |
1265
1250
| ` blob() ` | object | A ` Blob ` instance containing the binary file |
1251
+ | ` url() ` | string | A ` URL ` object pointing to the underlying data source. Please note that this may not always be an HTTP URL in future. |
1266
1252
1267
1253
## Troubleshooting
1268
1254
0 commit comments