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.
There are two tools that reverse engineer prompts,
- CLIP Interrogator 2.3 by @pharmapsychotic, which is a Google Colab notebook. Don’t be intimidated by the word coding or Colab, you will be just pressing the run button. That’s all.
- CLIP interrogator by methexis-inc/img2prompt.
Steps to Use the CLIP Interrogator 2.3 by @pharmapsychotic: Image to Prompt
- Open the CLIP Interrogator Colab notebook
- Run Each Cell in Colab notebook
- Upload the Image
- 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.
3. Upload the Image
Next, run the “Image to prompt!” cell like the previous two cells.
Just after running the “Image to prompt!” cell, an image drop box will show up.
There you need to put the image that you want to reverse lookup.
Then, choose any one of the modes, such as best, fast, classic, or negative. Lastly, click the “Generate prompt” button.
In case you want to find out prompts for a bunch of images, you need to run the “Batch process a folder of images” cell. Before running this cell, you need to upload images and replace the existing link.
- To upload images, click this” ” icon and navigate to the “folder icon”.
- Then, right-click to create a “New Folder” and name it.
- Hover over the newly created folder and click the “vertical three dots”, followed by click “upload”.
- Next, click the same “vertical three dots” to click “copy path”.
- Lastly, replace the link with copied path and run the cell.
4. See the Reverse Lookup Result
Within a few seconds of running the “Image to prompt!” cell, you will be able to see the result in the “Prompt” column.
If you have run the “Batch process a folder of images” cell, scroll down to the end to see the results.
Now, you can easily gather details such as medium, artist, trending, movement, and flavors of the image that you 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.
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.
Steps to Use the CLIP interrogator by methexis-inc/img2prompt
- Go to the Replicate page of the CLIP interrogator by methexis-inc/img2prompt
- Upload an image and click “Submit”
- See the result
This CLIP interrogator usually takes up to 3 minutes for the reverse engineering process.
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 in the Google Colab notebook.