Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SDXL to fal supported models #1164

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

o-toff
Copy link
Contributor

@o-toff o-toff commented Feb 3, 2025

Gave it a spin with:

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
output

@o-toff o-toff force-pushed the ot/extend-model-coverage branch from 28e14f2 to 8eb36ac Compare February 3, 2025 13:43
@o-toff o-toff marked this pull request as ready for review February 3, 2025 14:13
Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@SBrandeis SBrandeis self-assigned this Feb 4, 2025
@julien-c julien-c merged commit ddf2bd6 into huggingface:main Feb 5, 2025
0 of 4 checks passed
@julien-c
Copy link
Member

julien-c commented Feb 5, 2025

thx a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants