Prompt: Difference between revisions

88 bytes removed ,  3 February 2023
m
Reverted edits by Alpha5 (talk) to last revision by PauloPacheco
No edit summary
m (Reverted edits by Alpha5 (talk) to last revision by PauloPacheco)
Tags: Rollback Reverted
Line 1: Line 1:
[[File:0. chat-email-copy Blusteak.png|thumb|Figure 1. Example of a prompt on ChatGPT. Source: Blusteak.]]
[[File:0. chat-email-copy Blusteak.png|thumb|Figure 1. Example of a prompt on ChatGPT. Source: Blusteak.]]


A [[prompt]] or an [[artificial intelligence]] ([[AI]]) prompt is a [[natural language]] set of instructions, a text, that functions as [[input]] for an [[AI generator]]. <ref name="”1”">Ana. B (2022). Design your AI Art generator prompt using ChatGPT. Towards AI. https://pub.towardsai.net/design-your-ai-art-generator-prompt-using-chatgpt-7a3dfddf6f76</ref> Simply, it is a phrase or individual keywords used in tools like [[ChatGPT]] (figure 1), a [[text-to-text]] generator, or in [[text-to-image]] generators like [[DALL-E]]. After the input, the [[AI model]] tries to interpret it and generates a response. <ref name="”2”">Schmid, S (2022).ChatGPT: How to write the perfect prompts. Neuroflash. https://neuroflash.com/chatgpt-how-to-write-the-perfect-prompts/</ref>
A prompt or an [[artificial intelligence]] ([[AI]]) prompt is a natural language set of instructions, a text, that functions as input for an AI generator. <ref name="”1”">Ana. B (2022). Design your AI Art generator prompt using ChatGPT. Towards AI. https://pub.towardsai.net/design-your-ai-art-generator-prompt-using-chatgpt-7a3dfddf6f76</ref> Simply, it is a phrase or individual keywords used in tools like [[ChatGPT]] (figure 1), a text-to-text generator, or in text-to-image generators like [[DALL-E]]. After the input, the AI model tries to interpret it and generates a response. <ref name="”2”">Schmid, S (2022).ChatGPT: How to write the perfect prompts. Neuroflash. https://neuroflash.com/chatgpt-how-to-write-the-perfect-prompts/</ref>


It's relevant that prompts are written in a way that the generative [[model]] will understand since there is a direct relation between prompt quality and its output. <ref name="”1”"></ref> <ref name="”2”"></ref> For example, to obtain high-quality art it is necessary to provide adequate prompts with curated keywords. <ref name="”1”"></ref>
It's relevant that prompts are written in a way that the generative model will understand since there is a direct relation between prompt quality and its output. <ref name="”1”"></ref> <ref name="”2”"></ref> For example, to obtain high-quality art it is necessary to provide adequate prompts with curated keywords. <ref name="”1”"></ref>


[[Prompt design]] has become a relevant field of study and experimentation since it plays an essential role in the generation quality. Prompt design or [[Prompt engineering|engineering]] is the adjustment of the textual input for the model to better understand the intentions of the user and produce higher-quality results. <ref name="”3”">Hao, Y, Chi, Z, Dong, L and Wei, F (2022). Optimizing prompts for text-to-image generation. arXiv:2212.09611v1</ref> Indeed, according to Hao et al. (2022), "empirical observations also confirm that common user input is often insufficient to produce aesthetically pleasing images with current models." <ref name="”3”"></ref> These improvements can be achieved in all forms of AI generative systems, creating better stories, summaries, images, or videos. <ref name="”1”"></ref> <ref name="”4”">Bouchard, L (2022). Prompting explained: How to talk to ChatGPT. Louis Bouchard. https://www.louisbouchard.ai/prompting-explained/</ref>
Prompt design has become a relevant field of study and experimentation since it plays an essential role in the generation quality. Prompt design or engineering is the adjustment of the textual input for the model to better understand the intentions of the user and produce higher-quality results. <ref name="”3”">Hao, Y, Chi, Z, Dong, L and Wei, F (2022). Optimizing prompts for pext-to-image generation. arXiv:2212.09611v1</ref> Indeed, according to Hao et al. (2022), "empirical observations also confirm that common user input is often insufficient to produce aesthetically pleasing images with current models." <ref name="”3”"></ref> These improvements can be achieved in all forms of AI generative systems, creating better stories, summaries, images, or videos. <ref name="”1”"></ref> <ref name="”4”">Bouchard, L (2022). Prompting explained: How to talk to ChatGPT. Louis Bouchard. https://www.louisbouchard.ai/prompting-explained/</ref>


