Raul Mellado
Raul Mellado

Reputation: 11

stability.ai 3.5 API - image: input not instance of Blob

I am trying to use the Stable Diffusion API (via stability.ai) models SD3.5, with their api details here: https://platform.stability.ai/docs/api-reference#tag/Generate/paths/~1v2beta~1stable-image~1generate~1sd3/post

My code is in PHP

Mode text-to-image works great, no issues at all.

However, when I try image-to-image I always get an error:

object(stdClass)[2]
  public 'errors' => 
    array (size=1)
      0 => string 'image: input not instance of Blob' (length=33)
  public 'id' => string '620816a0b769aeb353780c8f6ff982b7' (length=32)
  public 'name' => string 'bad_request' (length=11)

I have tried reading (and sending) the image in multiple ways, via file_get_contents, file_read (binary and non binary), tested jpg, png images.

Out of desperation, I even did a previous call to text-to-image and then sent to image-to-image using the image string I got from the previous call, as it was, no modifications, but I still get the error "image: input not instance of Blob".

My machine is Windows, so I also tested on linux (to discard any OS specific file issues), but the result is exactly the same.

Anyone has any ideas? I have been trying for a week with zero luck.

I appreciate your help!

Upvotes: 0

Views: 79

Answers (0)

Related Questions