Skip to content

Commit 8b75b39

Browse files
authored
Update README.md to fix examples using FileOutput (#324)
1 parent ec31f40 commit 8b75b39

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ const model = "stability-ai/stable-diffusion:27b93a2413e7f36cd83da926f3656280b29
5757
const input = {
5858
prompt: "a 19th century portrait of a raccoon gentleman wearing a suit",
5959
};
60-
const output = await replicate.run(model, { input });
61-
// ['https://replicate.delivery/pbxt/GtQb3Sgve42ZZyVnt8xjquFk9EX5LP0fF68NTIWlgBMUpguQA/out-0.png']
60+
const [output] = await replicate.run(model, { input });
61+
// FileOutput('https://replicate.delivery/pbxt/GtQb3Sgve42ZZyVnt8xjquFk9EX5LP0fF68NTIWlgBMUpguQA/out-0.png')
62+
63+
console.log(output.url()); // 'https://replicate.delivery/pbxt/GtQb3Sgve42ZZyVnt8xjquFk9EX5LP0fF68NTIWlgBMUpguQA/out-0.png'
64+
console.log(output.blob()); // Blob
6265
```
6366

6467
You can also run a model in the background:
@@ -100,8 +103,8 @@ const model = "nightmareai/real-esrgan:42fed1c4974146d4d2414e2be2c5277c7fcf05fcc
100103
const input = {
101104
image: await fs.readFile("path/to/image.png"),
102105
};
103-
const output = await replicate.run(model, { input });
104-
// ['https://replicate.delivery/mgxm/e7b0e122-9daa-410e-8cde-006c7308ff4d/output.png']
106+
const [output] = await replicate.run(model, { input });
107+
// FileOutput('https://replicate.delivery/mgxm/e7b0e122-9daa-410e-8cde-006c7308ff4d/output.png')
105108
```
106109

107110
> [!NOTE]

0 commit comments

Comments
 (0)