Hello
I’ve been stumped on an issue I’ve been having with the /image/edits endpoint.
When I provide my image and prompt, receive the image url back from Open AI, and then open the new image, the new image looks exactly the same as the image i sent over. If it looked different but unlike my prompt I would assume its a prompt engineering problem. This is not the case though, the image is not edited at all.
I’m quite confused by these results since
- the /image/variations endpoint does return a modified image for me
- I know my prompt is being sent because I get an error from the API when i dont include the prompt field
- The new image remains unedited even after 10+ minutes so its not a latency issue generating the new image
- I am being charged for every API call despite no edits
Any hints as to why the API /image/edits isnt returning a modified image? Is this an API bug or a prompt engineering issue?
This is the code I’m using (clojure language and a light wrapper library around Open AI)
(defn prompt-image
"@param og-image - path to image to evolve from. Will be converted to binary for API request
@param prompt - how og-image should be augmented into a new image
@dev https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.1/doc/usage-openai
retuns binary of new png image"
[og-image-path prompt]
(try (let [image-res (oai/create-image-edit {
:image (io/file (io/resource og-image-path)) ; wrap in io/resource to find the file appropriately
:prompt prompt
:n 1
:size "1024x1024"
{:api-key (:openai-api-key (load-config))})
img-url (:url (first (:data image-res)))]
(println "Inc:divine:prompt-image:resp" image-res)
img-url
(catch Exception err
(log/handle-error err "Failure avatar evolution prompt" {:provider PROVIDER})
(throw (RuntimeException. (str "err avatar evo img prompt" (.getMessage err)))))))