AI绘画普及课【二】文生图入门_平铺 分块 (tiling)

	- [(2) 借助工具](#2__319)
	- [(3) 抄作业](#3__331)

二、文生图入门与提示词基础

AI绘画和魔法、念咒有什么关系?记得吗,作图过程中,有一个必不可少的环节,就是向AI输入用于描述画面的Prompt,在AI聊天里我们也用。因为大部分AI绘制作品的提示词是用英文写的,很长,很乱。而且穿插着各种奇怪的数字、符号,就像高深莫测的咒语一样。因此,大家形象的把这个书写提示词的过程称为“念咒”。而我们,就像那些魔法师一样,要通过吟唱咒语,来变出我们想要的结果。虽说AI是人工智能,但它和真正意义上的人类智慧还是有一定差距的,很多时候它并不知道你想要的是什么。因此,就需要详尽的提示词来帮助你更好地指挥AI作图。这也是为什么,“念咒”这件事,在AI绘画盛行的今天,已经慢慢形成了一门独特的可以去探讨、研究的学问。

本课程讲解的内容使用的是Stable Diffusion,但我知道有很多朋友用的是另一款非常流行的AI绘画应用MidJourney,这些框架的大逻辑框架其实是通用的,而 MidJourney 比SD要更依赖好的提示词来做出作品,在提示词的应用层面更具深度。

1、提示词基本概念

内容概要:

  • 提示词的概念和基本逻辑
  • 提示词的语法(输入、间隔)
  • 内容型提示词与标准化提示词

这节课,我们来接触StableDiffusion中的文生图功能,也就是经由文本生成图像,这里面的“文”,指的自然就是提示词Prompt了。广义的解释,Prompt是指用户输入的文本或者图像信息,目的是指导模型根据一些特定的需求生成艺术作品。直白一点说,它是我们用来告诉AI“我要画什么”,“画成什么样”的一种语言。

上节课里,我们也提过了,SD里进行绘制的两种基本方式,文生图和图生图,文生图就是主要以文字来实现这个沟通过程的,而图生图还可以依赖图片来传达信息,但图生图里也有提示词,而且同样重要。提示词包括的内容,也是非常广泛的,它可能包括作品主题、画风、形象特点以及一些具体包含的要素。

比如以下例子:

正面提示词:
(1girl:2.0), solo, nilou \(genshin impact\), solo, long hair, jewelry, blue gemstone, earrings, horns, crown, cyan satin strapless dress, white veil, neck ring, red hair, {green eyes}, ((full body)), (SFW:1.5), front, highly detailed face, curvy body, skindentation, hands up, happy smily face, pureerosface_v1, hiqcgbody,

{{masterpiece}}, {best quality},{highresl}, original, reflection,Exaggerated body proportions, greasy skin, realistic and delicate facial features, depth of field, extremely detailed CG unity 8k wallpaper, bloom, shine, (illustration), (painting), (sketch), anime coloring, fantasy, unreal engine, body shadow, artstation

indoor, sitting on sofa, sunset, backlighting, shiny skin, lens flare, light particles, glowing, dappled sunlight, extreme shadow and light, long shadow, light rays, sun
wind blow, maple leaf, cloudy sky, dusty, forest, plant, flower

反面提示词:
EasyNegative, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)),((grayscale)),skin spots, acnes, skin blemishes, age spot, (outdoor:1.6), (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.33), (more than 2 nipples:1.331), (missing arms:1.33), (extra legs:1.331), (fused fingers:1.61051),(too many fingers:1.61051), (unclear eyes:1.331), lowers, bad hands, missing fingers, extra digit, (futa:1.1), bad hands, missing fingers, (((extra arms and legs))), extra hair, (2girls:2.0), signature, watermark, username, atist name

不同的提示词分别向AI描绘了画面风格、人物体貌、服饰特点、场景内容和一些额外的修饰性元素。别看这么多的字,其实,很多关于风格和画质把控的提示词是固定的。

