我是如何使用Stable Diffusion一步步生成兵马俑的

这里我会基于DreamShape 大模型来生成关于兵马俑的图片。

Steps:25

Sampler: DPM_2m

分辨率:512*512

首先,我还是个菜鸟,会写非常简单的提示词。

正提示词:

a terracotta warrior

确实是生成了兵马俑, 但是简单的提示词给了SD很大的发挥空间,约束太少。

那就可以增加一些兵马俑的外观说明,让SD生成你指定的外观的兵马俑,

a powerful terracotta warrior, wearing Qin dynasty armour, , sitting on a rock, forest background,

接下来,可以给它增加媒介的说明,比如插图/illustration, 油画/oil painting, 3D渲染/3D rendering, 以及照片/photography

a powerful terracotta warrior, wearing Qin dynasty armour, , sitting on a rock, forest background, digital art

可以明显看到图片更像CG图片。

在增加一些风格的提示词感受一些

a powerful terracotta warrior, wearing Qin dynasty armour, , sitting on a rock, forest background, digital art, hyperrealistic, fantasy, dark art

再添加分辨率的提示词,比如highly detailed 和sharp focus,

a powerful terracotta warrior, wearing Qin dynasty armour, , sitting on a rock, forest background, high detailed, digital art, hyperrealistic, fantasy, dark art, highly detailed , sharp focus,

基本上,我生图的过程就是这样,先从最简单的提示词开始生图,不断地更新优化,直到生成我要的效果的图片。

还可以增加一些细节,

a powerful terracotta warrior, wearing Qin dynasty armour, sitting on a rock, forest background, high detailed, digital art, hyperrealistic, fantasy, dark art, highly detailed , sharp focus, lightning:1.3, the atmosphere is dark before heavy rain,

这里会看到手指和腿部生成的效果不好,还可以使用负提示词改善,

增加负提示词

bad anatomy, bad hands, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, worst face, three crus, extra crus, fused crus, worst feet, three feet, fused feet, fused thigh, three thigh, fused thigh, extra thigh, worst thigh, missing fingers, extra fingers, ugly fingers, long fingers, horn, extra eyes, huge eyes, 2girl, amputation, disconnected limbs, cartoon, cg, 3d, unreal, animate

写在最后

AIGC技术的未来发展前景广阔,随着人工智能技术的不断发展,AIGC技术也将不断提高。未来,AIGC技术将在游戏和计算领域得到更广泛的应用,使游戏和计算系统具有更高效、更智能、更灵活的特性。同时,AIGC技术也将与人工智能技术紧密结合,在更多的领域得到广泛应用,对程序员来说影响至关重要。未来,AIGC技术将继续得到提高,同时也将与人工智能技术紧密结合,在更多的领域得到广泛应用。

感兴趣的小伙伴,赠送全套AIGC学习资料和安装工具,包含AI绘画、AI人工智能等前沿科技教程,模型插件,具体看下方。

一、AIGC所有方向的学习路线

AIGC所有方向的技术点做的整理,形成各个领域的知识点汇总,它的用处就在于,你可以按照下面的知识点去找对应的学习资源,保证自己学得较为全面。

在这里插入图片描述

在这里插入图片描述

二、AIGC必备工具

工具都帮大家整理好了,安装就可直接上手!
在这里插入图片描述

三、最新AIGC学习笔记

当我学到一定基础,有自己的理解能力的时候,会去阅读一些前辈整理的书籍或者手写的笔记资料,这些笔记详细记载了他们对一些技术点的理解,这些理解是比较独到,可以学到不一样的思路。
在这里插入图片描述
在这里插入图片描述

四、AIGC视频教程合集

观看全面零基础学习视频,看视频学习是最快捷也是最有效果的方式,跟着视频中老师的思路,从基础到深入,还是很容易入门的。

在这里插入图片描述

五、实战案例

纸上得来终觉浅,要学会跟着视频一起敲,要动手实操,才能将自己的所学运用到实际当中去,这时候可以搞点实战案例来学习。
在这里插入图片描述

若有侵权,请联系删除
好的!以下是一个使用Python编写的stable diffusion模型生成图片的代码示例: ```python import numpy as np from PIL import Image # 定义stable diffusion函数 def stable_diffusion(image, alpha, delta_t, iterations): # 获取图像的大小 height, width, channels = image.shape # 初始化变量 u = np.zeros((height, width, channels)) u_new = np.zeros((height, width, channels)) # 将输入图像转换为浮点数类型 image = image.astype(np.float32) # 初始化u和u_new u[:] = image u_new[:] = image # 定义Laplacian算子 laplacian = np.array([[0, 1, 0], [1, -4, 1], [0, 1, 0]]) # 迭代stable diffusion模型 for i in range(iterations): # 计算Laplacian of u lu = np.zeros((height, width, channels)) for c in range(channels): lu[:, :, c] = np.abs(np.fft.fftshift(np.fft.ifft2(np.fft.fft2(u[:, :, c]) * np.fft.fft2(laplacian, s=u.shape[:2], axes=(0, 1))))).real # 更新u_new u_new = u + delta_t * (lu ** alpha) * laplacian # 更新u u[:] = u_new # 将u转换为整数类型 u = u.astype(np.uint8) # 返回u return u # 加载图像 image = np.array(Image.open('input.jpg')) # 运行stable diffusion模型 alpha = 1.0 delta_t = 0.1 iterations = 100 output_image = stable_diffusion(image, alpha, delta_t, iterations) # 显示结果图像 Image.fromarray(output_image).show() # 保存结果图像 Image.fromarray(output_image).save('output.jpg') ``` 你可以将上述代码保存在一个.py文件中,然后使用Python解释器运行。请确保在代码中替换`input.jpg`和`output.jpg`为你所需的图像文件名。此外,你还可以尝试调整`alpha`,`delta_t`和`iterations`参数来获得不同的结果。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值