Julia Turc, the author of the article “Crafting Prompts for Text-to-Image Models”, argues that prompting “is the newest and most extreme form of [[transfer learning]]: a mechanism that allows previously-trained model [[weight]]s to be reused in a novel context.” She further expounds that “each request for an image can be seen as a new task to be accomplished by a model that was pre-trained on a vast amount of data. In a way, prompting has democratized transfer learning, but has not yet made it effortless. Writing effective prompts can require as much work as picking up a new hobby.“ <ref name="”5”">Turc, J (2022). Crafting prompts for text-to-image models. Towards Data Science. https://towardsdatascience.com/the-future-of-crafting-prompts-for-text-to-image-models-fc7d9614cb65 </ref>
Julia Turc, the author of the article “Crafting Prompts for Text-to-Image Models”, argues that prompting “is the newest and most extreme form of transfer learning: a mechanism that allows previously-trained model weights to be reused in a novel context.” She further expounds that “each request for an image can be seen as a new task to be accomplished by a model that was pre-trained on a vast amount of data. In a way, prompting has democratized transfer learning, but has not yet made it effortless. Writing effective prompts can require as much work as picking up a new hobby.“ <ref name="”5”">Turc, J (2022). Crafting prompts for text-to-image models. Towards Data Science. https://towardsdatascience.com/the-future-of-crafting-prompts-for-text-to-image-models-fc7d9614cb65 </ref>


==Prompting overview==
==Prompting overview==
Line 13: Line 13:
===Text-to-text prompts===
===Text-to-text prompts===


[[ChatGPT]] is a model trained using [[Reinforcement Learning]] that interacts with the user conversationally, responding to the text input.
[ChatGPT]] is a model trained using [[Reinforcement Learning]] that interacts with the user conversationally, responding to the text input.


For a [[text-to-text model]], there are some general guidelines for a good prompt:
For a text-to-text model, there are some general guidelines for a good prompt:


*Precision and clarity by avoiding long sentences with many subpoints. Easy-to-understand shorter sentences are preferable.
*Precision and clarity by avoiding long sentences with many subpoints. Easy-to-understand shorter sentences are preferable.
Line 27: Line 27:
[[File:1. Word cloud prompt.png|thumb|Figure 3. Frequent keywords used in Midjourney. Source: Towards Data Science.]]
[[File:1. Word cloud prompt.png|thumb|Figure 3. Frequent keywords used in Midjourney. Source: Towards Data Science.]]


[[Stable Diffusion]], [[DALL-E]], [[Midjourney]], and other [[text-to-image]] systems rely on written descriptions to generate images using algorithms to convert the text into an image. <ref name="”7”">Arunk89 (2023). How to write great prompts for AI text-to-image generators. Turbo Future. https://turbofuture.com/internet/How-to-write-great-prompts-for-AI-text-to-image-generator </ref> <ref name="”8”">ZMO.AI (2022). How do AI text-to-image generators work? ZMO.AI. https://www.zmo.ai/how-do-ai-text-to-image-generators-work/ </ref> These system can even produce images according to a specific style like (i.e. photograph, watercolor, illustration, etc.) or artist. <ref name="”8”"></ref>
[[Stable Diffusion]], [[DALL-E]], [[Midjourney]], and other text-to-image systems rely on written descriptions to generate images using algorithms to convert the text into an image. <ref name="”7”">Arunk89 (2023). How to write great prompts for AI text-to-image generators. Turbo Future. https://turbofuture.com/internet/How-to-write-great-prompts-for-AI-text-to-image-generator </ref> <ref name="”8”">ZMO.AI (2022). How do AI text-to-image generators work? ZMO.AI. https://www.zmo.ai/how-do-ai-text-to-image-generators-work/ </ref> These system can even produce images according to a specific style like (i.e. photograph, watercolor, illustration, etc.) or artist. <ref name="”8”"></ref>


In general, a good prompt for image generation (figure 2) should have in its structure:
In general, a good prompt for image generation (figure 2) should have in its structure:
Line 40: Line 40:


==Prompt engineering==
==Prompt engineering==
[[Prompt design]] or [[prompt engineering]] is the practice of discovering the prompt that gets the best result from the AI system. <ref name="”4”"></ref> The development of prompts requires human intuition with results that can look arbitrary. <ref name="”9”">Pavlichenko, N, Zhdanov, F and Ustalov, D (2022). Best prompts for text-to-image models and how to find them. arXiv:2209.11711v2</ref> Manual prompt engineering is laborious, it may be infeasible in some situations, and the prompt results may vary between various model versions. <ref name="”3”"></ref> However, there have been developments in automated prompt generation which rephrases the input, making it more model-friendly. <ref name="”5”"></ref>
 
Prompt design or prompt engineering is the practice of discovering the prompt that gets the best result from the AI system. <ref name="”4”"></ref> The development of prompts requires human intuition with results that can look arbitrary. <ref name="”9”">Pavlichenko, N, Zhdanov, F and Ustalov, D (2022). Best prompts for text-to-image models and how to find them. arXiv:2209.11711v2</ref> Manual prompt engineering is laborious, it may be infeasible in some situations, and the prompt results may vary between various model versions. <ref name="”3”"></ref> However, there have been developments in automated prompt generation which rephrases the input, making it more model-friendly. <ref name="”5”"></ref>


