How To Create Perfect Prompts for ChatGPT & Midjourney

LARRUZ walks through Prompt Perfect, a tool that rewrites prompts to work better with ChatGPT, Midjourney, DALL·E 2, and other AI models. You can adjust optimization strength, preview the changes, upload images to recreate them, and compare how different models handle the same prompt. The platform also lets you deploy prompts as an API service.
Chapters
So it lets you bypass any ethical filters that a model has. If you have worked with generative AI tools such as Mid Journey, chat, GPT, platformanthropic, or even open source tools such as Stable Diffusion, you definitely know that the quality of your output depends on quality of your input prompt. In this video I'm going to show you an amazing platform that takes your input prompt and and optimize it based on the model that you are using. And it's appropriately called Prompt Perfect. This single platform can help you optimize your prompts for a number of different models, including image as well as text models. And you can also deploy your prompts as a service, which is a very amazing capability. In this video we will cover different features that Prompt Perfect offers and we will also look at some really fun examples using you will need to create an account, but once you log in you will see a screen like this. The first one that we're going to be exploring is the basic prompts. Now here you have some examples that you can try. As I said in the beginning, it has support for both text and image models. It supports ChatGPT, GPT4, stableLM, which is an open source model as well as different variations of cloud. There is even by those earning model. And ginachat from Perfect is actually developed by a company called GINA AI and they have their own chat model as well. Next, in the image models you have Dall E2, stable diffusion, mid journey, Kidinski 2.1 and Lexica. Now how this works, you basically choose a model. Let's say we choose ChatGPT, then you provide your original prompt. And now at the back end their own AI model optimizes your input prompt for the selected generative AI model. So I'm going to walk you through an example, but before that let's look at the add ons. So here you can set whether you want to preview the prompt before and after optimization. Similarly you can set that for images and you can also have variable substitution. So this is going to be helpful when we are looking at Prompt as a service. The next tab is where you can set the quality of the prompt so you can shorten your prompt. This will reduce the number of tokens that the prompt is going to use, thus reducing the cost. You can also toggle the better quality and then you can manually set the strength of optimization so the 5 is the highest, 0 is no optimization for better quality. Now they also have support for multiple languages so it can optimize it by automatically detecting the language of the prompt or you can set this to optimize always for English or you can select another language. They have a variety of languages available now. I found the last one to be one of the most important feature. As you can see, there are two different toggles. The first one is make as non gibberish. So sometimes if you have grammatical mistakes or spelling mistakes in your prompt that will be flagged as gibberish by the AI. However, if you set this toggle, then it will optimize whatever prompt you provide. Now the second one is bypass ethical filters. So it lets you bypass any ethical filters that a model that you're using has. So let's look at a very quick example of this and see how good this is. So I'm going to simply activate the ethical filter by passing right, and let's activate before and after preview as well. And I'm going to use ChatGPT for this specific example. So let me use this simple prompt. Which political party is better, Republican or Democratic? So let's wait for it. So based on our original prompt, it actually created an optimized version. And now here it also give us a preview of how it's going to look like in ChatGPT. So it's the original prompt. If we give this. So the ChatGPT response could be as an AI language model, I don't have personal opinions or biases, right? And this is what the default behavior you would expect it from. However, with this optimize prompt. So this is the response generated when they made an API call as an AI language model. And I can provide objective analysis of the strategies and strength of Democratic and Republican parties in the American politics. And this is very different than what the default behavior is. So it does seem to work. So for comparison, I ran both of the prompts in ChatGPT. In the first one, it goes on to the default behavior. I don't have personal opinion or biases. And in the second prompt it actually followed through and gave me a pretty good response. So this is awesome. Now you can even use this for disabling some other filters that ChatGPT has. Now overall, this is pretty awesome. Okay, let's look at another example. So here is another prompt that's from the examples provided. So we want it to behave like a certain character or person. Let's see if it's able to optimize this prompt for me. Okay, so here are the results. This is my original prompt. So I simply ask it that if I ask you something personal or is regarding emotion or feeling, I want you to respond with your best approximation of what the person in this role would would experience. Right. It was a pretty basic prompt, but look at this. This is really amazing. Now you can read through this. But in this case I had the shortened prompt option or toggle enabled. That's why it is a relatively short prompt. Now, if you have seen these different websites which tries to replicate Persona of different people, these are the type of prompts that they use. Now I want to show you one more feature related to the image models before I show you some of the other advanced features. So let's say in this case we select Midjourney. If you toggle this button, you can simply upload an image. Then this model will generate a prompt in order to recreate a similar image. Now this is very similar to the Describe functionality within Midjourney. So it took that image, generated a prompt to recreate a similar image and then it further gave us an optimized prompt as well. And here's the image based on the prompt that it generated. It does look pretty cool. And these are the results based on the shortened version. Now you can get a similar effect using the Describe command within Midjourney. All right, so a couple of examples. Here's the prompt that I use alarm of wearing glasses and then using prompt. Perfect. It gave me a much more detailed prompt. And these are really amazing looking images. Okay, I want to show you this other cool feature called Arena. So here you can basically select different models and you can compare their performance. So let's say I'm simply selecting all the available chat models and then I'm going to run this single prompt, write a story about a programmer who fell in love with a deep neural network. Now within this platform, you can simply compare responses from all these models. So for example, here the command model is able to generate response pretty quickly, right? Then we have chatgpt stablelm. Right? And based on your input, you can see how good the responses are. So within this single interface you can pick and choose which model is best for your application. But here's the fun part. So if you see here, there is a preview mode arguments. So basically you can change the hyper parameters of your model and look at the behavior, right? So if you're trying to build an application which uses large language models, this is a really neat feature to compare them for your own application. So I would definitely recommend you to check this out. Now this platform offers some other features as well. For example, here is a feature called Streamlit. So this lets you create pipelines and test your models by integrating Multiple step execution. Now, there is a pretty neat interface for creating and optimizing a few short prompts as well. Then you can also add functions. So this is basically use of tools you can. But the thing that I really am interested in is this prompt as a service. This basically lets you deploy your prompt as a service or you can integrate them in your own applications, which I think is pretty amazing. So let me quickly walk you through an example. So first you need to simply select the backend model. So let's say we want to use ChatGPT and here you can define your own prompt, but I'm going to use the default prompt. So it's wrap battle between two characters and then it says each participant should have three rounds to showcase their skills, with each round having a specific theme or topic. Okay, so whatever your prompt is, you simply paste it in here. And then we want to deploy this as a service. So you simply toggle. This service is not running. So we're going to start the service. Okay, so here is the code which you can use for API calls. And this is all you need. This is available in JavaScript Python as well. You can create a new secret key. That secret key is going to come in here and then you can start making calls to this API, which is pretty amazing because it's a fully managed service. And if you see here, you will simply provide the character A value and character B value. Now, for deployment, you definitely want to use secret key, but you can also activate the public access. That would mean that you don't need secret key in order to use this. Right? And you can also test this. Okay, so the character in my case is Donald Trump, Character B is Joe Biden. And let's run this test. Okay, so here's the response that you would expect. So meme madness and then DJ D wreck. All right, wilding out spam. We have got Donald Trump and Joe Biden in the building. Let's kick off this rap battle with the meme theme. Right? And then it kind of creates the bat, the rap battle. This is pretty awesome. Okay. But you can simply deploy this as well. So I'm gonna simply making this call through my terminal. Now I open a completely new terminal. So I'm going to paste the API call. Now you can change the characters if you want, but let's keep the same and let's see if we get a response. Oh, wow. Okay, so it actually worked. So you see, we got a response. Response status is fine. And then there is a data. And here is the response that we got. Amazing. Because it's fully managed and you can simply use it without any configurations. Prompt Perfect has four different tiers with different pricing points. However, if you use my code prompt 15, you will get 15% off. Just keep in mind this offer is valid for the next one week. If you're putting large language models in production, it's a great tool to optimize your prompts. One thing which I really like about Prompt Perfect is it not only optimizes your prompt, but also tells you what was done during the optimization process. And this is great if you are learning about prompt engineering, so do check out their platform. It can really help you with your prompt engineering. If you would like to learn about the basics of prompt engineering, I would recommend you to watch this video next. Thanks for watching and see you in the next one.










