Commit ddf2bd6
authored
Add SDXL to fal supported models (huggingface#1164)
Gave it a spin with:
```ts
import { HfInference } from "@huggingface/inference";
import fs from "fs";
const hf = new HfInference("hf_xxxx");
async function callFalAiModel() {
try {
const result = await hf.textToImage({
provider: "fal-ai",
model: "stabilityai/stable-diffusion-xl-base-1.0",
inputs: "A cat in the shape of a hug smiley",
});
console.log(result);
const blob = new Blob([result], { type: "image/jpeg" });
const arrayBuffer = await blob.arrayBuffer();
const buffer = Buffer.from(arrayBuffer);
fs.writeFileSync("output.jpg", buffer);
console.log("Image saved to output.jpg");
} catch (error) {
console.error("Error calling fal-ai/fast-sdxl model:", error);
}
}
callFalAiModel();
```
got
1 parent 9ea1caf commit ddf2bd6
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
0 commit comments