
从架构设计侧剖析: MCP vs A2A 是朋友还是对手?
随着生成式 AI 的飞速发展,Midjourney 等图像生成平台已然成为创意设计师和小白创业者的得力助手。与此同时,Etsy 这样的手工与原创作品交易平台,为设计师们提供了一个“躺赚”渠道——将 AI 产生的壁纸、头像等数字资产批量上架,实现自动化被动收入。
本篇文章将带你从零开始,一步步掌握:
让你在 2025 年也能轻松开启 AI 设计小店,打造属于自己的人生副业。
功能模块 | 工具/平台 | 链接 |
---|---|---|
AI 图像生成 | Midjourney | https://www.midjourney.com/ |
自动下载与分类 | Python / Requests / asyncio | https://www.python.org/、https://pypi.org/project/requests/ |
Etsy 批量上架 | Etsy Open API | https://developers.etsy.com/ |
自动化工作流 | Zapier / Make | https://zapier.com/、https://www.make.com/ |
图像处理与优化 | ImageMagick / Pillow | https://imagemagick.org/、https://pypi.org/project/Pillow/ |
版本管理与部署 | Git / GitHub Actions | https://github.com/ |
/wallpaper stunning cosmic galaxy, high resolution, 4K, vibrant colors, symmetrical composition --ar 16:9 --v 5
/avatar futuristic cyberpunk character portrait, clean lines, high detail, transparent background --ar 1:1 --v 5
--ar
:长宽比;--v
:渲染版本;import os
import asyncio
import aiohttp
TOKEN = os.getenv("DISCORD_BOT_TOKEN")
CHANNEL_ID = "你的_midjourney_频道ID"
PROMPTS = [...] # 从外部文件读取 Prompt 列表
async def send_prompt(session, prompt):
url = f"https://discord.com/api/v9/channels/{CHANNEL_ID}/messages"
headers = {
"Authorization": f"Bot {TOKEN}",
"Content-Type": "application/json"
}
data = {"content": f"/imagine {prompt}"}
async with session.post(url, json=data, headers=headers) as resp:
return await resp.json()
async def main():
async with aiohttp.ClientSession() as session:
tasks = [send_prompt(session, p) for p in PROMPTS]
results = await asyncio.gather(*tasks)
print("已发送全部请求", results)
if __name__ == "__main__":
asyncio.run(main())
aiohttp
实现高并发;生成完毕后,监听 Bot 的消息并提取图片 URL,自动下载到本地,并按主题分类存储:
import os
import requests
def download_image(url, save_path):
resp = requests.get(url)
with open(save_path, "wb") as f:
f.write(resp.content)
# 遍历已保存的消息记录,提取 URL 并调用 download_image
使用 ImageMagick 或 Pillow:
# ImageMagick: 将所有图片统一裁剪为 1080x1080
magick mogrify -path output/ -resize 1080x1080^ -gravity center -extent 1080x1080 input/*.png
from PIL import Image, ImageDraw, ImageFont
def add_watermark(image_path, text, out_path):
img = Image.open(image_path).convert("RGBA")
watermark = Image.new("RGBA", img.size)
draw = ImageDraw.Draw(watermark)
font = ImageFont.truetype("arial.ttf", 24)
draw.text((10, img.height-30), text, font=font, fill=(255,255,255,128))
combined = Image.alpha_composite(img, watermark)
combined.save(out_path)
api_key
;import requests
import os
API_KEY = os.getenv("ETSY_API_KEY")
SHOP_ID = os.getenv("ETSY_SHOP_ID")
IMAGE_FOLDER = "output/"
def create_listing(title, description, price, image_path):
url = f"https://openapi.etsy.com/v3/application/shops/{SHOP_ID}/listings"
headers = {"x-api-key": API_KEY}
listing_data = {
"title": title,
"description": description,
"price": price,
"quantity": 999,
"shop_section_id": None,
"who_made": "i_did",
"is_supply": False,
"when_made": "made_to_order",
"state": "draft"
}
resp = requests.post(url, json=listing_data, headers=headers)
listing = resp.json()
# 上传图片
upload_url = f"{url}/{listing['listing_id']}/images"
files = {"file": open(image_path, "rb")}
requests.post(upload_url, files=files, headers=headers)
for filename in os.listdir(IMAGE_FOLDER):
title = os.path.splitext(filename)[0]
create_listing(title, f"AI 生成壁纸:{title}", "5.00", os.path.join(IMAGE_FOLDER, filename))
利用 Flask + Chart.js 自建一个后台仪表盘,实时监控:
“AI 设计小店”模式,最大的魅力在于**“低成本、高回报、自动化运营”**。只要掌握了 Midjourney 的批量生产技巧、Etsy 的上架与优化策略,并辅以合理的自动化流程,你也能在 2025 年实现“躺着赚钱”的理想。
现在就行动起来:注册 Midjourney,准备你的第一批 Prompt;开启 Etsy 店铺,制定上架计划;自动化脚本帮你解放双手——AI 设计小店的成功之路,从此刻启程!