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' })

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