为什么推荐多引擎组合而非死磕单一模型?
不同商业视觉任务对模型能力侧重截然不同,在 Aiozium 下只需切换 model 字符串即可在同一脚本里混用:
- 免抠透明素材 / 高性价比批量配图(¥0.05/张):
gpt-image-2.6-sunburst/gpt-image-2.6-flare - 4K 中英文促销海报 / 多图角色一致(¥0.10/张):
gemini-3-pro-image(Nano Banana Pro) - 国潮 / 国内电商主图中文直出:
seedream-5.5 - 强冲击社媒封面(¥0.10/张):
grok-imagine-image - 商业棚拍写实与视频首帧锚点:
flux-3-image/flux.2-pro
实战 1:直出免抠透明背景 PNG(GPT Image 2.6 · ¥0.05/张)
import base64
from openai import OpenAI
client = OpenAI(
base_url="https://www.aiozium.com/v1",
api_key="sk-your-aiozium-api-key",
timeout=120.0,
)
resp = client.images.generate(
model="gpt-image-2.6-sunburst",
prompt="Studio product shot of a matte cobalt titanium insulated coffee tumbler, centered, clean studio rim lighting, isolated object",
size="1024x1024",
extra_body={"background": "transparent", "output_format": "png"},
)
with open("tumbler-transparent.png", "wb") as f:
f.write(base64.b64decode(resp.data[0].b64_json))
实战 2:中英文促销海报防乱码 Prompt 模板(Nano Banana Pro · ¥0.10/张)
poster = client.images.generate(
model="gemini-3-pro-image",
prompt=(
'High-end minimalist e-commerce promotional poster for wireless noise-cancelling headphones '
'resting on dark basalt stone with soft cobalt rim light. '
'Top clean bold typography reading "双十二旗舰直降", '
'subtitle underneath reading "PRO AUDIO · 48H BATTERY", '
'crisp legible lettering, generous negative space, 4K commercial photography'
),
size="1024x1536",
)
实战 3:Python 异步批量生产管线(含并发控制)
import asyncio, base64, os
from pathlib import Path
from openai import AsyncOpenAI
client = AsyncOpenAI(base_url="https://www.aiozium.com/v1", api_key=os.environ["AIOZIUM_API_KEY"], timeout=120.0)
SEM = asyncio.Semaphore(4)
SKUS = [
("sku-01", "gpt-image-2.6-sunburst", "Matte black mechanical keyboard on oak desk, morning sunlight"),
("sku-02", "gemini-3-pro-image", 'Minimalist skincare serum bottle on frosted glass, clean label reading "PURE LAB"'),
("sku-03", "grok-imagine-image", "Futuristic neon cobalt cyberpunk gaming mouse floating over dark grid"),
]
async def render_sku(sku_id: str, model: str, prompt: str):
async with SEM:
res = await client.images.generate(model=model, prompt=prompt, size="1024x1024")
out = Path("out") / f"{sku_id}.png"
out.parent.mkdir(exist_ok=True)
if res.data[0].b64_json:
out.write_bytes(base64.b64decode(res.data[0].b64_json))
print(f"Saved {out} via {model}")
async def main():
await asyncio.gather(*(render_sku(*item) for item in SKUS))
asyncio.run(main()) 相关问答
如何避免 AI 生成海报上的中英文标题出现错别字?
三条实战铁律:(1)优先选用 gemini-3-pro-image(Nano Banana Pro)或 seedream-5.5;(2)把需要出现在画面上的文字用双引号清晰括起来,每次控制在 15 字以内主副标题;(3)明确指定字体风格与摆放区域(如顶部居中粗体白字)。
批量出图并发设置多少合适?
建议用信号量将同时在途出图任务控制在 3–5 个,单请求超时设为 120 秒,并对偶发 429/502 做带抖动的指数退避。