File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,11 @@ const replicate = new Replicate({
3434Run a model and await the result:
3535
3636``` js
37- const model = " stability-ai/stable-diffusion:27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478" ;
38- const input = { prompt: " a 19th century portrait of a raccoon gentleman wearing a suit" };
37+ const model =
38+ " stability-ai/stable-diffusion:27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478" ;
39+ const input = {
40+ prompt: " a 19th century portrait of a raccoon gentleman wearing a suit" ,
41+ };
3942const output = await replicate .run (model, { input });
4043// ['https://replicate.delivery/pbxt/GtQb3Sgve42ZZyVnt8xjquFk9EX5LP0fF68NTIWlgBMUpguQA/out-0.png']
4144```
@@ -61,7 +64,7 @@ Or wait for the prediction to finish:
6164
6265``` js
6366prediction = await replicate .wait (prediction);
64- console .log (prediction .output )
67+ console .log (prediction .output );
6568// ['https://replicate.delivery/pbxt/RoaxeXqhL0xaYyLm6w3bpGwF5RaNBjADukfFnMbhOyeoWBdhA/out-0.png']
6669```
6770
@@ -97,12 +100,12 @@ and pass it to the `fetch` option in the constructor.
97100
98101``` js
99102import Replicate from " replicate" ;
100- import fetch from ' cross-fetch' ;
103+ import fetch from " cross-fetch" ;
101104
102105const replicate = new Replicate ({
103106 // get your token from https://replicate.com/account
104107 auth: process .env .REPLICATE_API_TOKEN ,
105- fetch: fetch
108+ fetch: fetch,
106109});
107110```
108111
You can’t perform that action at this time.
0 commit comments