I am using “stabilityai/stable-diffusion-2-inpainting” to create a pipe, StableDiffusionInpaintPipeline
In my function, when I provide a prompt and image and other values to the pipe, including num_images_per_prompt=1
, I read .images and return a single image, pipe(...).images[0]
When I do this, and call my function via API, I get a base64 encoded image raw data returned.
Now, I change the function so that the pipe has num_images_per_prompt=4
and I have the function return the entire .images
array from the pipe instead of just images[0]
, but this time what gets returned to my API call is an array of dictionaries to temp paths, like so:
{
name: '/tmp/tmpqly2vjav/tmpm871xpz6.png',
data: null,
is_file: true
},
{
name: '/tmp/tmpqly2vjav/tmpzcfmjfp1.png',
data: null,
is_file: true
},
{
name: '/tmp/tmpqly2vjav/tmpxnisb_oi.png',
data: null,
is_file: true
},
{
name: '/tmp/tmpqly2vjav/tmp76mdtjlq.png',
data: null,
is_file: true
}
I don’t know how to get the files from this array of dictionaries, I was hoping an array of raw base64 data would be returned, since when I used num_images_per_prompt=1
and returned pipe(...).images[0]
it did this.
Any ideas?