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