Stable Diffusion是一个开源的图像生成AI系统,由Anthropic公司开发。它基于 Transformer模型架构,可以通过文字描述生成高质量的图像。
Stable Diffusion的主要特点包括:
Stable Diffusion是一种潜在扩散模型(Latent Diffusion Model),能够从文本描述中生成详细的图像。它还可以用于图像修复、图像绘制、文本到图像和图像到图像等任务。简单地说,我们只要给出想要的图片的文字描述在提Stable Diffusion就能生成符合你要求的逼真的图像。Stable Diffusion作为新兴的AI生成模型,拥有强大的图像生成能力,是目前最先进的开源生成模型之一,值得关注。它的出现将推动创作界发生革命性的变化。
prompt:beautiful girl,bikini,sea,beach,sunshine
生成的效果如下:
效果不太好,我们来学习下prompt如何编写,再看看改善效果。
描述语分为正向/负向描述,它们也叫tag(标签)或prompt(提示词)
正面提示词:相比Midjourney,SD需要写得更精准和细致,描述少就给AI更多自由发挥空间。
负面提示词:不想让SD生成的内容。
正向:masterpiece, best quality, 画质词,画面描述。
反向:根据画面产出加不想出现的画面。
第一段:画质tag,画风tag
第二段:画面主体,主体强调,主体细节概括(主体可以是人、事、物、景)画面核心内容
第三段:画面场景细节,或人物细节,embedding tag。画面细节内容
第二段一般提供人数,人物主要特征,主要动作(一般置于人物之前),物体主要特征,主景或景色框架等
根据上面的规则我们来改下下prompt
A beautiful young girl standing in the shallow seawater on a sunny tropical beach. She has long wavy blonde hair flowing in the ocean breeze. She's wearing a red floral bikini which compliments her tanned skin tone. Her fit athletic body is perfectly framed in this scene. She has a bright, energetic smile on her face as she's enjoying the warm ocean water washing over her feet. The background is a picturesque tropical beach scene with white sand, palm trees, and turquoise blue water sparkling in the bright sunlight stretching out to the horizon. This is a perfect summer beach day. The overall color tone is vibrant and cheerful. The girl looks natural, elegant, and carefree. This is a high quality, photorealistic image.
报错
“Unsafe content found”
继续优化
"A cheerful young woman smiling and having fun at the beach. She has long, dark brown hair blowing casually in the tropical breeze. She's dressed appropriately in a blue floral one-piece swimsuit. Posing happily on the shore, with one hand up to her forehead to shade her eyes. Behind her is a beautiful scenic view of bright turquoise waves gently lapping against the sandy shore. In the background, the wide open clear blue sky meets the ocean horizon. Palm trees and green vegetation dot the landscape. The sunlight is bright and warm. This is a high quality, idyllic summer beach scene."
主要修改的点包括:
看效果
很明显,改善很明显…… 哈哈哈哈哈哈哈 (如果被吓到实在不好意思,我也有点看恐怖片的感觉)
上面这些图是因为我Guidance Scale的参数设置太低了。
Stable Diffusion 模型中的 Guidance Scale 参数是调整文本提示(Text Prompt)对图像生成影响力的一个重要超参数。
Guidance Scale 参数的主要作用是:
改后的效果如图(我实在不知道怎么修改CSDN才不违规了,一个连体泳衣都违规,其他平台都正常显示,只能马赛克了):
想要用Stable Diffusion生成高质量的图片,避免生成低质量的“烂图片”,可以注意以下几点: