POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 const axios = require('axios'); const fs = require('fs'); const path = require('path'); async function toB64(imgPath) { const data = fs.readFileSync(path.resolve(imgPath)); return Buffer.from(data).toString('base64'); } const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/kling-squish"; const data = { "image": "toB64('https://segmind-resources.s3.amazonaws.com/input/bd5f5afb-5759-4bc2-a630-07cc98fe2dd2-squish-kling-ip.jpg')", "mode": "pro", "duration": 5 }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


imageimage *

Image


modeenum:str ( default: pro )

Mode of generation

Allowed values:


durationenum:str ( default: 5 )

Duration of the animation in seconds

Allowed values:

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Kling Squish Effect

The Kling squish effect, offered by Kling AI, provides a unique and straightforward method for transforming images and videos by compressing or distorting their subjects. This innovative feature caters to content creators, social media enthusiasts, and digital artists looking to add a touch of the whimsical or the exaggerated to their work. Its primary purpose is to enable the creation of playful and attention-grabbing visuals through distinctive squashing and flattening effect.

Key Features of Kling Squish Effect

  • Compression and Distortion: The core functionality of Kling-squish allows users to compress or distort elements within their images and videos, resulting in a visually striking squashed or flattened appearance. This enables the creation of unique and memorable visual effects.

  • Playful Visuals: This feature is specifically designed to generate playful and lighthearted content, making it perfect for social media posts, memes, and informal digital communication. By easily applying a squish effect, users can instantly inject humor into their visuals.

  • Exaggerated Effects: Kling-squish can be used to create exaggerated visuals, emphasizing certain features or actions in a comical or dramatic way. This is beneficial for storytelling and creating impactful imagery.

  • Dynamic Animations: When applied to video, the squish effect can generate dynamic animations that add movement and visual interest. This opens up possibilities for creating engaging and entertaining video content.