名称: eachlabs-image-generation
描述: 使用 EachLabs AI 模型,根据文本提示生成新图像。支持多种模型系列(如 Flux、GPT Image、Gemini、Imagen、Seedream 等)的文生图功能。当用户希望从文本创建新图像时使用。如需编辑现有图像,请参阅 eachlabs-image-edit。
元数据:
author: eachlabs
version: "1.0"
通过 EachLabs Predictions API,使用 60 多种 AI 模型,根据文本提示生成新图像。如需编辑现有图像(如放大、背景移除、风格迁移、修复、换脸、3D 化等),请使用 eachlabs-image-edit 技能。
请求头: X-API-Key: <你的API密钥>
请设置 EACHLABS_API_KEY 环境变量。可在 eachlabs.ai 获取你的密钥。
curl -X POST https://api.eachlabs.ai/v1/prediction \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"model": "flux-2-turbo-text-to-image",
"version": "0.0.1",
"input": {
"prompt": "一个宁静的日式花园,樱花盛开,水彩风格",
"image_size": "landscape_16_9",
"num_images": 1,
"output_format": "png"
}
}'
curl https://api.eachlabs.ai/v1/prediction/{prediction_id} \
-H "X-API-Key: $EACHLABS_API_KEY"
持续轮询,直到 status 变为 "success" 或 "failed"。输出图像的 URL 将在响应中返回。
| 模型 | 标识符 | 最佳适用场景 |
|---|---|---|
| Flux 2 Turbo | flux-2-turbo-text-to-image |
快速、高质量的通用场景 |
| Flux 2 Flash | flux-2-flash-text-to-image |
最快的 Flux 生成 |
| Flux 2 Max | flux-2-max-text-to-image |
最高质量的 Flux |
| Flux 2 Klein 9B | flux-2-klein-9b-base-text-to-image |
质量与速度的平衡 |
| Flux 2 Pro | flux-2-pro |
专业级质量 |
| Flux 2 Flex | flux-2-flex |
灵活的生成输出 |
| Flux 2 LoRA | flux-2-lora |
支持 LoRA 的生成 |
| XAI Grok Imagine | xai-grok-imagine-text-to-image |
创意与艺术性 |
| GPT Image v1.5 | gpt-image-v1-5-text-to-image |
高质量,支持透明背景 |
| 字节跳动 Seedream v4.5 | bytedance-seedream-v4-5-text-to-image |
字节跳动最新模型 |
| Gemini 3 Pro Image | gemini-3-pro-image-preview |
谷歌最新模型 |
| Imagen 4 | imagen4-preview |
谷歌 Imagen 4 |
| Imagen 4 Fast | imagen-4-fast |
快速的谷歌质量模型 |
| Reve | reve-text-to-image |
艺术风格文生图 |
| 腾讯混元图像 v3 | hunyuan-image-v3-text-to-image |
腾讯最新模型 |
| Ideogram V3 Turbo | ideogram-v3-turbo |
图像内嵌文字 |
| Minimax | minimax-text-to-image |
高质量生成 |
| Wan v2.6 | wan-v2-6-text-to-image |
中英双语支持 |
| P Image | p-image-text-to-image |
自定义宽高比 |
| Nano Banana Pro | nano-banana-pro |
快速、轻量级 |
| Vidu Q2 | vidu-q2-text-to-image |
最新 Vidu 模型 |
| 模型 | 标识符 | 最佳适用场景 |
|---|---|---|
| Z Image Trainer | z-image-trainer |
自定义 LoRA 训练 |
| Flux LoRA 人像训练器 | flux-lora-portrait-trainer |
人像 LoRA 训练 |
| Flux Turbo 训练器 | flux-turbo-trainer |
快速 LoRA 训练 |
GET https://api.eachlabs.ai/v1/model?slug=<slug> — 验证模型是否存在,并返回包含精确输入参数的 request_schema。创建预测任务前务必执行此步骤,以确保输入正确。https://api.eachlabs.ai/v1/prediction,包含模型标识符、版本 "0.0.1" 以及符合 schema 的输入参数。GET https://api.eachlabs.ai/v1/prediction/{id},直到状态变为 "success" 或 "failed"。curl -X POST https://api.eachlabs.ai/v1/prediction \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"model": "flux-2-turbo-text-to-image",
"version": "0.0.1",
"input": {
"prompt": "一辆红色复古保时捷 911 行驶在黄金时分的蜿蜒山路上,照片级真实感",
"image_size": "landscape_16_9",
"num_images": 1,
"output_format": "png"
}
}'
curl -X POST https://api.eachlabs.ai/v1/prediction \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"model": "gpt-image-v1-5-text-to-image",
"version": "0.0.1",
"input": {
"prompt": "一家名为 Brew Lab 的咖啡店的极简主义标志,简洁矢量风格",
"background": "transparent",
"quality": "high",
"output_format": "png"
}
}'
curl -X POST https://api.eachlabs.ai/v1/prediction \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"model": "imagen4-preview",
"version": "0.0.1",
"input": {
"prompt": "漂浮岛屿上的奇幻童话城堡,数字艺术,高度细节化"
}
}'
大多数 Flux 2 和 Wan 模型使用以下预设:
- square_hd — 正方形,高清
- square — 正方形,标准
- portrait_4_3 — 纵向 4:3
- portrait_16_9 — 纵向 16:9
- landscape_4_3 — 横向 4:3
- landscape_16_9 — 横向 16:9
P Image 模型使用宽高比字符串:1:1、16:9、9:16、4:3、3:4、3:2、2:3、custom
GET /v1/model?slug=<slug> 验证模型标识符。各模型的完整参数详情,请参阅 references/MODELS.md。