Kolors

Kolors is a cutting-edge text-to-image model that bridges language and visual art. Transform your textual ideas into photorealistic images with semantic precision.

~86.83s
~$0.098
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/kolors"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "cfg": 6,
12    "seed": 441234134,
13    "steps": 25,
14    "width": 1024,
15    "height": 1024,
16    "prompt": "In this lively 2D illustration, three animated boys joyfully have their laughter filling the air. , adding warmth and charm. The agave field behind them radiates warmth, emphasizing the authenticity of this gathering spot and the togetherness of the boys sharing a moment of joy.",
17    "scheduler": "EulerDiscreteScheduler",
18    "output_format": "webp",
19    "output_quality": 80,
20    "number_of_images": 1
21}
22
23response = requests.post(url, headers=headers, json=data)
24
25if response.status_code == 200:
26    result = response.json()
27    print(json.dumps(result, indent=2))
28else:
29    print(f"Error: {response.status_code}")
30    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/kolors

Parameters

promptrequired
string
Default: "In this lively 2D illustration, three animated boys joyfully have their laughter filling the air. , adding warmth and charm. The agave field behind them radiates warmth, emphasizing the authenticity of this gathering spot and the togetherness of the boys sharing a moment of joy."
cfgoptional
number

Guidance scale

Default: 6Range: 0 - 20
heightoptional
integer

Height of the image

Default: 1024Range: 512 - 2048
negative_promptoptional
string

Things you do not want to see in your image

Default: ""
number_of_imagesoptional
integer

Number of images to generate

Default: 1Range: 1 - 10
output_formatoptional
string

An enumeration.

Default: "webp"
Allowed values :
"webp""jpg""png"
output_qualityoptional
integer

Quality of the output images, from 0 to 100. 100 is best quality, 0 is lowest quality.

Default: 80Range: 0 - 100
scheduleroptional
string

An enumeration.

Default: "EulerDiscreteScheduler"
Allowed values :
"EulerDiscreteScheduler""EulerAncestralDiscreteScheduler""DPMSolverMultistepScheduler""DPMSolverMultistepScheduler_SDE_karras""UniPCMultistepScheduler""DEISMultistepScheduler"
seedoptional
integer

Set a seed for reproducibility. Random by default.

Default: 441234134
stepsoptional
integer

Number of inference steps

Default: 25Range: 1 - 50
widthoptional
integer

Width of the image

Default: 1024Range: 512 - 2048

Response Type

Returns: Image

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out