1.0.4 • Published 20 days ago

@onepunya/hugging-face-loader v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
20 days ago

npm i @onepunya/hugging-face-loader

const trained = require('@onepunya/hugging-face-loader');
// Take the hugging face model for example: https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0 in huggingface.co

trained("cute girl", "hugging face key", "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0")
  .then(data => console.log(data)) // result is arraybuffer you can use "fs". to save the image
  .catch(err => console.error(err));
  
  npm i fs
  
fs.writeFileSync(data, `/image.jpg`)

Kontak Pengembang Api

see available models and apikey at hugging face