Bir Kling Omni image görevi oluşturma
Prompt ve referans görsel girdileriyle Kling Omni Image görevleri oluşturmak için CometAPI POST /kling/v1/images/omni-image uç noktasını kullanın.
task_id döndürür; üretilen görsel URL’leri kullanılabilir olana kadar görevi sorgulamak için Bir Kling Omni image görevini alın sayfasını kullanın.
İstek şeklini seçin
- Tek görsel üretimi:
prompt,image_list,resolution,result_type: single,nveaspect_ratiogönderin - Filigranlı çıktı: sorgu yanıtında filigranlı bir sonuç URL’sine ihtiyacınız olduğunda
watermark_info.enabled: trueekleyin - Model ID: rota varsayılanını kullanmak için
model_namealanını atlayın veyakling-image-o1ya dakling-v3-omnigibi test edilmiş bir Omni Image model ID gönderin
image_list içindeki image alanına sahip öğeler kullanır. Prompt, bunlara dizine göre atıfta bulunabilir; örneğin ilk öğe için <<<image_1>>>, ikinci öğe için <<<image_2>>> gibi.
Görev akışı
Görevi oluşturun
POST /kling/v1/images/omni-image isteğini gönderin ve dönen data.task_id değerini saklayın.Görevi sorgulayın
data.task_status değeri succeed veya failed olana kadar GET /kling/v1/images/omni-image/ uç noktasını sorgulayın.Görselleri kalıcı olarak saklayın
data.task_result.images[].url değerlerini kendi depolamanıza kopyalayın.Sonuç alanları
Başarılı sorgu yanıtları, üretilen görselleridata.task_result.images altında döndürür. Her öğe şunları içerebilir:
Yetkilendirmeler
Bearer token authentication. Use your CometAPI API key.
Başlıklar
Must be application/json.
Gövde
Text prompt for the generated image. The prompt can reference images with <<<image_1>>>, <<<image_2>>>, and matching indexes from image_list. Maximum length is 2,500 characters.
Optional model ID for this Omni Image request. Omit this field to use the route default.
Reference images that the prompt can cite with <<<image_1>>>, <<<image_2>>>, and so on. Keep the total number of reference images within the provider limits for the selected model.
Requested output resolution. Use 1k, 2k, or 4k; omitted requests use 1k.
1k, 2k, 4k Use single for a single-image task.
single Number of single-image results to generate. Range: 1 to 9.
1 <= x <= 9Requested output aspect ratio in width:height format. Use auto to let the provider choose from the prompt and references.
16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9, auto Watermark options. When enabled is true, the task can return watermarked result URLs in addition to the original result URLs.
Webhook URL that receives task status notifications when the task status changes. Omit this field to poll manually.
User-defined task ID for your own tracking. It does not replace the system-generated task_id and must be unique per account.