Can't make imageToImage function work in javascript

I’m trying to call “runwayml/stable-diffusion-v1-5” model from a supabase edge function, and I can’t get it work, am I calling the javascript right:

// imageUrl: url to jpeg image
const imageResponse = await fetch(imageUrl);
const imageBlob = await imageResponse.blob();
const editedImageBlob = await hf.imageToImage({
  inputs: imageBlob,
  parameters: {
    prompt: 'testprompt',
  },
  model: "runwayml/stable-diffusion-v1-5",
});

And my error is:

[Error] Error: call() got multiple values for argument ‘prompt’

Thank you for your help!

1 Like

Hmmm… Try

// imageUrl: url to jpeg image
const imageResponse = await fetch(imageUrl);
const imageBlob = await imageResponse.blob();
const editedImageBlob = await hf.imageToImage({
  inputs: imageBlob,
  parameters: {
    prompt: 'testprompt',
  },
  model: "stable-diffusion-v1-5/stable-diffusion-v1-5",
});