{"id":7393,"date":"2023-09-07T10:10:32","date_gmt":"2023-09-07T18:10:32","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=7393"},"modified":"2025-04-24T17:14:22","modified_gmt":"2025-04-24T17:14:22","slug":"nlp-for-text-to-image-generators-prompt-generation-part-2","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/","title":{"rendered":"NLP for Text-to-Image Generators \u2014 Prompt Generation [Part 2]"},"content":{"rendered":"\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\">\n\n\n\n<div class=\"eo ep eq er es\">\n<div class=\"ab ca\">\n<div class=\"ch bg dx dy dz ea\">\n<figure class=\"lf lg lh li lj lk lc ld paragraph-image\">\n<div class=\"ll lm go ln bg lo\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg lp lq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*6jMU5AGzN-Etoes-lljN8Q.jpeg\" alt=\"\" width=\"700\" height=\"394\"><\/figure><div class=\"lc ld le\"><picture><\/picture><\/div>\n<\/div><figcaption class=\"lr ls lt lc ld lu lv be b bf z hb\" data-selectable-paragraph=\"\">Src: <a class=\"af lw\" href=\"https:\/\/analyticsindiamag.com\/the-ai-art-generation-tools-that-you-can-actually-use\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">https:\/\/analyticsindiamag.com\/the-ai-art-generation-tools-that-you-can-actually-use\/<\/a><\/figcaption><\/figure>\n<p id=\"de8d\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">In the <a class=\"af lw\" href=\"https:\/\/heartbeat.comet.ml\/nlp-for-text-to-image-generators-prompt-analysis-part-1-5076a44d8365\" target=\"_blank\" rel=\"noopener ugc nofollow\">previous tutorial<\/a>, we analyzed a large dataset of prompts created by Midjourney users. By using natural language processing (NLP), we were able to create a semantic search and model topics for the existing topics. In this article, we are going to dive deeper and explore ways of using language models to meaningful generate prompts.<\/p>\n<p id=\"321d\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">In order to have the best results, the quality of the prompt describing the visual matters. Prompt engineering is the concept of providing an input to a large language model and it generates a complete prompt or phrase as the output. The generated output depends on the task that the underlying language model was trained on.<\/p>\n<p id=\"7f58\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">Language models like GPT-3 by OpenAI have been trained using a large number of parameters and can provide good results for general tasks like writing topics for articles. However, these large language models can be fine-tuned by training them on specific data so that they can perform better on specific tasks. For our use case, we\u2019ll need to fine-tune a large language generation model provided by Cohere. This makes it able to generate prompts that can be fed into the text-to-image generators.<\/p>\n<h1 id=\"acdb\" class=\"mu mv ev be mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Prerequisites<\/strong><\/h1>\n<p id=\"68c2\" class=\"pw-post-body-paragraph lx ly ev be b lz ns mb mc md nt mf mg mh nu mj mk ml nv mn mo mp nw mr ms mt eo bj\" data-selectable-paragraph=\"\">You need to have Python 3.6+ installed in your development machine in order to follow along. In addition to this, you need an account to use Cohere\u2019s platform.<\/p>\n<blockquote class=\"nx ny nz\"><p id=\"7430\" class=\"lx ly oa be b lz ma mb mc md me mf mg ob mi mj mk oc mm mn mo od mq mr ms mt eo bj\" data-selectable-paragraph=\"\">Cohere is a platform that provides access to advanced large language models and NLP tools through one easy-to-use API. The platform offers free credits that you can use to experiment with your NLP projects. Make sure you install the following dependencies.<\/p><\/blockquote>\n<pre class=\"oe of og oh oi oj ok ol om ax on bj\"><span id=\"f20a\" class=\"oo mv ev ok b gw op oq l hn or\" data-selectable-paragraph=\"\">pip install datasets cohere numpy pandas nltk<\/span><\/pre>\n<h1 id=\"3cad\" class=\"mu mv ev be mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Data preparation<\/strong><\/h1>\n<p id=\"7b31\" class=\"pw-post-body-paragraph lx ly ev be b lz ns mb mc md nt mf mg mh nu mj mk ml nv mn mo mp nw mr ms mt eo bj\" data-selectable-paragraph=\"\">You will use the <a class=\"af lw\" href=\"https:\/\/huggingface.co\/datasets\/succinctly\/midjourney-prompts\" target=\"_blank\" rel=\"noopener ugc nofollow\">Midjourney\u2019s prompt dataset<\/a> available on Hugging Face. For this tutorial, you need to clean the prompts, add a separator and export them in <em class=\"oa\">txt <\/em>format. This is because you will use this data to fine-tune a language model using Cohere\u2019s platform. To get started, first load the dataset.<\/p>\n<pre class=\"oe of og oh oi oj ok ol om ax on bj\"><span id=\"b861\" class=\"oo mv ev ok b gw op oq l hn or\" data-selectable-paragraph=\"\">from datasets import load_dataset\nimport pandas as pd\ndataset = load_dataset(\u201csuccinctly\/midjourney-prompts\u201d)\ndf = dataset[\u2018train\u2019].to_pandas()<\/span><\/pre>\n<p id=\"b339\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">Next, clean the dataset by removing duplicates, prompts with less than 10 words, and empty rows. This ensures the training data is of high quality. The resulting dataset has 61k prompts.<\/p>\n<pre class=\"oe of og oh oi oj ok ol om ax on bj\"><span id=\"58c2\" class=\"oo mv ev ok b gw op oq l hn or\" data-selectable-paragraph=\"\">df = df[df[\u2018text\u2019].str.strip().astype(bool)]\ndf = df.drop_duplicates(subset=[\u2018text\u2019], keep=\u2019first\u2019)<\/span><\/pre>\n<p id=\"5e33\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">Finally, make sure you write the prompts to a <em class=\"oa\">txt <\/em>file. Make sure you add a separator such as \u201c \u2014 END PROMPT \u2014 \u201d to identify different prompts.<\/p>\n<pre>import nltk\nnltk.download('punkt')\n\nwith open('\/path\/to\/folder\/midjourney_prompts.txt', 'w') as f:\n  for index, row in df.iterrows():\n    if len(word_tokenize(row['text'])) &gt; 10:\n      f.write(row['text'])\n      f.write('\\n-- END PROMPT --\\n')<\/pre>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"eo ep eq er es\">\n<div class=\"ab ca\">\n<div class=\"ch bg dx dy dz ea\">\n<blockquote class=\"pd\"><p id=\"7fde\" class=\"pe pf ev be pg ph pi pj pk pl pm mt hb\" data-selectable-paragraph=\"\">Prompt engineering plus Comet plus Gradio? What comes out is amazing AI-generated art! Take a closer look at our <a class=\"af lw\" href=\"https:\/\/www.comet.com\/site\/blog\/clipdraw-gallery-ai-art-powered-by-comet-and-gradio\/?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_AWA_heartbeat_CTA\" target=\"_blank\" rel=\"noopener ugc nofollow\">public logging project<\/a> to see some of the amazing creations that have come out of this fun experiment.<\/p><\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"eo ep eq er es\">\n<div class=\"ab ca\">\n<div class=\"ch bg dx dy dz ea\">\n<h1 id=\"034c\" class=\"mu mv ev be mw mx pn mz na nb po nd ne nf pp nh ni nj pq nl nm nn pr np nq nr bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Fine-tuning Cohere\u2019s generation model<\/strong><\/h1>\n<p id=\"6749\" class=\"pw-post-body-paragraph lx ly ev be b lz ns mb mc md nt mf mg mh nu mj mk ml nv mn mo mp nw mr ms mt eo bj\" data-selectable-paragraph=\"\">Cohere has a generation model that you\u2019ll use as the base model to fine-tune it with your training data. The process is simple and user-friendly. Log in to your Cohere account, head over to the dashboard, and click on \u2018Create Finetune.\u2019<\/p>\n<p id=\"f5e2\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">Select \u2018Generation (Generate)\u2019 as your baseline model and \u2018small\u2019 as the model size. The smaller the model, the faster it is, but it has lower performance and vice-versa. Next, upload your txt file that has your training data and configure the data separator as shown below.<\/p>\n<figure class=\"oe of og oh oi lk lc ld paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg lp lq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:502\/1*MdkQyK1bHozrjy4VLEX6zg.png\" alt=\"\" width=\"688\" height=\"695\"><\/figure><div class=\"lc ld ps\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*MdkQyK1bHozrjy4VLEX6zg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*MdkQyK1bHozrjy4VLEX6zg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*MdkQyK1bHozrjy4VLEX6zg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*MdkQyK1bHozrjy4VLEX6zg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*MdkQyK1bHozrjy4VLEX6zg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*MdkQyK1bHozrjy4VLEX6zg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1004\/format:webp\/1*MdkQyK1bHozrjy4VLEX6zg.png 1004w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 502px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*MdkQyK1bHozrjy4VLEX6zg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*MdkQyK1bHozrjy4VLEX6zg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*MdkQyK1bHozrjy4VLEX6zg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*MdkQyK1bHozrjy4VLEX6zg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*MdkQyK1bHozrjy4VLEX6zg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*MdkQyK1bHozrjy4VLEX6zg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1004\/1*MdkQyK1bHozrjy4VLEX6zg.png 1004w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 502px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<p id=\"5bef\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">Click \u2018Preview Data\u2019 to confirm the samples are correct. If you are satisfied, click \u2018Review Data.\u2019<\/p>\n<figure class=\"oe of og oh oi lk lc ld paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg lp lq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:501\/1*EILwyWxg5bJ2OJN-t62g6Q.png\" alt=\"\" width=\"689\" height=\"696\"><\/figure><div class=\"lc ld pt\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*EILwyWxg5bJ2OJN-t62g6Q.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*EILwyWxg5bJ2OJN-t62g6Q.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*EILwyWxg5bJ2OJN-t62g6Q.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*EILwyWxg5bJ2OJN-t62g6Q.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*EILwyWxg5bJ2OJN-t62g6Q.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*EILwyWxg5bJ2OJN-t62g6Q.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1002\/format:webp\/1*EILwyWxg5bJ2OJN-t62g6Q.png 1002w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 501px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*EILwyWxg5bJ2OJN-t62g6Q.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*EILwyWxg5bJ2OJN-t62g6Q.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*EILwyWxg5bJ2OJN-t62g6Q.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*EILwyWxg5bJ2OJN-t62g6Q.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*EILwyWxg5bJ2OJN-t62g6Q.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*EILwyWxg5bJ2OJN-t62g6Q.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1002\/1*EILwyWxg5bJ2OJN-t62g6Q.png 1002w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 501px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<p id=\"42e8\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">Give your fine-tune model a name then click \u2018Start Fine-tuning\u2019 to kickstart the process.<\/p>\n<figure class=\"oe of og oh oi lk lc ld paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg lp lq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:502\/1*VMgmRudKkxdpG1ZEwA_YVg.png\" alt=\"\" width=\"692\" height=\"456\"><\/figure><div class=\"lc ld ps\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*VMgmRudKkxdpG1ZEwA_YVg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*VMgmRudKkxdpG1ZEwA_YVg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*VMgmRudKkxdpG1ZEwA_YVg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*VMgmRudKkxdpG1ZEwA_YVg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*VMgmRudKkxdpG1ZEwA_YVg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*VMgmRudKkxdpG1ZEwA_YVg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1004\/format:webp\/1*VMgmRudKkxdpG1ZEwA_YVg.png 1004w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 502px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*VMgmRudKkxdpG1ZEwA_YVg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*VMgmRudKkxdpG1ZEwA_YVg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*VMgmRudKkxdpG1ZEwA_YVg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*VMgmRudKkxdpG1ZEwA_YVg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*VMgmRudKkxdpG1ZEwA_YVg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*VMgmRudKkxdpG1ZEwA_YVg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1004\/1*VMgmRudKkxdpG1ZEwA_YVg.png 1004w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 502px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<p id=\"3c94\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">Monitor the status of the training process and once it changes to \u2018Ready,\u2019 you can now start using the model.<\/p>\n<figure class=\"oe of og oh oi lk lc ld paragraph-image\">\n<div class=\"ll lm go ln bg lo\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg lp lq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*TAxJ2U7dzb03ArrSx3-dzg.png\" alt=\"\" width=\"700\" height=\"94\"><\/figure><div class=\"lc ld pu\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*TAxJ2U7dzb03ArrSx3-dzg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*TAxJ2U7dzb03ArrSx3-dzg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*TAxJ2U7dzb03ArrSx3-dzg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*TAxJ2U7dzb03ArrSx3-dzg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*TAxJ2U7dzb03ArrSx3-dzg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*TAxJ2U7dzb03ArrSx3-dzg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*TAxJ2U7dzb03ArrSx3-dzg.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*TAxJ2U7dzb03ArrSx3-dzg.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*TAxJ2U7dzb03ArrSx3-dzg.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*TAxJ2U7dzb03ArrSx3-dzg.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*TAxJ2U7dzb03ArrSx3-dzg.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*TAxJ2U7dzb03ArrSx3-dzg.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*TAxJ2U7dzb03ArrSx3-dzg.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*TAxJ2U7dzb03ArrSx3-dzg.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<h1 id=\"db62\" class=\"mu mv ev be mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Prompt generation<\/strong><\/h1>\n<figure class=\"oe of og oh oi lk lc ld paragraph-image\">\n<div class=\"ll lm go ln bg lo\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg lp lq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*i8q5s6Y-_i1HO37li9-rtQ.png\" alt=\"\" width=\"700\" height=\"307\"><\/figure><div class=\"lc ld pv\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*i8q5s6Y-_i1HO37li9-rtQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*i8q5s6Y-_i1HO37li9-rtQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*i8q5s6Y-_i1HO37li9-rtQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*i8q5s6Y-_i1HO37li9-rtQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*i8q5s6Y-_i1HO37li9-rtQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*i8q5s6Y-_i1HO37li9-rtQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*i8q5s6Y-_i1HO37li9-rtQ.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*i8q5s6Y-_i1HO37li9-rtQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*i8q5s6Y-_i1HO37li9-rtQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*i8q5s6Y-_i1HO37li9-rtQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*i8q5s6Y-_i1HO37li9-rtQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*i8q5s6Y-_i1HO37li9-rtQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*i8q5s6Y-_i1HO37li9-rtQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*i8q5s6Y-_i1HO37li9-rtQ.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"lr ls lt lc ld lu lv be b bf z hb\" data-selectable-paragraph=\"\">Src: <a class=\"af lw\" href=\"https:\/\/docs.cohere.ai\/prompt-engineering-wiki\/]\" target=\"_blank\" rel=\"noopener ugc nofollow\">https:\/\/docs.cohere.ai\/prompt-engineering-wiki\/<\/a><\/figcaption>\n<\/figure>\n<p id=\"fa60\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">In this section, you will integrate your fine-tuned language model with your prompt generation process. This is where prompt engineering comes to play. By automating this process, you can generate up to five prompts with a single API call and iterate based on results. Also, you can add various parameters to this API call to configure the generation process so that it suits your needs. Visit <a class=\"af lw\" href=\"https:\/\/docs.cohere.ai\/generate-reference\" target=\"_blank\" rel=\"noopener ugc nofollow\">Cohere\u2019s Generate Documentation<\/a> for more information about these configuration options.<\/p>\n<p id=\"311d\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">First, you\u2019ll need to grab your API key from Cohere\u2019s dashboard and initialize the client. Kindly note that you need to specify the version so that some features are available.<\/p>\n<pre class=\"oe of og oh oi oj ok ol om ax on bj\"><span id=\"8fe7\" class=\"oo mv ev ok b gw op oq l hn or\" data-selectable-paragraph=\"\">import cohere\nco = cohere.Client(\u2018{apiKey}\u2019, \u20182021\u201311\u201308\u2019)<\/span><\/pre>\n<p id=\"3e95\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">Next, call the generate API. In this call, you will specify the following parameters:<\/p>\n<ul class=\"\">\n<li id=\"ef43\" class=\"lx ly ev be b lz ma mb mc md me mf mg ob mi mj mk oc mm mn mo od mq mr ms mt pw px py bj\" data-selectable-paragraph=\"\">Specify the model using your fine-tuned language model\u2019s full ID.<\/li>\n<li id=\"730f\" class=\"lx ly ev be b lz pz mb mc md qa mf mg ob qb mj mk oc qc mn mo od qd mr ms mt pw px py bj\" data-selectable-paragraph=\"\">Add the prompt you want the model to use to generate the complete prompt.<\/li>\n<li id=\"ceae\" class=\"lx ly ev be b lz pz mb mc md qa mf mg ob qb mj mk oc qc mn mo od qd mr ms mt pw px py bj\" data-selectable-paragraph=\"\">Specify the number of prompts you want to be generated (A maximum of five is allowed).<\/li>\n<li id=\"c758\" class=\"lx ly ev be b lz pz mb mc md qa mf mg ob qb mj mk oc qc mn mo od qd mr ms mt pw px py bj\" data-selectable-paragraph=\"\">Configure the presence penalty that will be used to make sure tokens are not repeated.<\/li>\n<li id=\"307f\" class=\"lx ly ev be b lz pz mb mc md qa mf mg ob qb mj mk oc qc mn mo od qd mr ms mt pw px py bj\" data-selectable-paragraph=\"\">Set the maximum number of tokens to be generated.<\/li>\n<\/ul>\n<figure class=\"oe of og oh oi lk\"><\/figure>\n<pre>response = co.generate(\n  model='&lt;full-model-id&gt;',\n  prompt='a rockstar puppy in mars',\n  max_tokens=50,\n  temperature=0.9,\n  num_generations=5,\n  presence_penalty=0,\n  stop_sequences=[],\n  return_likelihoods='NONE')\nprint('Prediction: {}'.format(response.generations[0].text))<\/pre>\n<p id=\"5f42\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">When you run the code above with the input prompt as \u201ca rockstar puppy in mars,\u201d it will generate the following outputs:<\/p>\n<figure class=\"oe of og oh oi lk lc ld paragraph-image\">\n<div class=\"ll lm go ln bg lo\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg lp lq c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*-BicD1sCxT9ksviln9B0iQ.png\" alt=\"\" width=\"700\" height=\"185\"><\/figure><div class=\"lc ld qe\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*-BicD1sCxT9ksviln9B0iQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*-BicD1sCxT9ksviln9B0iQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*-BicD1sCxT9ksviln9B0iQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*-BicD1sCxT9ksviln9B0iQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*-BicD1sCxT9ksviln9B0iQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*-BicD1sCxT9ksviln9B0iQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*-BicD1sCxT9ksviln9B0iQ.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*-BicD1sCxT9ksviln9B0iQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*-BicD1sCxT9ksviln9B0iQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*-BicD1sCxT9ksviln9B0iQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*-BicD1sCxT9ksviln9B0iQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*-BicD1sCxT9ksviln9B0iQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*-BicD1sCxT9ksviln9B0iQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*-BicD1sCxT9ksviln9B0iQ.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"lr ls lt lc ld lu lv be b bf z hb\" data-selectable-paragraph=\"\">Generated prompts using ML<\/figcaption>\n<\/figure>\n<p id=\"209a\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">Using the generated prompts, you can create some artworks using Stable Diffusion and see what the renders look like.<\/p>\n<h1 id=\"671f\" class=\"mu mv ev be mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Conclusion<\/strong><\/h1>\n<p id=\"827d\" class=\"pw-post-body-paragraph lx ly ev be b lz ns mb mc md nt mf mg mh nu mj mk ml nv mn mo mp nw mr ms mt eo bj\" data-selectable-paragraph=\"\">Text-to-image generators are so much fun once you figure out how to create meaningful prompts and you are only limited by your imagination. Cohere\u2019s platform offers easy-to-use APIs to access advanced NLP tools. You can also use other large language models like GPT-3 to create your own fine-tuned model for generating prompts.<\/p>\n<p id=\"e893\" class=\"pw-post-body-paragraph lx ly ev be b lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt eo bj\" data-selectable-paragraph=\"\">Don\u2019t forget to check out <a class=\"af lw\" href=\"https:\/\/dallery.gallery\/the-dalle-2-prompt-book\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">Dall-e 2 Prompt Book<\/a> for additional information on how to come up with meaningful prompts. Happy creating!<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Src: https:\/\/analyticsindiamag.com\/the-ai-art-generation-tools-that-you-can-actually-use\/ In the previous tutorial, we analyzed a large dataset of prompts created by Midjourney users. By using natural language processing (NLP), we were able to create a semantic search and model topics for the existing topics. In this article, we are going to dive deeper and explore ways of using language models to [&hellip;]<\/p>\n","protected":false},"author":65,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","footnotes":""},"categories":[6],"tags":[],"coauthors":[165],"class_list":["post-7393","post","type-post","status-publish","format-standard","hentry","category-machine-learning"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>NLP for Text-to-Image Generators \u2014 Prompt Generation [Part 2] - Comet<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"NLP for Text-to-Image Generators \u2014 Prompt Generation [Part 2]\" \/>\n<meta property=\"og:description\" content=\"Src: https:\/\/analyticsindiamag.com\/the-ai-art-generation-tools-that-you-can-actually-use\/ In the previous tutorial, we analyzed a large dataset of prompts created by Midjourney users. By using natural language processing (NLP), we were able to create a semantic search and model topics for the existing topics. In this article, we are going to dive deeper and explore ways of using language models to [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Comet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cometdotml\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-07T18:10:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T17:14:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*6jMU5AGzN-Etoes-lljN8Q.jpeg\" \/>\n<meta name=\"author\" content=\"Klurdy Studios\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Cometml\" \/>\n<meta name=\"twitter:site\" content=\"@Cometml\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Klurdy Studios\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"NLP for Text-to-Image Generators \u2014 Prompt Generation [Part 2] - Comet","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/","og_locale":"en_US","og_type":"article","og_title":"NLP for Text-to-Image Generators \u2014 Prompt Generation [Part 2]","og_description":"Src: https:\/\/analyticsindiamag.com\/the-ai-art-generation-tools-that-you-can-actually-use\/ In the previous tutorial, we analyzed a large dataset of prompts created by Midjourney users. By using natural language processing (NLP), we were able to create a semantic search and model topics for the existing topics. In this article, we are going to dive deeper and explore ways of using language models to [&hellip;]","og_url":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2023-09-07T18:10:32+00:00","article_modified_time":"2025-04-24T17:14:22+00:00","og_image":[{"url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*6jMU5AGzN-Etoes-lljN8Q.jpeg","type":"","width":"","height":""}],"author":"Klurdy Studios","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"Klurdy Studios","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/"},"author":{"name":"Klurdy Studios","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/069e186ad4a5b6d6950292821ea0f37b"},"headline":"NLP for Text-to-Image Generators \u2014 Prompt Generation [Part 2]","datePublished":"2023-09-07T18:10:32+00:00","dateModified":"2025-04-24T17:14:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/"},"wordCount":885,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*6jMU5AGzN-Etoes-lljN8Q.jpeg","articleSection":["Machine Learning"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/","url":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/","name":"NLP for Text-to-Image Generators \u2014 Prompt Generation [Part 2] - Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*6jMU5AGzN-Etoes-lljN8Q.jpeg","datePublished":"2023-09-07T18:10:32+00:00","dateModified":"2025-04-24T17:14:22+00:00","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/#primaryimage","url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*6jMU5AGzN-Etoes-lljN8Q.jpeg","contentUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*6jMU5AGzN-Etoes-lljN8Q.jpeg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/nlp-for-text-to-image-generators-prompt-generation-part-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"NLP for Text-to-Image Generators \u2014 Prompt Generation [Part 2]"}]},{"@type":"WebSite","@id":"https:\/\/www.comet.com\/site\/#website","url":"https:\/\/www.comet.com\/site\/","name":"Comet","description":"Build Better Models Faster","publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.comet.com\/site\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.comet.com\/site\/#organization","name":"Comet ML, Inc.","alternateName":"Comet","url":"https:\/\/www.comet.com\/site\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","width":310,"height":310,"caption":"Comet ML, Inc."},"image":{"@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cometdotml","https:\/\/x.com\/Cometml","https:\/\/www.youtube.com\/channel\/UCmN63HKvfXSCS-UwVwmK8Hw"]},{"@type":"Person","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/069e186ad4a5b6d6950292821ea0f37b","name":"Klurdy Studios","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/b1a3bf3caaa793aaad2da005b3ba38ba","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/1635710213869-96x96.jpg","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/1635710213869-96x96.jpg","caption":"Klurdy Studios"},"url":"https:\/\/www.comet.com\/site\/blog\/author\/brianklurdy-com\/"}]}},"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=7393"}],"version-history":[{"count":1,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7393\/revisions"}],"predecessor-version":[{"id":15558,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7393\/revisions\/15558"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=7393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=7393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=7393"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=7393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}