How can I generate variations of the images produced by DALL-e 3?

Hi everyone,

I’m using the DALL-e 3 model to generate images, and my code looks like this:

javascriptCopy code

const response = await openai.images.generate({
    model: "dall-e-3",
    prompt: "Create a photorealistic image of a serene desert landscape at sunset, featuring a fluffy orange tabby cat lounging on warm sand. The cat should have a curious expression, with the sunlight casting long shadows across the dunes. Surround the scene with a vast expanse of golden sand, and capture the tranquil beauty of the desert environment.",
    n: 1,
    size: "1024x1024",
    style: "vivid",
});

This code generates the desired image, but I want to obtain the produced image and create variants of it or make changes to it. I’ve noticed on the website that clients using ChatGPT-4 can request modifications like ‘Change the third picture…’ How can I achieve a similar result here?

1 Like

Hello!

Some tips that can help you. To create different versions of an image, you can adjust your code and image request strategy. Here are some ideas:

  1. Adjust the Prompt: Small changes to the prompt can lead to significant variations in images. For example, changing the cat’s expression or adding elements to the scene.

  2. Generate Multiple Images: By setting the n parameter to a number greater than 1, the DALL-E 3 will generate multiple images based on the same prompt. Each one will be slightly different. For example, n:3 will generate three variations.

  3. Request Specific Modifications**: After obtaining the initial image, you can create new prompts asking for specific modifications to that image, such as changing the color of the cat or adding an element to the scene.

  4. Explore Other Parameters: If the DALL-E 3 offers other parameters, experiment with them to see how they influence the images.

Here is an example of how your code can be adjusted to generate three variations:

const response = await openai.images.generate({
    model: "dall-e-3",
    prompt: "Create a photorealistic image of a serene desert landscape at sunset, featuring a fluffy orange tabby cat lounging on warm sand, with a curious expression and long shadows across the dunes.",
    n: 3,  // Gera três variações
    size: "1024x1024",
    style: "vivid",
});

Variations endpoint is available on DALLE2, but not DALLE3 yet. I’m pretty sure it’s coming eventually, so stay tuned.

1 Like

Is this ChatGPT generated? If so, please let us know.

For dall-e-3, only n=1 is supported.

1 Like

Hi Paul, I thought the same, but I saw one GPT that is actually generating 5 images per response. Just take a look at this GPT below:

chat.openai.com/g/g-XKojvSOMe-sticker-generator

So I believe it is possible to generate multiple images per response. Now I am doing some research on this to find out how to achieve that result (generating multiple images per response), if you have any tip or updated information, please let me know.

Thanks