A method to efficiently optimize hard text-based prompts for generative models in text2image and text2text applications. This allows API users to generate image concepts and tune language models for classification without prior knowledge of how to prompt the model. --