Skip to content

Kolors Image Generation

Kuaishou Kolors model — ultra-low-cost image generation with Chinese and English prompt support, multiple aspect ratios, and batch generation. Ideal for high-volume generation and testing.

Quick Start

python
from openai import OpenAI

client = OpenAI(
    base_url="https://open.dieyuyun.com/v1",
    api_key="YOUR_API_KEY"
)

response = client.images.generate(
    model="Kwai-Kolors/Kolors",
    prompt="An orange tabby cat sitting on a windowsill watching the rain, watercolor style, warm tones",
    size="1024x1024",
    n=1
)

print(response.data[0].url)

Endpoint

ItemValue
MethodPOST
Path/v1/images/generations
Base URLhttps://open.dieyuyun.com
ProtocolOpenAI Images API

Authentication

Bearer Token: Authorization: Bearer YOUR_API_KEY

Standard Request Fields

FieldTypeRequiredDefaultDescription
modelstringYesModel ID: Kwai-Kolors/Kolors
promptstringYesImage description (CN/EN supported)
sizestringNo1024x1024Image dimensions (width×height)
nintegerNo1Number of images (range 1-4)

Supported Sizes

SizeRatio
1024x10241:1
768x10243:4
1024x7684:3
720x12809:16
1280x72016:9

Extended Parameters

FieldTypeRequiredDefaultDescription
negative_promptstringNoUnwanted elements description
seedintegerNoRandom seed for reproducibility (0-9999999999)
num_inference_stepsintegerNo20Inference steps — more = higher quality (1-100)
guidance_scalenumberNo7.5Prompt adherence strength (0-20)

Request Examples

bash
curl https://open.dieyuyun.com/v1/images/generations \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Kwai-Kolors/Kolors",
    "prompt": "An orange tabby cat sitting on a windowsill watching the rain, watercolor style, warm tones",
    "size": "1024x1024",
    "n": 1
  }'
python
from openai import OpenAI

client = OpenAI(
    base_url="https://open.dieyuyun.com/v1",
    api_key="YOUR_API_KEY"
)

response = client.images.generate(
    model="Kwai-Kolors/Kolors",
    prompt="An orange tabby cat sitting on a windowsill watching the rain, watercolor style, warm tones",
    size="1024x1024",
    n=1
)

print(response.data[0].url)
javascript
import OpenAI from 'openai'

const client = new OpenAI({
  baseURL: 'https://open.dieyuyun.com/v1',
  apiKey: 'YOUR_API_KEY',
})

const response = await client.images.generate({
  model: 'Kwai-Kolors/Kolors',
  prompt: 'An orange tabby cat sitting on a windowsill watching the rain, watercolor style, warm tones',
  size: '1024x1024',
  n: 1,
})

console.log(response.data[0].url)

Response Format

Success Response

json
{
  "created": 1717000000,
  "data": [
    {
      "url": "https://..."
    }
  ],
  "usage": {
    "generated_images": 1,
    "total_tokens": 0
  }
}
FieldTypeDescription
createdintegerUnix timestamp
dataarrayGenerated results array
data[].urlstringImage URL
usageobjectUsage statistics
usage.generated_imagesintegerNumber of generated images
usage.total_tokensintegerTotal tokens consumed

Error Response

See Error Codes.

Key Features

Ultra-Low Cost

At just ¥0.01 per image, Kolors is the most affordable image generation model on the platform — perfect for high-volume generation and testing.

Batch Generation

Generate up to 4 images per request with the n parameter, ideal for comparing multiple variations.

python
response = client.images.generate(
    model="Kwai-Kolors/Kolors",
    prompt="Modern minimalist living room design",
    size="1024x1024",
    n=4
)

for img in response.data:
    print(img.url)

Fine-Grained Control

Use guidance_scale and num_inference_steps to precisely tune generation quality:

python
response = client.images.generate(
    model="Kwai-Kolors/Kolors",
    prompt="Cyberpunk city at night",
    size="1280x720",
    guidance_scale=12.0,
    num_inference_steps=50
)

Best Practices

  • Batch generation: Use n to generate multiple candidates and pick the best one.
  • Negative prompts: Use negative_prompt to exclude unwanted elements, e.g. "low quality, blurry, deformed".
  • Prompt tips: Supports mixed Chinese and English prompts. The more specific the description, the better the result.
  • Reproducibility: Save the seed value to reproduce similar results for iterative refinement.
  • Step tuning: Default 20 steps is sufficient for most cases. Increase to 50-100 for higher quality.

Rate Limits

See Rate Limits.