From the course: Generative AI Imaging Tools for Developers
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Enhancing prompts with text-to-text models
From the course: Generative AI Imaging Tools for Developers
Enhancing prompts with text-to-text models
- In this one, we're going to use AI to help us moderate users' prompts. Now, creating software that generates images can be a little bit scary, because you never know what kind of imagery users are going to request. Right now, our enhance_prompt function is very simple. It takes the user's prompt and blindly places it in the middle of this template. Now, this can be very effective, but it is limited to an extent. For example, you could end up with a prompt that doesn't make as much sense. Also, this isn't going to vary from prompt to prompt. Another approach we can take is to enhance our prompt using a text-to-text model, so have AI sort of rewrite the user's prompt to our liking. Let's head over to platform.openai.com, and we are at the Playground, and here, we're going to design the code that's going to help us process our user's prompt with AI. So first, we have a system instruction, and here, I wrote, "You take image generation prompts and turn them into sticker styled image…