Dalle API edit image not working properly

I need to use the edit images, but when i upload the image, it doesn’t give me an error back, it returns the same image that i sended, i tried tha variations to check if the problem was the image, but it returns variations like it should, the problem seems to be with edit

        response = client.images.edit(parameters: { prompt: "Add a cat next to the dog", image: "#{image_path}", mask: "#{image_mask_path}" , n: 1 , size: '512x512' })

1 Like

Welcome to the forum…

You need to send two images for edit endpoint… one is a mask.

Did you read the docs yet?

1 Like

I also tried with it, still returning the same image, tha mask image is the same image but with a trasnparent area like the docs says

Can you post some code? What language are you using?

If you search the forum, you can see others with similar problems… usually it’s the alpha layer that causes problems…

of course, i’m using ruby on rails, the code where i make the call is this one
as i mentioned before when i try the same code with variations (not passing a promtp obviously, it work fine)

def make_api_call
    image_path = Rails.root.join('app', 'assets', 'images', 'dog1.png')
    image_mask_path = Rails.root.join('app', 'assets', 'images', 'mask.png')     
    client = OpenAI::Client.new(access_token: openai_api_key)
    response = client.images.edit(parameters: { 
                                  prompt: "Add a cat next to the dog", 
                                  image: "#{image_path}",
                                   mask: "#{image_mask_path}",
                                   n: 1 , 
                                  size: '512x512' 
                                  })

    puts '<<<<<<'
    puts '<<<<<<'
    puts "response:  #{response}"
  end

note: ruby-openai

i also encountered the the same issue the edit image api return the same image, other time it return image that is far from the prompt description. if you found the problem kindly share it with me. thanks

running into the same issue. added a mask that covers half of the image. still the same result, get exactly the same image back as the one i sent.

pure gen api works fine. edit api returns the same image no matter what prompt e.g. “add a big red dot” or mask arg i set.

Let’s indeed see if it’s working today as well as yesterday.

Make an image with DALL-E 3 “HD”

Ooops, that doesn’t look like I envisioned at all - perhaps DALL-E 2 edits can fix up my $0.08 image for $0.02?

Mask off an area, which will become a second image of only 100% transparent alpha channel where I draw, sending a 32 bit RGBA file for the mask specification…

Well, while not great, it painted in everywhere I masked. Ain’t broke.

1 Like