You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To run a model that takes a file input, pass a URL to a publicly accessible file. Or, for smaller files (<10MB), you can convert file data into a base64-encoded data URI and pass that directly:
76
+
To run a model that takes a file input, pass a URL to a publicly accessible file. Or, for smaller files (<10MB), you can pass the data directly.
77
77
78
78
```js
79
79
constfs=require("node:fs/promises");
80
80
81
81
// Or when using ESM.
82
82
// import fs from "node:fs/promises";
83
83
84
-
// Read the file into a buffer
85
-
constdata=awaitfs.readFile("path/to/image.png");
86
-
// Convert the buffer into a base64-encoded string
0 commit comments