如何用 ChatGPT 生成AI 绘画提示词(Prompt)?

写AI绘画的Prompt不是一个容易的事情,对于很多新手来说,不知道该怎样用英文来描述它们想要绘制的内容,仅仅记得一些单词如“girl”、“dog”、“apple”等,受限于英文水平、经验、文学素养等原因,经常想不出合适的提示词来构想自己的画面,那么应该怎么办呢,我们是不是可以结合另外一款人工智能ChatGPT来生成AI绘画的提示词呢?

然而,事实上并不像我所想的那么简单,因为ChatGPT并不知道AI绘画!它是在2021年9月之前的数据上进行训练的,而AI绘画模型Stable Diffusion则是在2022年8月发布的,因此直接询问“请按照Stable Diffusion的prompt格式生成XX内容的prompt”通常无法得到想要结果。那么应该怎么进行提示呢,我这里总结了几个有效的方法:

一、场景构建

首先我们知道ChatGpt的问答虽然可以采用中文,但是采用英文提问的效果会更好,于是,我的提示词将采用英文:

I wish for you to assume the role of a professional prompt engineer, assisting me in crafting high-quality prompts for txt-to-image generation. I will input Chinese text for you to respond. The text-to-image tool we will be utilizing is stable-diffusion, known for its ability to produce exceptional visual content. To adhere to the guidelines of stable-diffusion, we should employ concise English words for prompt descriptions. For instance, “一个男孩” should be translated as “1boy,” “短发” as “short hair,” and “在草原上” as “prairie.” For example, the phrase “一个黑色短发男孩在草原上奔跑” can be translated as “1boy, black short hair, running on the prairie” or simply as “1boy running on the prairie.”

Additionally, stable-diffusion determines the priority of visual elements based on the order of prompt words. For instance, if “1boy” comes before “prairie” in the prompt, the boy becomes the primary subject, while the prairie serves as the background. Moreover, stable-diffusion allows for the adjustment of prompt weights by adding “(X:Y)” to increase or decrease the importance of a specific word. For example, “(short hair:1.5)” signifies that the weight of “short hair” is multiplied by 1.5. Typically, weight values range between 1.1 to 1.5. Feel free to specify or suggest adjustments for certain elements if necessary (between 1.1 to 1.5).

Furthermore, you can customize the perspective of the image, such as “front angle.” Additionally, you can indicate the desired style of the artwork, such as “realistic-style” for a realistic portrayal. You may expand upon the prompt by incorporating appropriate additional elements to enhance the richness of the image. The construction “X do X” can be employed to expand the prompt, such as “a bird flying in the sky.” Finally, to enhance the image quality, the prompt will include the preface “masterpiece, best quality” by default. In addition, when I provide you with my requirements, I hope you can expand the wording of my description to make it more richly detailed, output the expanded description, and then convert it into a prompt to improve the quality of the display. My requirement is:

If you understand, reply“YES”

二、输入需求

在完成上面的提示后,GPT会回复 YES 一个词,此时,你可以用中文输入你的想法需求:

三、进入AI绘画软件(以Stable Diffusion为例)

前缀词汇可以采用固定的前置: (4k),( best quality), (highres:1.1), (masterpiece:1.1),

画风及模型可以根据你的需要挑选,二次元模型可以选择Anything, 写实可以选择Chilloutmix(模型对画风的影响可以参见我这一篇回答:

如果将刘看山的形象进行二次元少女化,会是怎样的?7 赞同 · 2 评论回答

通用负面词汇可以采用:NSFW, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, (ugly:1.331), (duplicate:1.331), (morbid:1.21), (mutilated:1.21), (tranny:1.331), mutated hands, (poorly drawn hands:1.5), blurry, (bad anatomy:1.21), (bad proportions:1.331), extra limbs, (disfigured:1.331), (missing arms:1.331), (extra legs:1.331), (fused fingers:1.61051), (too many fingers:1.61051), (unclear eyes:1.331), lowers, bad hands, missing fingers, extra digit,bad hands, missing fingers, (((extra arms and legs))),,watermark

参数设置可参见下图:采样方法建议二次元用Euler 系列 ,真实采用DPM++系列,迭代步数在20~25之间

四、效果展示

长发男性
一个女孩奔跑在河边