920 字
5 分钟
StableDiffusion:介绍

1. 基本原理#

  • 人类绘图:草稿、线稿、描边、上色、处理细节

  • AI绘图:参考图 → 增加噪声 → 提取图像的信息特征 → 去除噪声【Stable Diffusion含义即为稳定扩散

AI绘图原理

2. 核心功能#

2.1 文生图(text-to-img)#

​ 输入一段提示词,AI会根据文字内容生成相应的图像

  • 正向提示词(希望AI生成的内容)
masterpiece, best quality, wallpaper forced, high quality, a girl, flowers, auburn hair, English countryside, midday, clear sky, rolling green hills, close-up shot, head and shoulders, natural lighting,
  • 负向提示词(可选,希望AI避免生成的内容)
worst quality, grayscale, simple background, bad hands, bad feet, bad anatomy, watermark, signature,
  • 生成图像
动漫风格-1动漫风格-2
文生图文生图
真实风格-1真实风格-2
文生图文生图

2.2 图生图(img-to-img)#

​ 输入一段提示词一幅参考图,AI会根据提示词及参考图,重新生成新的图像

  • 提示词
The picture is a documentary photograph of a young woman, wearing a blue headscarf with a yellow ribbon, a yellow dress with a white collar, and a pearl earring.
参考图AI生成图AI生成图AI生成图
参考图图生图图生图图生图

2.3 局部重绘(inpaint)#

​ 输入一段提示词一幅参考图像,再圈定一块需要重绘的范围,AI会根据提示词,在圈定的绘制范围内重新生成新的图像

参考图蒙版图
参考图蒙版图
生成图:yellow shirt生成图:light green sweater生成图:pink sweater
生成图生成图生成图

2.4 扩图(outpaint)#

​ 输入一段提示词一幅参考图像,再设定一个大于原始图像尺寸的蒙版,AI会根据提示词,在蒙版的灰白区域,重新生成新的图像

  • 提示词
The image is a portrait of a young Asian woman sitting on a wooden chair. She is wearing a white collared shirt with a blue and white striped tie and a black skirt. Her long black hair is styled in loose waves and she is looking directly at the camera with a slight smile on her lips. The background is blurred, but it appears to be a room with a white wall and a wooden floor. The overall mood of the image is relaxed and casual.
参考图蒙版图生成图
参考图蒙版图扩图

2.5 高清放大(upscale)#

​ 输入一幅参考图像,选择合适的放大算法放大比例,AI会根据算法和比例,进行图像放大

参考图:768 * 1024生成图:1536 * 2048
参考图放大

3. 辅助功能#

3.1 构图控制:ControlNet插件#

边缘检测:Canny、HED、Lineart#

参考图Canny图像HED图像Lineart图像
参考图CannyHEDLineart
动漫风格动漫风格真人风格真人风格
CannyCannyCannyCanny

深度检测:Depth#

参考图Depth图像
参考图Depth图像
动漫风格动漫风格真人风格
DepthDepthDepth
DepthDepthDepth

姿态检测:Pose#

参考图Openpose图像
参考图Openpose图像
动漫风格真人风格
OpenposeOpenpose

3.2 元素控制:LoRA模型#

汉服#

AI生成图AI生成图AI生成图
汉服汉服汉服

手办#

AI生成图AI生成图
手办手办
AI生成图AI生成图AI生成图
手办手办手办

沁彩#

AI生成图:人物AI生成图:人物
沁彩沁彩
沁彩沁彩
AI生成图:场景AI生成图:场景
沁彩沁彩
沁彩沁彩

Q版手绘#

AI生成图:半身AI生成图:半身
Q版手绘Q版手绘
AI生成图:全身AI生成图:全身AI生成图:全身
Q版手绘Q版手绘Q版手绘

水彩·小场景#

AI生成图AI生成图AI生成图AI生成图
水彩·小场景水彩·小场景水彩·小场景水彩·小场景
封面
示例歌曲
示例艺术家
封面
示例歌曲
示例艺术家
0:00 / 0:00