如何使用ChatGPT为Stable Diffusion生成提示

ChatGPT能否为Stable Diffusion生成高质量的提示?答案是肯定的。但是您需要特殊的方法来引导它们。一旦您学会了如何做到这一点,结果会让您惊讶。

什么是ChatGPT?

ChatGPT是OpenAI在2022年11月发布的一种聊天机器人。它建立在GPT-3系列的大型语言模型上,该模型在训练中使用了互联网上包含数千亿词汇的文本数据。

带有数千亿个词汇的书有多长?一个人需要超过5000年才能将其全部阅读完。

因此,ChatGPT包含了大量的人类知识。它可以生成论文、诗歌、小说,甚至计算机代码。

ChatGPT是如何训练的?

ChatGPT是在GPT-3.5的基础上进行微调的。GPT-3本身就是一个强大的大型语言模型,它的工作方式类似于自动补全。您键入几个单词或几个句子,模型会预测最有可能的下一个单词。由于其训练数据量很大,GPT-3的自动补全功能非常强大。它可以生成连贯且(有时)准确的内容的论文。

人类训练者在微调ChatGPT的响应时起到了重要的作用。模型被训练成提供与人类训练者相似的答案。在训练阶段,人类训练者还对ChatGPT的答案进行排名,以便优先选择人类偏好的答案。

ChatGPT是否了解Stable Diffusion?

不幸的是,答案是否定的。您可以通过向ChatGPT提问“什么是Stable Diffusion?”来进行简单检查。它的回答是:

Stable diffusion refers to a type of stochastic process that describes the spread of a certain quantity, such as information or a disease, through a network of individuals or nodes. The term “stable” is used to indicate that the process reaches a steady state, in which the rate at which the quantity spreads through the network is balanced by the rate at which it decays. The most common example of stable diffusion is the spread of a rumor through a social network.

我们可以争论这是否是完全无意义的,但我们应该都同意这不是关于Stable Diffusion的内容。它的训练数据很可能早于Stable Diffusion的发布。

幸运的是,ChatGPT了解什么是文本到图像模型和DALL·E(您可以验证)。因此,在我们的提示工程中,我们可以利用它们。

如何使用ChatGPT

要开始使用ChatGPT,请转到chat.openai.com。在底部的输入框中键入问题以开始对话。

图1

ChatGPT了解您当前对话的历史记录。在左侧面板上点击“+ 新聊天”按钮以开始新的对话。

询问提示

我将通过向ChatGPT询问插图肖像的提示来测试它的表现,因为这是最难做到的之一。让我们看看它的表现如何。

特写插图

有三种重要技术可以从ChatGPT中提取出用于Stable Diffusion的高质量提示:

  • 指定图像风格。您需要要求特定类型的图像。在我的例子中,我将要求“逼真的特写插图”。
  • 固定主题。我将将主题固定为女演员“Ana de Armas”。我并不是(太)痴迷于Ana de Armas。之所以这样做是因为女演员的姓名是一个强关键字。这不仅会改变面部(有意的),还会极大地影响风格(不是有意的)。如果不固定主题,ChatGPT将在每个提示中使用不同的女演员。风格和构图可能会因此而改变。
  • 用示例作为引导。最后,给出两个示例提示。

将这些组合在一起,ChatGPT的提示是:

Examples of high quality prompt for stunning close-up photorealistic illustration of Ana de Armas for text-to-image models (Stable Diffusion, midjourney or Dalle2) are

– portrait of beautiful happy young ana de armas, ethereal, realistic anime, trending on pixiv, detailed, clean lines, sharp lines, crisp lines, award winning illustration, masterpiece, 4k, eugene de blaas and ross tran, vibrant color scheme, intricately detailed

– alberto seveso and geo2099 style, A highly detailed and hyper realistic portrait of a gorgeous young ana de armas, lisa frank, trending on artstation, butterflies, floral, sharp focus, studio photo, intricate details, highly detailed, by Tvera and wlop and artgerm

