توسيع صورة باستخدام Kling
استخدم واجهة Kling Image Expansion API عبر CometAPI لتوسيع الصور خارج حدودها الأصلية مع outpainting قابل للتحكم.
كيفية عمل نسب التوسيع
- تُقاس كل نسبة مقارنةً بالعرض أو الارتفاع الأصلي
- يجب أن تظل مساحة اللوحة الموسعة المجمعة ضمن حدود المساحة الموثقة في Kling
- ابدأ بقيم صغيرة مثل
0.1لكل جانب قبل محاولة عمليات توسيع أكبر
تدفق الطلب
- أرسل حقول النِّسب الأربعة كلها، مع استخدام
0لأي جانب لا تريد توسيعه - احفظ
task_idالمُعاد - نفّذ polling لمسار استعلام صور Kling المطابق حتى تصل المهمة إلى حالة نهائية
التفويضات
Bearer token authentication. Use your CometAPI key.
الترويسات
Must be application/json.
الجسم
Source image to expand. Image URL or raw Base64 string without a data: prefix. Supported formats: JPG, JPEG, PNG. Maximum 10 MB, minimum 300x300 px, aspect ratio between 1:2.5 and 2.5:1.
Upward expansion ratio as a multiple of the original image dimension. Range: 0-2. Send 0 for sides you do not want to expand.
0 <= x <= 2Downward expansion ratio as a multiple of the original image dimension. Range: 0-2. Send 0 for sides you do not want to expand.
0 <= x <= 2Leftward expansion ratio as a multiple of the original image dimension. Range: 0-2. Send 0 for sides you do not want to expand.
0 <= x <= 2Rightward expansion ratio as a multiple of the original image dimension. Range: 0-2. Send 0 for sides you do not want to expand.
0 <= x <= 2Optional text prompt to guide the expanded area content. Maximum 2500 characters.
Number of expanded images to generate. Range: 1-9.
1 <= x <= 9Watermark options.
Webhook URL for task status notifications.
Optional user-defined task ID for your own tracking. Must be unique per account.