


AI绘画指定材质生成文字教程
关于AI材质制作文字,这个还是比较简单的,因为只要安装了ControlNet
的基础模型就可以绘制,唯一麻烦的一点,就是文字需要自己用PS绘制。
本次教程使用Stable Diffusion WebUI
的ControlNet
插件来生成图像。预处理器
为control_sd15_depth.yaml
,模型
为control_v11f1p_sd15_depth.pth
。
前置条件
在执行项目安装之前,必须确保你的系统内已经安装部署Stable Diffusion WebUI
和ControlNet
插件,以下是关于相关内容的教程,如果有不明白地方可以自行查阅。
模型下载
本文中所用到的所有模型文件如下:
- control_sd15_depth.yaml
- control_v11f1p_sd15_depth.pth
网盘下载
关于此项目可能用到的所有模型,本站已为您下载并整理好。如果你不方便通过官网下载,可以使用本站所提供的网盘下载地址。
模型安装
将下载后的两个文件,移动至你的SD安装目录中,具体路径如下:
.\stable-diffusion-webui\extensions\sd-webui-controlnet\models
注意:不要尝试修改文件名称,不然会报错。
使用教程
在完成上面的所有操作之后,我们此时已经可以正常使用该项目啦。
示例图像
首先我们先随便写一下Prompt,然后生成一张图像。
我们这里主要是想使用火元素材质生成一张文字图像,所以在正向Prompt中,站长加入了一些关于火的描述,还有一些提升图像质量的关键字。反面关键字是能用的,随便写一下就是了。
fire, flames, flames, forest, wood,burning wood, high qudlity,highres,masterpiece, Negative prompt: (worst quality:2),(low quality:2),(normal quality:2),lowres,watermark,monochrome Steps: 20, Sampler: Euler, CFG scale: 7, Seed: 1520271936, Size: 1000x1000, Model hash: d7e2ac2f4a, Model: majicmixRealistic_betterV2V25, Version: v1.5.1


这是一张风景图,我们现在开始准备加入ControlNet
来干预图像生成。
素材准备
既然我们要做生成文字,那么就肯定需要一张文字的图片,用这张图片来引导图像生成。

经站长测试,越简单的文字,生成的图像效果越好。如果你的中文汉字结构比较复杂,那么效果就会有所下降。
这是Photoshop内随便新建的文字,没有任何技巧可言,所以就不讲PS的部分了。
ControlNet设置
我们需要在ControlNet
中进行如下设置:
- 上传
素材图像
- 勾选
启用
- 勾选
完美像素模式
- 勾选
允许预览
- 预处理器:
depth_midas
- 模型选择:
control_v11f1p_sd15_depth
允许预览是否勾选并不影响结果,控制权重的参数可以根据自身情况进行调整,如果你希望坤坤越明显,那就适当增加权限数值。

完成以上设置之后,点击生成
按钮即可。



下面是一些随机种生成的其它效果图展示,这个效果还算说的过去。



沙石文字
我们不用更改文字素材图,也不用更改设置,只需要更改Prompt即可调整风格,下面是变更后的Prompt和效果展示。
Sand, stone, broken wood, beach, high qudlity,highres,masterpiece, Negative prompt: (worst quality:2),(low quality:2),(normal quality:2),lowres,watermark,monochrome Steps: 20, Sampler: Euler, CFG scale: 7, Seed: 406938218, Size: 1000x1000, Model hash: d7e2ac2f4a, Model: majicmixRealistic_betterV2V25, ControlNet 0: "preprocessor: depth_midas, model: control_v11f1p_sd15_depth [cfd03158], weight: 1, starting/ending: (0, 1), resize mode: Crop and Resize, pixel perfect: True, control mode: Balanced, preprocessor params: (512, 0, 0)", Version: v1.5.1



复杂文字
对于较为复杂的文字,生成的效果可能并不是特别理想,尤其是你的素材图如果尺寸过小的情况下。
我们使用和上面一样的Prompt和设置,只变更素材图像,图像尺寸为1000*1000,然后生成一下。
Sand, stone, broken wood, beach, high qudlity,highres,masterpiece, Negative prompt: (worst quality:2),(low quality:2),(normal quality:2),lowres,watermark,monochrome Steps: 20, Sampler: Euler, CFG scale: 7, Seed: 619217278, Size: 1000x1000, Model hash: d7e2ac2f4a, Model: majicmixRealistic_betterV2V25, ControlNet 0: "preprocessor: depth_midas, model: control_v11f1p_sd15_depth [cfd03158], weight: 1, starting/ending: (0, 1), resize mode: Crop and Resize, pixel perfect: True, control mode: Balanced, preprocessor params: (512, 0, 0)", Version: v1.5.1



效果还阔以,但如果你的素材原始尺寸较小呢?下面是原始文字素材图的大小为512*512,我们做一下效果对比。



可以看到,同样的文字图像,同样的生成方式,但是最关键的问题就出在预处理器这一步,如果你的文字图像尺寸较小,那么在预处理时,将会使文字变的模糊,所以生成后的效果也会较差。
综上所述,各位在制作生成文字的时候,一定要保证文字图像的尺寸至少在1000*1000,效果才会较好。
总结
只要各设置与站长一致,只需要变更正向提示词Prompt和素材图即可复现该效果。
个人感觉还是挺实用的,最起码生成个Logo什么的,很方便。
评论 (0)