When using create image edit with gpt-image-1 (post /v1/images/edits) and large prompt size, the returned image seem to be random and have nothing to do with the instructions. I don’t know the exact limit, but it is far below the theorical maximum of 32000 tokens. I’ve seen the bug with prompt between 6000-7000 tokens. It happen in the web interface too, not just on the api. The number of file in the image array don’t seem to generate the bug, just a prompt too large.
It just happened again at about 5000 tokens. No amount of retry will correct the error; I just get a new random image. I guess that I will wait for the responses API version.
me Reads API reference.
Sees maximum of 32000 characters as the specification.
if len_prompt := len(prompt) > 32000:
prompt = prompt[:32000]
print(f"Truncated prompt to protect you from attempting {len_prompt} char")
Hum, indeed. I got too used to think in tokens. Maybe that’s the problem; I will track the character count in my app.