Give me more examples.

ChatGPT的回答:

A stunning close-up illustration of Ana de Armas in a dramatic, dark and moody style, inspired by the work of Simon Stålenhag, with intricate details and a sense of mystery.
A photorealistic, highly detailed illustration of Ana de Armas in a vintage Hollywood style, reminiscent of the golden age of cinema, with a focus on glamour and elegance.
A close-up illustration of Ana de Armas in a neo-noir style, reminiscent of the film noir genre, with a focus on shadows, contrasts, and a sense of danger.

现在让我们将这些提示放入Stable Diffusion v1.5中。我将使用25个步骤的DPM++ 2M Karras采样器,CFG比例为7,图像尺寸为512×704。我将使用以下通用的负面提示。

ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, watermark, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face

ChatGPT提示1:一张令人惊叹的Ana de Armas特写插图,风格具有戏剧性、黑暗和阴郁的特点,灵感来自Simon Stålenhag的作品,包含复杂的细节和一种神秘感。

图2

ChatGPT提示2:一张逼真而高度详细的Ana de Armas插图,风格具有复古的好莱坞风格,让人联想到电影黄金时代,注重魅力和优雅。

图3

ChatGPT提示3:一张Ana de Armas的特写插图,风格呈现了新黑色电影的感觉,让人联想到黑色电影的类型,注重阴影、对比和一种危险感。

图4

这些都是很好的内容!我对提示的创意和风格的多样性感到惊喜。

而且,我肯定还学到了一些新的关键词,我将把它们放入提示生成器中。

全身插图

现在让我们修改ChatGPT的提示,以提取出用于全身肖像的提示。您只需在问题和示例中添加“全身”即可。

Examples of high quality prompt for stunning photorealistic full body illustration of ana de armas for text-to-image models (Stable Diffusion, midjourney or Dalle2) are

full body portrait of beautiful happy young ana de armas, ethereal, realistic anime, trending on pixiv, detailed, clean lines, sharp lines, crisp lines, award winning illustration, masterpiece, 4k, eugene de blaas and ross tran, vibrant color scheme, intricately detailed
full body portrait of a gorgeous young ana de armas, A highly detailed and hyper realistic lisa frank, trending on artstation, butterflies, floral, sharp focus, studio photo, intricate details, highly detailed, by Tvera and wlop and artgerm, alberto seveso and geo2099 style,

Give me more examples

ChatGPT生成了以下提示:

ChatGPT提示4:Ana de Armas穿着惊艳的红色礼服,优雅地摆姿势,置身于美丽的日落背景之下的全身插图,具有逼真的光照和阴影,由Jomaro Kindred或Gleb Alexandrov等精通逼真风格的数字艺术家创作。

图5

ChatGPT提示5:Ana de Armas作为一个强大的战士女王的全身插图,身着精致的盔甲和武器,姿势动感而富有活力,由Simon Stålenhag或Jora Vision等顶级奇幻艺术家以高度详细和逼真的风格绘制。

图6

ChatGPT提示6:Ana de Armas作为一个妖媚而神秘的女巫的全身插图,穿着精细和逼真的服装和饰品,摆出戏剧性和迷人的姿势,由Yoshitaka Amano或Dave Rapoza等领先的奇幻和科幻艺术家创作。

图7

这些都是好看的、时尚的全身肖像!

询问更多

如果您喜欢ChatGPT给出的特定提示,您可以通过类似于“我喜欢第三个。您能给我更多类似的示例吗?”的问题来要求更多相同风格的变体。

I like the third one. Can you give me more examples like that?

ChatGPT将为您提供更多相同风格的变体。

标签: AI绘画教程, AI绘画教程网, AI绘画, Stable Diffusion, Stable Diffusion教程, Stable Diffusion社区, Stable Diffusion社群, Stable Diffusion中文社区, Stable Diffusion入口, Stable Diffusion注册, Stable Diffusion注册教程, Stable Diffusion共享账号