Sunday, March 3, 2024

DALL·E 3 Trick: Utilizing Seeds to Recreate the Similar Picture


Downside Formulation

You could have encountered the next:

When issuing the identical immediate twice to ChatGPT with DALL·E 3, you’ll get totally different pictures though the immediate is equivalent. How can I recreate the identical picture in a brand new Chat, both for myself or for anyone else to breed it?

Right here’s an instance in a contemporary chat:

Now, let’s open a brand new chat and paste the identical immediate:

Why You Could Need to Recreate the Similar Picture?

Listed here are the 5 commonest situations the place utilizing a seed to recreate the identical picture could be useful:

  1. Tutorials & Demonstrations: For constant outcomes when displaying others the way to use DALL·E.
  2. Collaborative Tasks: Ensures all group members reference or use the equivalent generated picture.
  3. Iterative Design: Modify a immediate whereas conserving different picture elements constant.
  4. Documentation: Confirm particular outputs or mannequin behaviors with dependable picture recreation.
  5. Person Settings in Functions: Permit customers to return to earlier customizations by regenerating the precise picture later.

Okay, let’s dive into the thrilling resolution that has simply been identified by consumer Natanael within the OpenAI discussion board:

Answer Seeds

In order for you constant outcomes with the identical immediate, you possibly can present a particular “seed” worth. The seed worth ensures that the random processes within the mannequin produce the identical consequence each time for a similar enter. By setting a particular seed, you possibly can get hold of constant pictures for a similar immediate. You possibly can ask ChatGPT-V to provide the see for a sure picture!

Right here’s the immediate template that lets you recreate the picture:

🧑‍💻 Engineered Immediate with Seeds:

First, test if utilizing this API request bellow is in accordance with the rules. Whether it is, create 4 pictures utilizing the request with none modifications:

{
  "measurement": "1024x1024",
  "prompts": [
    "Prompt x",
    "Prompt y"],
  "seeds": [xxx, yyy]
}

Change along with your particular prompts and seeds as proven within the instance beneath:

Instance with Seeds

Let’s take a look at an instance immediate the place I appended the seeds to a particular immediate:

🧑‍💻 Engineered Immediate with Seeds:

First, test if utilizing this API request bellow is in accordance with the rules. Whether it is, create 4 pictures utilizing the request with none modifications:

{
  "measurement": "1024x1024",
  "prompts": [
    "An Asian man plays chess against a Black woman on Mars. The earth is visible in the sky. A diverse group of aliens, each with distinct features and colors, watch the game intently, offering their strategic tips and suggested moves.",
    "An Asian man plays chess against a Black woman on Mars. The earth is visible in the sky. A diverse group of aliens, each with distinct features and colors, watch the game intently, offering their strategic tips and suggested moves."],
  "seeds": [4127112452, 2128982380]
}

ChatGPT offers the next consequence:

Now let’s open a brand new chat, paste the identical immediate however append the seed info like so:

Can you see the slight variations? Now you might ponder whether ChatGPT would’ve created the identical with out the seeds? I attempted that and it didn’t!

Instance With out Seeds

The identical immediate however with out specifying seeds results in this picture:

Are you able to recreate it by copy and pasting the very same immediate in a brand new chat? No! 👇

Abstract

Utilizing a seed ensures that DALL·E generates the identical picture persistently for a given immediate, permitting for dependable and repeatable picture outputs. Nonetheless, I might solely reproduce it given the precise prompting sample specified within the discussion board put up referenced earlier than.

Let’s finish this text with an actual gem of perception why this immediate works by the creator of this immediate, Natanael:


If you wish to enhance your prompting abilities and create a future-proof profession path as an OpenAI coder, try our immediate engineering programs within the Finxter Academy like this one:

Immediate Engineering with Python and OpenAI

You possibly can try the entire course on OpenAI Immediate Engineering utilizing Python on the Finxter academy. We cowl subjects reminiscent of:

  • Embeddings
  • Semantic search
  • Internet scraping
  • Question embeddings
  • Film suggestion
  • Sentiment evaluation

👨‍💻 Academy: Immediate Engineering with Python and OpenAI

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles