低成本批量生成 AI 图片的方法
分享用 0.50 美元生成 450 张图片的成本优化技巧和实际案例。对图像应用开发者有参考价值。
分享用 0.50 美元生成 450 张图片的成本优化技巧和实际案例。对图像应用开发者有参考价值。
https://pkf-ai-gallery.pages.dev/
我越来越对 Bittensor 生态感兴趣了。它是一个去中心化、开源的网络,将机器学习模型互联在一起。
网络中比较有趣的一个"子网"是 Chutes.ai,它提供跨多个不同LLM、图像模型等的无服务器 AI 计算。我最近在播客采访中听过他们的介绍,一直在找个借口来尝试一下。
我让 DeepSeek-R1 想出了 50 个富有想象力的提示词:
A celestial cathedral floating atop a spiraling nebula, its stained-glass windows depicting constellations come to life, gilded arches entwined with ivy made of starlight, surrounded by floating orbs of liquid mercury
An opulent steampunk airship shaped like a mechanical peacock, its feathers crafted from interlocking brass gears and glowing amber lenses, hovering above a fog-shrouded Victorian metropolis illuminated by gaslamps
A surreal garden where trees are composed of cascading sapphire ribbons, their roots embedded in pools of liquid gold, guarded by stone serpents with eyes of smoldering opal under a twilight sky streaked with auroras
然后我用 9 个不同的图像模型来处理这些提示词:
Realistic Vision v5.1
总的来说,成本约为 $0.50(~每张图片 $0.001),我用 Bittensor 的原生货币 $TAO 支付。
我使用了 Cursor 相对新的 Agent 模式来编写 Python 代码以实现这一切。整个项目花了大约 15-20 分钟在 Cursor 中调试,然后花了一两个小时来生成所有图像(我只是让它们在睡前运行)。
然后我把提示词列表和图像目录交给 Cursor(同样),让它生成了一个我上传到 Cloudflare Pages 的作品库。
你可以在这里查看最终的作品库:https://pkf-ai-gallery.pages.dev/
总的来说,这是一个有趣的小项目。它的实现之所以成为可能并且变得容易得多,要归功于低成本 AI 模型的出现,以及像 Copilot、Cursor、Windsurf、Replit Agent、Q Developer 等代码工作流助手。
如需进一步操作,你可以考虑屏蔽该用户和/或举报滥用。