eachlabs-image-generation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEachLabs Image Generation
EachLabs 图像生成
Generate new images from text prompts using 60+ AI models via the EachLabs Predictions API. For editing existing images (upscaling, background removal, style transfer, inpainting, face swap, 3D), see the skill.
eachlabs-image-edit通过EachLabs Predictions API,利用60余种AI模型根据文本提示生成新图像。如需编辑现有图像(包括放大、背景移除、风格迁移、图像修复、人脸替换、3D处理等),请查看技能。
eachlabs-image-editAuthentication
身份验证
Header: X-API-Key: <your-api-key>Set the environment variable. Get your key at eachlabs.ai.
EACHLABS_API_KEYHeader: X-API-Key: <your-api-key>设置环境变量。可前往eachlabs.ai获取您的密钥。
EACHLABS_API_KEYQuick Start
快速开始
1. Create a Prediction
1. 创建预测任务
bash
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": "A serene Japanese garden with cherry blossoms, watercolor style",
"image_size": "landscape_16_9",
"num_images": 1,
"output_format": "png"
}
}'bash
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": "A serene Japanese garden with cherry blossoms, watercolor style",
"image_size": "landscape_16_9",
"num_images": 1,
"output_format": "png"
}
}'2. Poll for Result
2. 轮询获取结果
bash
curl https://api.eachlabs.ai/v1/prediction/{prediction_id} \
-H "X-API-Key: $EACHLABS_API_KEY"Poll until is or . The output image URL is in the response.
status"success""failed"bash
curl https://api.eachlabs.ai/v1/prediction/{prediction_id} \
-H "X-API-Key: $EACHLABS_API_KEY"持续轮询直到变为或。输出图像的URL将包含在响应结果中。
status"success""failed"Model Selection Guide
模型选择指南
Text-to-Image
文本转图像
| Model | Slug | Best For |
|---|---|---|
| Flux 2 Turbo | | Fast, high quality general purpose |
| Flux 2 Flash | | Fastest Flux generation |
| Flux 2 Max | | Highest quality Flux |
| Flux 2 Klein 9B | | Balanced quality/speed |
| Flux 2 Pro | | Pro quality |
| Flux 2 Flex | | Flexible outputs |
| Flux 2 LoRA | | LoRA-powered generation |
| XAI Grok Imagine | | Creative and artistic |
| GPT Image v1.5 | | High quality, transparent bg |
| Bytedance Seedream v4.5 | | Bytedance latest |
| Gemini 3 Pro Image | | Google's latest |
| Imagen 4 | | Google Imagen 4 |
| Imagen 4 Fast | | Fast Google quality |
| Reve | | Artistic text-to-image |
| Hunyuan Image v3 | | Tencent's latest |
| Ideogram V3 Turbo | | Text in images |
| Minimax | | High quality |
| Wan v2.6 | | Chinese/English bilingual |
| P Image | | Custom aspect ratios |
| Nano Banana Pro | | Fast, lightweight |
| Vidu Q2 | | Latest Vidu |
| 模型 | 标识(Slug) | 适用场景 |
|---|---|---|
| Flux 2 Turbo | | 快速、高质量通用型 |
| Flux 2 Flash | | 速度最快的Flux生成模型 |
| Flux 2 Max | | 最高质量的Flux模型 |
| Flux 2 Klein 9B | | 质量与速度平衡型 |
| Flux 2 Pro | | 专业级质量 |
| Flux 2 Flex | | 输出灵活型 |
| Flux 2 LoRA | | 基于LoRA的生成模型 |
| XAI Grok Imagine | | 创意艺术型 |
| GPT Image v1.5 | | 高质量、透明背景 |
| Bytedance Seedream v4.5 | | 字节跳动最新模型 |
| Gemini 3 Pro Image | | Google最新模型 |
| Imagen 4 | | Google Imagen 4 |
| Imagen 4 Fast | | 快速Google质量型 |
| Reve | | 艺术化文本转图像 |
| Hunyuan Image v3 | | 腾讯最新模型 |
| Ideogram V3 Turbo | | 图像中包含文字 |
| Minimax | | 高质量型 |
| Wan v2.6 | | 中英双语支持 |
| P Image | | 自定义宽高比 |
| Nano Banana Pro | | 快速轻量型 |
| Vidu Q2 | | 最新Vidu模型 |
Training
模型训练
| Model | Slug | Best For |
|---|---|---|
| Z Image Trainer | | Custom LoRA training |
| Flux LoRA Portrait Trainer | | Portrait LoRA |
| Flux Turbo Trainer | | Fast LoRA training |
| 模型 | 标识(Slug) | 适用场景 |
|---|---|---|
| Z Image Trainer | | 自定义LoRA训练 |
| Flux LoRA Portrait Trainer | | 人像LoRA训练 |
| Flux Turbo Trainer | | 快速LoRA训练 |
Prediction Flow
预测流程
- Check model — validates the model exists and returns the
GET https://api.eachlabs.ai/v1/model?slug=<slug>with exact input parameters. Always do this before creating a prediction to ensure correct inputs.request_schema - POST with model slug, version
https://api.eachlabs.ai/v1/prediction, and input parameters matching the schema"0.0.1" - Poll until status is
GET https://api.eachlabs.ai/v1/prediction/{id}or"success""failed" - Extract the output image URL(s) from the response
- 验证模型:调用—— 验证模型是否存在,并返回包含确切输入参数的
GET https://api.eachlabs.ai/v1/model?slug=<slug>。创建预测任务前务必执行此步骤,确保输入参数正确。request_schema - 创建预测:向发送POST请求,携带模型标识、版本
https://api.eachlabs.ai/v1/prediction以及符合schema的输入参数"0.0.1" - 轮询结果:调用持续轮询,直到状态变为
GET https://api.eachlabs.ai/v1/prediction/{id}或"success""failed" - 提取结果:从响应中获取输出图像的URL
Examples
示例
Text-to-Image with Flux 2 Turbo
使用Flux 2 Turbo进行文本转图像
bash
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": "A red vintage Porsche 911 on a winding mountain road at golden hour, photorealistic",
"image_size": "landscape_16_9",
"num_images": 1,
"output_format": "png"
}
}'bash
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": "A red vintage Porsche 911 on a winding mountain road at golden hour, photorealistic",
"image_size": "landscape_16_9",
"num_images": 1,
"output_format": "png"
}
}'Text-to-Image with GPT Image v1.5
使用GPT Image v1.5进行文本转图像
bash
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": "A minimalist logo for a coffee shop called Brew Lab, clean vector style",
"background": "transparent",
"quality": "high",
"output_format": "png"
}
}'bash
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": "A minimalist logo for a coffee shop called Brew Lab, clean vector style",
"background": "transparent",
"quality": "high",
"output_format": "png"
}
}'Text-to-Image with Imagen 4
使用Imagen 4进行文本转图像
bash
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": "A whimsical fairy tale castle on a floating island, digital art, highly detailed"
}
}'bash
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": "A whimsical fairy tale castle on a floating island, digital art, highly detailed"
}
}'Image Size Options
图像尺寸选项
Most Flux 2 and Wan models use these presets:
- — Square, high definition
square_hd - — Square, standard
square - — Portrait 4:3
portrait_4_3 - — Portrait 16:9
portrait_16_9 - — Landscape 4:3
landscape_4_3 - — Landscape 16:9
landscape_16_9
P Image models use aspect ratio strings: , , , , , , ,
1:116:99:164:33:43:22:3custom大多数Flux 2和Wan模型支持以下预设尺寸:
- —— 高清正方形
square_hd - —— 标准正方形
square - —— 竖屏4:3
portrait_4_3 - —— 竖屏16:9
portrait_16_9 - —— 横屏4:3
landscape_4_3 - —— 横屏16:9
landscape_16_9
P Image模型使用宽高比字符串:, , , , , , ,
1:116:99:164:33:43:22:3customPrompt Tips
提示词技巧
- Be specific and descriptive: "A red vintage Porsche 911 on a winding mountain road at golden hour" vs "a car"
- Include style: "digital art", "oil painting", "photorealistic", "watercolor"
- For edits, clearly describe the change: "Replace the sky with a dramatic sunset"
- Use negative prompts (where supported) to avoid: "blurry, low quality, distorted"
- For multi-image edits, reference images by number: "image 1", "image 2"
- 描述要具体详细:比如“黄金时段,蜿蜒山路上的红色复古保时捷911”优于“一辆汽车”
- 包含风格描述:比如“数字艺术”、“油画”、“写实摄影”、“水彩画”
- 若涉及编辑,明确描述修改内容:比如“将天空替换为壮观的日落”
- (在支持的模型中)使用负面提示词避免不理想效果:比如“模糊、低质量、失真”
- 多图像编辑时,按编号引用图像:比如“image 1”、“image 2”
Parameter Reference
参数参考
See references/MODELS.md for complete parameter details for each model.
各模型的完整参数详情请查看references/MODELS.md。