eachlabs-image-generation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

EachLabs 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
eachlabs-image-edit
skill.
通过EachLabs Predictions API,利用60余种AI模型根据文本提示生成新图像。如需编辑现有图像(包括放大、背景移除、风格迁移、图像修复、人脸替换、3D处理等),请查看
eachlabs-image-edit
技能。

Authentication

身份验证

Header: X-API-Key: <your-api-key>
Set the
EACHLABS_API_KEY
environment variable. Get your key at eachlabs.ai.
Header: X-API-Key: <your-api-key>
设置
EACHLABS_API_KEY
环境变量。可前往eachlabs.ai获取您的密钥。

Quick 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
status
is
"success"
or
"failed"
. The output image URL is in the response.
bash
curl https://api.eachlabs.ai/v1/prediction/{prediction_id} \
  -H "X-API-Key: $EACHLABS_API_KEY"
持续轮询直到
status
变为
"success"
"failed"
。输出图像的URL将包含在响应结果中。

Model Selection Guide

模型选择指南

Text-to-Image

文本转图像

ModelSlugBest For
Flux 2 Turbo
flux-2-turbo-text-to-image
Fast, high quality general purpose
Flux 2 Flash
flux-2-flash-text-to-image
Fastest Flux generation
Flux 2 Max
flux-2-max-text-to-image
Highest quality Flux
Flux 2 Klein 9B
flux-2-klein-9b-base-text-to-image
Balanced quality/speed
Flux 2 Pro
flux-2-pro
Pro quality
Flux 2 Flex
flux-2-flex
Flexible outputs
Flux 2 LoRA
flux-2-lora
LoRA-powered generation
XAI Grok Imagine
xai-grok-imagine-text-to-image
Creative and artistic
GPT Image v1.5
gpt-image-v1-5-text-to-image
High quality, transparent bg
Bytedance Seedream v4.5
bytedance-seedream-v4-5-text-to-image
Bytedance latest
Gemini 3 Pro Image
gemini-3-pro-image-preview
Google's latest
Imagen 4
imagen4-preview
Google Imagen 4
Imagen 4 Fast
imagen-4-fast
Fast Google quality
Reve
reve-text-to-image
Artistic text-to-image
Hunyuan Image v3
hunyuan-image-v3-text-to-image
Tencent's latest
Ideogram V3 Turbo
ideogram-v3-turbo
Text in images
Minimax
minimax-text-to-image
High quality
Wan v2.6
wan-v2-6-text-to-image
Chinese/English bilingual
P Image
p-image-text-to-image
Custom aspect ratios
Nano Banana Pro
nano-banana-pro
Fast, lightweight
Vidu Q2
vidu-q2-text-to-image
Latest Vidu
模型标识(Slug)适用场景
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
高质量、透明背景
Bytedance Seedream v4.5
bytedance-seedream-v4-5-text-to-image
字节跳动最新模型
Gemini 3 Pro Image
gemini-3-pro-image-preview
Google最新模型
Imagen 4
imagen4-preview
Google Imagen 4
Imagen 4 Fast
imagen-4-fast
快速Google质量型
Reve
reve-text-to-image
艺术化文本转图像
Hunyuan 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模型

Training

模型训练

ModelSlugBest For
Z Image Trainer
z-image-trainer
Custom LoRA training
Flux LoRA Portrait Trainer
flux-lora-portrait-trainer
Portrait LoRA
Flux Turbo Trainer
flux-turbo-trainer
Fast LoRA training
模型标识(Slug)适用场景
Z Image Trainer
z-image-trainer
自定义LoRA训练
Flux LoRA Portrait Trainer
flux-lora-portrait-trainer
人像LoRA训练
Flux Turbo Trainer
flux-turbo-trainer
快速LoRA训练

Prediction Flow

预测流程

  1. Check model
    GET https://api.eachlabs.ai/v1/model?slug=<slug>
    — validates the model exists and returns the
    request_schema
    with exact input parameters. Always do this before creating a prediction to ensure correct inputs.
  2. POST
    https://api.eachlabs.ai/v1/prediction
    with model slug, version
    "0.0.1"
    , and input parameters matching the schema
  3. Poll
    GET https://api.eachlabs.ai/v1/prediction/{id}
    until status is
    "success"
    or
    "failed"
  4. Extract the output image URL(s) from the response
  1. 验证模型:调用
    GET https://api.eachlabs.ai/v1/model?slug=<slug>
    —— 验证模型是否存在,并返回包含确切输入参数的
    request_schema
    。创建预测任务前务必执行此步骤,确保输入参数正确。
  2. 创建预测:向
    https://api.eachlabs.ai/v1/prediction
    发送POST请求,携带模型标识、版本
    "0.0.1"
    以及符合schema的输入参数
  3. 轮询结果:调用
    GET https://api.eachlabs.ai/v1/prediction/{id}
    持续轮询,直到状态变为
    "success"
    "failed"
  4. 提取结果:从响应中获取输出图像的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_hd
    — Square, high definition
  • square
    — Square, standard
  • 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:1
,
16:9
,
9:16
,
4:3
,
3:4
,
3:2
,
2:3
,
custom
大多数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

Prompt 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