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.
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) 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
https://api.segmind.com/v1/kolorsParameters
promptrequiredstring"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."cfgoptionalnumberGuidance scale
6Range: 0 - 20heightoptionalintegerHeight of the image
1024Range: 512 - 2048negative_promptoptionalstringThings you do not want to see in your image
""number_of_imagesoptionalintegerNumber of images to generate
1Range: 1 - 10output_formatoptionalstringAn enumeration.
"webp""webp""jpg""png"output_qualityoptionalintegerQuality of the output images, from 0 to 100. 100 is best quality, 0 is lowest quality.
80Range: 0 - 100scheduleroptionalstringAn enumeration.
"EulerDiscreteScheduler""EulerDiscreteScheduler""EulerAncestralDiscreteScheduler""DPMSolverMultistepScheduler""DPMSolverMultistepScheduler_SDE_karras""UniPCMultistepScheduler""DEISMultistepScheduler"seedoptionalintegerSet a seed for reproducibility. Random by default.
441234134stepsoptionalintegerNumber of inference steps
25Range: 1 - 50widthoptionalintegerWidth of the image
1024Range: 512 - 2048Response Type
Returns: Image
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out