Reverse Prompt Lookup: Image-to-Prompt

If you get to see wonderful AI art, you must be thinking about what the prompt for this art would be. Despite having prompt engineering guidelines and free prompt generators, prompting is sometimes difficult if you are caught up with writer’s block.

Writer’s block, loss of inspiration, and zone-out are all part of human life. We are not machines and will bounce back to normal at some point in time.

But, if you don’t have time to bounce back and you are on a tight schedule, you have no other option but to complete the job. What will you be doing to get the job done at that point?

Well, you need to reverse the process. 

You can only connect the dots by looking backward  – Steve Jobs

Yes, you need to reverse the prompting process. In this article, you will learn the reverse prompt lookup technique to get the ideas to create a new prompt for wonderful results.

Reverse Prompt Lookup: Decode the Image to Get the Prompt

The technique that we are going to see is reverse prompt lookup. The reverse prompt lookup technique analyzes the image uploaded to predict the medium and art style and finally, gives a few prompts that would have been used to create the image. You can also call it reverse engineering as well as first principle thinking.

To use this technique, you need to use the Google Colab notebook, which is a cloud coding environment. Don’t be intimidated by the word coding or Colab, you will be just pressing the run button. That’s all.

Steps to Use Reverse Prompt Lookup: Image to Prompt

  1. Open the CLIP Interrogator Colab notebook
  2. Run Each Cell in Colab notebook
  3. Replace the Image Link
  4. See the Reverse Lookup Result

1. Open the CLIP Interrogator Colab notebook

Open the CLIP Interrogator Colab notebook created by pharmapsychotic. To use this, you need to be logged in with your Google account.

Google Colab notebook helps run this tool without worrying about your local storage and local installation.

2. Run Each Cell in Colab notebook

After opening the Colab notebook mentioned in Step 1, you simply need to run each cell.

Just run the “Check GPU” and wait for the green tick and then run the “Setup” cell. 

Reverse Prompt Lookup Image-to-Prompt

3. Replace the Image Link

Next, run the “Interrogate cell” like the previous two cells.

Just after running the “Interrogate” cell, you need to replace the existing link with the link of the image that you want to reverse lookup or upload it using the “Upload” button.

Then, click the “Interrogate!” button.

Make sure to give the online link, not the local device path. For example, you can upload the image that you want to decode into your social media profile and copy that link and paste it into this Colab notebook.

Insert the Image URL to get the prompt

4. See the Reverse Lookup Result

Within a few seconds of running the “Interrogate” cell, you will be able to see the result at the end of the Colab notebook page in table format. 

Click the “magic stick” to interact and expand the result table.

CLIP Interrogator tool

Now, you can easily gather details such as medium, artist, trending, movement, and flavors of the image that you uploaded. At the very end, you can even see the prompt of the image that you have uploaded. Keep in mind that, these details and the prompt are not the exact prompts used to create the uploaded image. However, the interpretation will be very much closer and give you a direction to follow.

Image to prompt

With these details, you can easily construct a prompt and feed it into any of the AI art generators, such as DALL.E 2, Midjourney, and Stable Diffusion. 

Conclusion

The technique and the tool explained in this article will not give you the exact words written by the other artist but will give you the direction/ route to follow to get similar output.

If you find this content useful, you will also like how to steal prompt ideas like a boss!

FAQ

1. Can I find the prompt of the image?

Yes, you can find the prompt AI-generated image as well as non-AI generated image by using the “CLIP Interrogator” tool available as the Google Colab notebook.

 

Share this:

Leave a Comment