Kling V3 Image 2 Image
Transform any image into photorealistic, production-ready visuals with Kling V3's Visual Chain-of-Thought reasoning.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/kling-3-image2image"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "Transform this Japanese garden into a magical winter wonderland. Snow covering the cherry blossom branches with delicate white blooms still visible beneath, frozen koi pond with crystalline ice patterns, stone lanterns dusted with snow, soft blue twilight lighting, aurora borealis faintly visible in the sky, mystical and ethereal atmosphere, photorealistic, 8K, cinematic",
12 "image_url": "https://segmind-resources.s3.amazonaws.com/input/kling3-i2i-input.webp",
13 "resolution": "1K",
14 "aspect_ratio": "16:9",
15 "output_format": "png"
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21 result = response.json()
22 print(json.dumps(result, indent=2))
23else:
24 print(f"Error: {response.status_code}")
25 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/kling-3-image2image"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "Transform this Japanese garden into a magical winter wonderland. Snow covering the cherry blossom branches with delicate white blooms still visible beneath, frozen koi pond with crystalline ice patterns, stone lanterns dusted with snow, soft blue twilight lighting, aurora borealis faintly visible in the sky, mystical and ethereal atmosphere, photorealistic, 8K, cinematic",
12 "image_url": "https://segmind-resources.s3.amazonaws.com/input/kling3-i2i-input.webp",
13 "resolution": "1K",
14 "aspect_ratio": "16:9",
15 "output_format": "png"
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21 result = response.json()
22 print(json.dumps(result, indent=2))
23else:
24 print(f"Error: {response.status_code}")
25 print(response.text)API Endpoint
https://api.segmind.com/v1/kling-3-image2imageParameters
image_urlrequiredstring (uri)The image to transform.
promptrequiredstringDescribe the desired transformation of the input image.
aspect_ratiooptionalstringFrame dimensions for the output image.
"16:9""16:9""9:16""1:1""4:3""3:4""3:2""2:3"elementsoptionalobject[]Character/object elements to include.
frontal_image_urloptionalstring (uri)Frontal view image of the character or object.
reference_image_urlsoptionalstring[]Up to 3 reference images for this element.
output_formatoptionalstringSelect output format.
"png""png""jpeg""webp"resolutionoptionalstringOutput resolution. 1K for standard, 2K for higher quality.
"1K""1K""2K"Response 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