-2
var fetch = require("node-fetch")

fetch(
  'https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-2',
  {
    method: 'POST',
    headers: {
      'content-type': 'application/json'
    },
    body: JSON.stringify({
      inputs: 'award winning high resolution photo of a giant tortoise/((ladybird)) hybrid, [trending on artstation]',
      negative_prompt: 'blurry',
    }),
  }
)
.then((res) => res.blob())
.then((blob) => console.log(blob));

This is what gets printed to the console:
https://i.stack.imgur.com/DwjPH.png

Marko Bonaci
  • 5,622
  • 2
  • 34
  • 55
Min ad
  • 1

0 Answers0