Image Quality Poor, How to Improve

I used the image ans mask feature of dall-e-2.
The response I got was very poor, my prompt was :
“Add a large fish aquarium with fishes in it, on the floor in the masked area”

Code is simple :
def generate_image_using_mask_and_prompt(update_prompt, image_path, mask_path):
try:
response = openai.Image.create_edit(
model=“dall-e-2”,
prompt=update_prompt,
image = open(image_path,‘rb’),
mask = open(mask_path,‘rb’),
size=“1024x1024”,
n=1,
)

    image_url = response.data[0].url
    print(image_url)
    return image_url
except openai.error.OpenAIError as e:
    print(f"OpenAI Error: {e}")
    return None

These are the image, mask and generated image :

Any ways to improve? I have tried with many prompts, the quality is horrible and accuracy too



I only use regular image generation, not familiar in edits. My experience with DALL-E-2 is that it’s pretty… trash.

However, someone correct me if I’m wrong, but you can use edit feature with DALL-E-3 now. Have you looked into that? The difference for me between regular image generation is so large, I have to imagine your problem will be “solved” with DALL-E-3.

Yeah, DALLE2 isn’t recommended in production if you’re looking for quality.

You might have to wait for edits to come to DALLE3.

Only via ChatGPT Plus interface, I believe.

API has no edit endpoint yet for DALLE3.

1 Like

Ah I see, thanks for the clarification. I thought I had read something about API integration, but seems like they’re just “working on it” then at the moment.