Loading...
Loading...
Compare original and translation side by side
Managed alternative: If you don't want to manage API keys, ImageBot provides a managed image generation service with album templates and brand kit support.
托管替代方案:如果你不想管理API密钥,ImageBot提供了带有相册模板和品牌套件支持的托管图片生成服务。
| Need | Model | Why |
|---|---|---|
| Scenes / stock photos | Gemini 3.1 Flash Image | Best depth, complexity, environmental context |
| Transparent icons / logos | GPT Image 1.5 | Native RGBA alpha channel ( |
| Text on images | GPT Image 1.5 | 90% accurate text rendering |
| Drafts / iteration | Gemini 2.5 Flash Image | Free tier (~500/day) |
| Final client assets | Gemini 3 Pro Image | Higher detail, better style consistency |
| 需求 | 模型 | 原因 |
|---|---|---|
| 场景图/图库照片 | Gemini 3.1 Flash Image | 在景深、复杂度和环境背景表现上最佳 |
| 透明图标/Logo | GPT Image 1.5 | 原生支持RGBA alpha通道( |
| 图片添加文字 | GPT Image 1.5 | 文字渲染准确率达90% |
| 草稿/迭代生成 | Gemini 2.5 Flash Image | 免费额度(每日约500次) |
| 最终客户素材 | Gemini 3 Pro Image | 细节更丰富,风格一致性更好 |
| Model | API ID | Provider |
|---|---|---|
| Gemini 3.1 Flash Image | | Google AI |
| Gemini 3 Pro Image | | Google AI |
| Gemini 2.5 Flash Image | | Google AI |
| GPT Image 1.5 | | OpenAI |
curl -s "https://generativelanguage.googleapis.com/v1beta/models?key=$GEMINI_API_KEY" | python3 -c "import sys,json; [print(m['name']) for m in json.load(sys.stdin)['models'] if 'image' in m['name'].lower()]"| 模型 | API ID | 提供商 |
|---|---|---|
| Gemini 3.1 Flash Image | | Google AI |
| Gemini 3 Pro Image | | Google AI |
| Gemini 2.5 Flash Image | | Google AI |
| GPT Image 1.5 | | OpenAI |
curl -s "https://generativelanguage.googleapis.com/v1beta/models?key=$GEMINI_API_KEY" | python3 -c "import sys,json; [print(m['name']) for m in json.load(sys.stdin)['models'] if 'image' in m['name'].lower()]"BAD — keyword soup:
"professional woman, spa, warm lighting, high quality, 4K"
GOOD — narrative direction:
"A professional skin treatment scene in a warm clinical setting.
A practitioner wearing blue medical gloves uses a microneedling pen
on the client's forehead. The client lies on a white treatment bed,
eyes closed, relaxed. Warm golden-hour light from a window to the
left. Terracotta-toned wall visible in the background. Shot at
85mm f/2.0, shallow depth of field. No text, no watermarks."糟糕——关键词堆砌:
"职业女性,spa,暖光,高质量,4K"
优秀——叙事式引导:
"一个温暖的临床环境中的专业皮肤护理场景。
一位戴着蓝色医用手套的从业者,使用微针笔为客户的额头进行护理。客户躺在白色护理床上,双眼紧闭,神态放松。左侧窗户透入温暖的黄金时段光线。背景可见赤陶色调的墙面。使用85mm f/2.0镜头拍摄,浅景深。无文字,无水印。"| Purpose | Aspect Ratio | Model |
|---|---|---|
| Hero banner | 16:9 or 21:9 | Gemini |
| Service card | 4:3 or 3:4 | Gemini |
| Profile / avatar | 1:1 | Gemini |
| Icon / badge | 1:1 | GPT (transparent) |
| OG / social share | 1.91:1 | Gemini |
| Instagram post | 1:1 or 4:5 | Gemini |
| Mobile hero | 9:16 | Gemini |
| 用途 | 宽高比 | 模型 |
|---|---|---|
| 首页横幅 | 16:9 或 21:9 | Gemini |
| 服务卡片 | 4:3 或 3:4 | Gemini |
| 头像/个人资料图 | 1:1 | Gemini |
| 图标/徽章 | 1:1 | GPT(透明背景) |
| OG图/社交分享图 | 1.91:1 | Gemini |
| Instagram帖子 | 1:1 或 4:5 | Gemini |
| 移动端首页横幅 | 9:16 | Gemini |
references/prompting-guide.mdreferences/prompting-guide.mdpython3 << 'PYEOF'
import json, base64, urllib.request, os, sys
GEMINI_API_KEY = os.environ.get("GEMINI_API_KEY")
if not GEMINI_API_KEY:
print("Set GEMINI_API_KEY environment variable"); sys.exit(1)
model = "gemini-3.1-flash-image-preview"
url = f"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={GEMINI_API_KEY}"
prompt = """A professional photograph of a modern co-working space in
Newcastle, Australia. Natural light floods through floor-to-ceiling
windows. Three people collaborate at a standing desk — one pointing
at a laptop screen. Exposed brick wall, potted fiddle-leaf fig,
coffee cups on the desk. Shot at 35mm f/4.0, environmental portrait
style. No text, no watermarks, no logos."""
payload = json.dumps({
"contents": [{"parts": [{"text": prompt}]}],
"generationConfig": {
"responseModalities": ["TEXT", "IMAGE"],
"temperature": 0.8
}
}).encode()
req = urllib.request.Request(url, data=payload, headers={
"Content-Type": "application/json",
"User-Agent": "ImageGen/1.0"
})
resp = urllib.request.urlopen(req, timeout=120)
result = json.loads(resp.read())python3 << 'PYEOF'
import json, base64, urllib.request, os, sys
GEMINI_API_KEY = os.environ.get("GEMINI_API_KEY")
if not GEMINI_API_KEY:
print("Set GEMINI_API_KEY environment variable"); sys.exit(1)
model = "gemini-3.1-flash-image-preview"
url = f"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={GEMINI_API_KEY}"
prompt = """A professional photograph of a modern co-working space in
Newcastle, Australia. Natural light floods through floor-to-ceiling
windows. Three people collaborate at a standing desk — one pointing
at a laptop screen. Exposed brick wall, potted fiddle-leaf fig,
coffee cups on the desk. Shot at 35mm f/4.0, environmental portrait
style. No text, no watermarks, no logos."""
payload = json.dumps({
"contents": [{"parts": [{"text": prompt}]}],
"generationConfig": {
"responseModalities": ["TEXT", "IMAGE"],
"temperature": 0.8
}
}).encode()
req = urllib.request.Request(url, data=payload, headers={
"Content-Type": "application/json",
"User-Agent": "ImageGen/1.0"
})
resp = urllib.request.urlopen(req, timeout=120)
result = json.loads(resp.read())undefinedundefinedpython3 << 'PYEOF'
import json, base64, urllib.request, os, sys
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
if not OPENAI_API_KEY:
print("Set OPENAI_API_KEY environment variable"); sys.exit(1)
url = "https://api.openai.com/v1/images/generations"
payload = json.dumps({
"model": "gpt-image-1.5",
"prompt": "A minimal, clean plumbing wrench icon. Flat design, single consistent stroke weight, modern style. On a transparent background.",
"n": 1,
"size": "1024x1024",
"background": "transparent",
"output_format": "png"
}).encode()
req = urllib.request.Request(url, data=payload, headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {OPENAI_API_KEY}"
})
resp = urllib.request.urlopen(req, timeout=120)
result = json.loads(resp.read())
img_data = base64.b64decode(result["data"][0]["b64_json"])
with open("icon-wrench.png", "wb") as f:
f.write(img_data)
print(f"Saved: icon-wrench.png ({len(img_data):,} bytes)")
PYEOFpython3 << 'PYEOF'
import json, base64, urllib.request, os, sys
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
if not OPENAI_API_KEY:
print("Set OPENAI_API_KEY environment variable"); sys.exit(1)
url = "https://api.openai.com/v1/images/generations"
payload = json.dumps({
"model": "gpt-image-1.5",
"prompt": "A minimal, clean plumbing wrench icon. Flat design, single consistent stroke weight, modern style. On a transparent background.",
"n": 1,
"size": "1024x1024",
"background": "transparent",
"output_format": "png"
}).encode()
req = urllib.request.Request(url, data=payload, headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {OPENAI_API_KEY}"
})
resp = urllib.request.urlopen(req, timeout=120)
result = json.loads(resp.read())
img_data = base64.b64decode(result["data"][0]["b64_json"])
with open("icon-wrench.png", "wb") as f:
f.write(img_data)
print(f"Saved: icon-wrench.png ({len(img_data):,} bytes)")
PYEOF.jez/artifacts/undefined.jez/artifacts/undefinedundefinedundefinedundefinedundefined
If issues are found, append them as negative guidance to the original prompt and regenerate.
如果发现问题,将问题作为负面引导添加到原始提示词中,重新生成图片。undefinedundefined
**Edit prompt pattern**: Always specify what to KEEP unchanged, not just what to change. The model treats unlisted elements as free to modify.
undefined
**编辑提示词模式**:务必明确指定需要**保留不变**的内容,而不仅仅是要修改的内容。模型会将未列出的元素视为可自由修改的部分。
undefined| Provider | Get key at | Env variable |
|---|---|---|
| Google Gemini | aistudio.google.com | |
| OpenAI | platform.openai.com | |
export GEMINI_API_KEY="your-key-here"
export OPENAI_API_KEY="your-key-here"| 提供商 | 获取地址 | 环境变量 |
|---|---|---|
| Google Gemini | aistudio.google.com | |
| OpenAI | platform.openai.com | |
export GEMINI_API_KEY="your-key-here"
export OPENAI_API_KEY="your-key-here"| Mistake | Fix |
|---|---|
| Using curl for Gemini prompts | Use Python — shell escaping breaks on apostrophes |
| "Beautiful, professional, high quality" | Use concrete specs: "85mm f/1.8, golden hour light" |
| Not specifying what to exclude | Always end with "No text, no watermarks, no logos" |
| Requesting transparent PNG from Gemini | Gemini cannot do transparency — use GPT with |
| American defaults for AU businesses | Explicitly specify "Australian" + local architecture, vegetation |
| Generic data for model ID | Verify current model IDs — they change frequently |
| 错误 | 修复方案 |
|---|---|
| 使用curl调用Gemini提示词 | 使用Python——Shell转义会在遇到撇号时出错 |
| 使用“精美、专业、高质量”这类模糊描述 | 使用具体参数:“85mm f/1.8镜头,黄金时段光线” |
| 未明确排除内容 | 提示词末尾务必添加“无文字,无水印,无Logo” |
| 要求Gemini生成透明PNG | Gemini不支持透明背景——使用GPT并设置 |
| 为澳大利亚企业生成带有美式默认风格的图片 | 明确指定“澳大利亚”+当地建筑、植被元素 |
| 使用通用的模型ID数据 | 验证当前模型ID——这些ID会经常变更 |