虽然说提示词并非越多越好,但很多时候写多点,比少写点出来的效果肯定要更好,且在特定需求上控制会更为精确。所以,要想让AI按照我们的需要去产图,提示词到底该怎么写呢?放轻松,其实写提示词的过程非常自由的,无论你写什么,AI都可以给你画,在StableDiffusion中,可以输入提示词的区域就是左上方这两个文本框了,之前也提到了,它被分为了上下两部分,上面是正向的提示词,下面是反向的提示词。虽然自由,但提示词有一些基本的语法规则,是你应该掌握的。

首先,提示词需要英文书写,所以,如果你英语水平足够好,可以用英语组织你的描述语言,如果不好,可以求助翻译软件。

其次,提示词是以词组作为单位的,它不需要像真的英语句子一样,有完整的语法结构主从句之类的东西。就像你如果跟AI说:“画一个又长又宽的面和一个又大又圆的碗”,那直接可以分解成(面, 长, 宽), (碗, 大, 圆),这样AI也能听懂,甚至有时候听的比前一种更懂。

词组与词组之间,需要插入分隔符,基本的分隔符形式是一个英文里的半角逗号。再输入提示词的时候,最好把输入法切换到英文。因为里面涉及的符号基本都是英文的,提示词可以换行,但每一行的行末最好也打上分隔符。

1girl, walking, forest, path, sun, sunshine

1girl, walking, forest, path, sun, sunshine,
shining on body,

在输入这些东西以后,点击“Generate”,生成图画,出来的图片是这样的:

00006-1663017696

它有可能符合你的需要,也有可能变得奇奇怪怪。AI绘画是具有一定的随机性的,点多几次生成,每次生成出来的东西都会不太一样。之前,也有人把AI绘画比喻为“抽卡”,想出好的图片,得靠运气来抽。“一个女孩在林中漫步”,这其实只是一个非常概括的描述,这个女孩长什么样子、森林里有什么东西,时间是早上还是晚上、天气如何,这些东西,AI都不知道,你的提示词太过于笼统,那它就只能瞎蒙抽卡了。但也别担心,提示词很多时候不是一下子就写好的,而是现有一个雏形,再慢慢细化、补充和微调的。

1girl, walking, forest, path, sun, sunshine, shining on body, looking at viewer, close-up, upper body,
(masterpiece:1,2), best quality, masterpiece, highres, original, extremely detailed wallpaper, perfect lighting, (extremely detailed CG:1.2), drawing, paintbrush

还可以加一些的提示词,更多的就是在一些具体的方面,对这个画面去做控制。

00007-2658747475

2、提示词分类和书写方式

要加些什么呢?提示词有很多不同的分类。这里,把提示词概括成如下几个大类。

(1) 人物及主题特征
  • 服饰穿搭:white dress
  • 发型发色:blonde hair,long hair
  • 五官特点:small eyes,big mouse
  • 面部表情:smiling
  • 肢体动作:stretching arms

比如:女孩,白色连衣裙,金发,长发,微笑,伸展手臂,举手,美丽的,快乐的

1girl, walking, forest, path, sun, sunshine, shining on body, 
white dress, blonde hair, long hair, smiling, stretching arms, hands up, beautiful, happy,

00000-1611124299

(2) 场景特征
  • 室内、室外:indoor/outdoor
  • 大场景:forest, city, street
  • 小细节:tree, bush, white flower

比如:树木,灌木,白色的花,(林间)小路

1girl, walking, forest, path, sun, sunshine, shining on body, white dress, blonde hair, long hair, smiling, stretching arms, hands up, beautiful, happy,
trees, bush, white flower, outdoor,

(3) 环境光照
  • 白天、黑夜:day / night
  • 特定时段:morning, sunset
  • 光环境:sunlight, bright, dark
  • 天空:blue sky, starry sky

比如:白天、阳光、蓝天、多云的天空

