Basic usage
Basic usage
Send an image to a model to generate object masks
Copy
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('facebook/sam-vit-base');
// provide the model with input
const input = {
"url": "https://huggingface.co/datasets/huggingfacejs/tasks/resolve/main/mask-generation/mask-generation-input.png"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });