〇、前言
本文将介绍使用AIGC技术,生成一个创客作品(姑且称之)的详细过程。为后续使用AIGC工具一键生成提供原始素材,创客作品的具体的介绍可参考前文。这里不再具体展示。
AIGC诗词匹配游戏
https://makelog.dfrobot.com.cn/article-314528.html
AIGC2024_图猜诗词
https://makelog.dfrobot.com.cn/article-315069.html

顺便说下,本文的标题和封面也是通过AIGC生成的:

一、AIGC画图提示词
本文使用清华智谱作为AIGC工具,其它类似产品请读者自行选择。
1. 提示词:
本创客作品的第一步要根据用户给与的诗词生成相应的水墨画,为了提高画图的生成效果,我们先使用平台的智能体来生成系统化的提示词:


可以看到,优化的提示词也是有模有样的,我们做一下简单的修改,生成一张图片试试:

生成效果还可以,我们就用它了。
二、代码生成
代码生成我主要使用了deepseek(https://chat.deepseek.com),据说它在中文界的代码生成能力比较强:


我们可以看到,它给出的代码和文件结构都是比较标准,虽然不是一步到位,但代码是能正常运行的。


三、程序修改
经过测试发现,直接使用AIGC来生成古诗词,会出现内容幻觉。也就是AIGC有时候会混淆诗词内容和作者,所以在生成古诗词这块,我采用网络上现成的接口,当然使用代码可以直接使用deepseek来生成,这里不再赘述。

四、AIGC的API接口调用

我们可直接参照它,写出程序:

当然在实际调试过程中,也会有些代码需要修改,我们可以使用AIGC工具进行追问:

我们可以看到,它也能很好地给出修改代码,总之有了这些工具,我们进行创客编程是相当丝滑的。
五、程序部署分享
创客精神还包括分享和互助,为了让我们的思路能和更多地进行交流。我们可以将作品分享出来。因为我们的编程语言主要是Python,我们使用免费的Python云部署平台,进行分享,
https://www.pythonanywhere.com/
具体使用不再赘述,读者可访问网站进行注册使用。有问题可以问大语言模型嘛。

上传相关文件到平台,后就可以愉快地玩耍了。


评论