1girl, walking, forest, path, sun, sunshine, shining on body, white dress, blonde hair, long hair, smiling, stretching arms, hands up, beautiful, happy,
trees, bush, white flower, path, outdoor,
day, sunlight, blue sky, cloudy sky,

(4) 补充:画幅视角
  • 距离:close-up(特写),distant
  • 人物比例:full body, upper body
  • 观察视角:from above, view of back
  • 镜头类型:wide angle, Sony A7

比如特写:

1girl, walking, forest, path, sun, sunshine, shining on body, white dress, blonde hair, long hair, smiling, stretching arms, hands up, beautiful, happy,
trees, bush, white flower, path, outdoor,
day, sunlight, blue sky, cloudy sky, close-up

可以把这四个分类叫做“内容型提示词”,然而,只有内容型的提示词,你画出的东西很大概率不会让你满意,这里,我们需要引入其他的提示词,来给这个画面打一剂强心针。

首先是画质,因为在AI学习的图片里,有些是高清的,有些质量比较模糊,我们可以用这样的提示词,让他盯着哪些高清的去看。

(5) 画质提示词
  • 通用高画质:best quality, ultra-detailed, masterpiece, hires, 8k
  • 特定高分辨率类型:extremely detailed CG unity 8k wallpaper(超精细的8K Unity游戏CG), unreal engine rendered(虚幻引擎渲染)

比如:最高的质量,超级细节,杰作,高分辨率,8K(分辨率),超细节的Unity CG壁纸

1girl, walking, forest, path, sun, sunshine, shining on body, white dress, blonde hair, long hair, smiling, stretching arms, hands up, beautiful, happy,
trees, bush, white flower, path, outdoor,
day, sunlight, blue sky, cloudy sky, close-up,
best quality, ultra-detailed, masterpiece, hires, 8k,extremely detailed CG unity 8k wallpaper, unreal engine rendered

(6) 画风提示词
  • 插画风:illustration, painting, praintbrush
  • 二次元:anime, comic, game CG
  • 写实系:photorealistic, realistic, photograph

比如:绘画,插画,动画,游戏CG

1girl, walking, forest, path, sun, sunshine, shining on body, white dress, blonde hair, long hair, smiling, stretching arms, hands up, beautiful, happy,
trees, bush, white flower, path, outdoor,
day, sunlight, blue sky, cloudy sky, close-up,
best quality, ultra-detailed, masterpiece, hires, 8k,extremely detailed CG unity 8k wallpaper, unreal engine rendered
painting, illustration, anime, game CG

(5)、(6)可以称为标准化的提示词。

(7) 提示词模板
描述人物:
(1girl:2.0), solo, nilou \(genshin impact\), solo, long hair, jewelry, blue gemstone, earrings,horns, crown, cyan satin strapless dress, white veil, neck ring, red hair, {green eyes},

描述场景:
indoor, room, house, sofa, wooden floor, plant, flowers, trees, windows,

描述环境(时间、光照):
day, morning, sunlight, dappled sunlight, backlight, light rays, cloudy sky

描述画幅视角:
full body, wide angle shot, depth of field

其他画面要素:
light particles, fantasy, wind blow, maple leaf, dusty,... (其他往后增加)

高品质标准化:
{{masterpiece}}, {best quality}, {highres}, original, reflection, unreal engine, body shadow, artstationextremely detailed CG unity 8k wallpaper

画风标准化:
(illustration), (painting), (sketch), anime coloring, fantasy,

其他特殊要求:
exaggerated body proportions, greasy skin, realistic and delicate facial features, SFW

3、权重与负面提示词

(1) 提示词的权重

如下咒语,

img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

需要这份系统化资料的朋友,可以戳这里获取

图片转存中…(img-CaNhd0DY-1714396940151)]
[外链图片转存中…(img-I4RQENjN-1714396940151)]

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

需要这份系统化资料的朋友,可以戳这里获取

  • 18
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值