← All models
Kling: Kling Image 4.0
kuaishou/kling-image-4.0Kling Image 4.0 is an image generation and editing model from Kuaishou, built on a unified autoregressive architecture for image understanding and generation. It produces native 8K images without a separate upscaling step, accepts prompts of up to 2,000 characters and up to 10 reference images, and keeps characters, visual style and layout consistent across sets. It improves instruction following and the rendering of text, small objects and spatial relationships in complex scenes.
Modalities
Price
Released
Nov 18, 2026
Parameters
promptrequiredaspect_ratio1:12:33:23:44:39:1616:921:9autoresolutionsize1772x23642364x17723128x13401536x27302730x15361672x25082508x16722048x20483546x47284728x35466256x26803072x54605460x30723344x50165016x33444096x409612512x53626688x1003210032x66887094x94589458x70946144x1092210922x61448192x8192imageimage-to-image (via /v1/images/edits)How to use via API
import base64
from openai import OpenAI
client = OpenAI(base_url="https://api.mixen.ai/v1", api_key="mxn-...")
img = client.images.generate(
model="kuaishou/kling-image-4.0",
prompt="Милый кот-космонавт на Марсе",
size="1772x2364", # либо extra_body={"aspect_ratio": "1:1", "resolution": "2k"}
n=1,
)
with open("image.png", "wb") as f:
f.write(base64.b64decode(img.data[0].b64_json))
# image-to-image: передать референс(ы) через multipart
edited = client.images.edit(
model="kuaishou/kling-image-4.0",
image=open("photo.png", "rb"), # один или несколько референсов
prompt="Добавь неоновую вывеску на фасад, сохрани композицию",
)
with open("edited.png", "wb") as f:
f.write(base64.b64decode(edited.data[0].b64_json))