A list of prompts for beginners is [https://mpost.io/top-50-text-to-image-prompts-for-ai-art-generators-midjourney-and-dall-e/ available] as well as a compilation of the best [https://mpost.io/best-10-ai-prompt-guides-and-tutorials-for-text-to-image-models-midjourney-stable-diffusion-dall-e/ prompt guides and tutorials].
A list of prompts for beginners is [https://mpost.io/top-50-text-to-image-prompts-for-ai-art-generators-midjourney-and-dall-e/ available] as well as a compilation of the best [https://mpost.io/best-10-ai-prompt-guides-and-tutorials-for-text-to-image-models-midjourney-stable-diffusion-dall-e/ prompt guides and tutorials].
Line 118: Line 119:
====Jasper Art====
====Jasper Art====


[[Jasper Art]] is similar to DALL-E 2 but results are different since Jasper gives priority to [[Natural Language Processing]] ([[NLP]]), being able to handle complex sentences with semantic articulation. <ref name="”15”">The Jasper Whisperer (2022). Improve your AI text-to-image prompts with enhanced NLP. Bootcamp. https://bootcamp.uxdesign.cc/improve-your-ai-text-to-image-prompts-with-enhanced-nlp-fc804964747f</ref>
[[Jasper Art]] is similar to DALL-E 2 but results are different since Jasper gives priority to [[Natural Language Processing]] ([[NLP]]), being able to handle complex sentences with semantic articulation. <ref name="”19”">The Jasper Whisperer (2022). Improve your AI text-to-image prompts with enhanced NLP. Bootcamp. https://bootcamp.uxdesign.cc/improve-your-ai-text-to-image-prompts-with-enhanced-nlp-fc804964747f</ref>


There has been some experimentation with narrative prompts, an alternative to the combinations of keywords in a prompt, using instead more expressive descriptions. <ref name="”15”"></ref> For example, instead of using “tiny lion cub, 8k, kawaii, adorable eyes, pixar style, winter snowflakes, wind, dramatic lighting, pose, full body, adventure, fantasy, renderman, concept art, octane render, artgerm,” convert it to a sentence as if painting with words like, “Lion cub, small but mighty, with eyes that seem to pierce your soul. In a winter wonderland, he stands tall against the snow, wind ruffling his fur. He seems almost like a creature of legend, ready for an adventure. The lighting is dramatic and striking, and the render is breathtakingly beautiful.” <ref name="”15”"></ref>
There has been some experimentation with narrative prompts, an alternative to the combinations of keywords in a prompt, using instead more expressive descriptions. <ref name="”19”"></ref> For example, instead of using “tiny lion cub, 8k, kawaii, adorable eyes, pixar style, winter snowflakes, wind, dramatic lighting, pose, full body, adventure, fantasy, renderman, concept art, octane render, artgerm,” convert it to a sentence as if painting with words like, “Lion cub, small but mighty, with eyes that seem to pierce your soul. In a winter wonderland, he stands tall against the snow, wind ruffling his fur. He seems almost like a creature of legend, ready for an adventure. The lighting is dramatic and striking, and the render is breathtakingly beautiful.” <ref name="”19”"></ref>


==Prompt generators==
==Prompt generators==
Line 138: Line 139:
*[https://lexica.art/ Lexica.art]: a search engine for prompts and artworks. <ref name="”14”"></ref>
*[https://lexica.art/ Lexica.art]: a search engine for prompts and artworks. <ref name="”14”"></ref>


[[ChatGPT]] can also be used to design prompts for AI image generators besides the options above. This can be achieved by asking for adjectives that describe a specific scene (figures 10a and 10b) or directly asking it to write a prompt (e.g. “Write a text prompt for an AI art generation software that would fit the art style of Kilian Eng”). <ref name="”1”"></ref> hello<ref name="”20”">EdXD (2022). Using GPT-3 to generate text prompts for “AI” generated art. ByteXD. https://bytexd.com/using-gpt-3-to-generate-text-prompts-for-ai-generated-art/ </ref>
[[ChatGPT]] can also be used to design prompts for AI image generators besides the options above. This can be achieved by asking for adjectives that describe a specific scene (figures 10a and 10b) or directly asking it to write a prompt (e.g. “Write a text prompt for an AI art generation software that would fit the art style of Kilian Eng”). <ref name="”1”"></ref> <ref name="”15”">EdXD (2022). Using GPT-3 to generate text prompts for “AI” generated art. ByteXD. https://bytexd.com/using-gpt-3-to-generate-text-prompts-for-ai-generated-art/ </ref>


==References==
==References==
<references />
<references />