Actions12
- Image Actions
- Video Actions
- Virtual Try-on Actions
- Account Actions
Overview
This node integrates with the Kling AI API to perform virtual try-on operations, allowing users to digitally overlay clothing images onto human images. The "Create" operation under the "Virtual Try-on" resource sends a request to generate a virtual try-on image using specified models and input images.
Typical use cases include:
- Fashion e-commerce platforms wanting to provide customers with a way to visualize how clothes would look on them.
- Virtual fitting rooms in apps or websites.
- Marketing campaigns showcasing apparel on different models without physical photoshoots.
For example, a user can supply a photo of a person and an image of a garment, select a model version (e.g., Kolors Virtual Try-on V1), and receive a generated image showing the person wearing the garment.
Properties
Name | Meaning |
---|---|
API Token | JWT token for authenticating with the Kling AI API. Must be generated with specific header and payload as per Kling AI requirements. |
Model | The virtual try-on model to use. Options: "Kolors Virtual Try-on V1", "Kolors Virtual Try-on V1.5". |
Human Image | URL or Base64-encoded image of the person onto whom the clothing will be virtually tried on. |
Cloth Image | URL or Base64-encoded image of the clothing item to be overlaid on the human image. |
Callback URL | Optional URL that Kling AI will call when the virtual try-on process is complete, useful for asynchronous processing or notifications. |
Output
The node outputs JSON data containing the response from the Kling AI API for the virtual try-on creation request. This typically includes details about the generated virtual try-on task, such as task ID, status, and URLs to the resulting images once processing completes.
If a callback URL is provided, the actual completion notification and results may be delivered asynchronously via that endpoint.
No binary data output is indicated by the code for this operation.
Dependencies
- Requires access to the Kling AI API endpoint at
https://api.klingai.com
. - An API authentication token (JWT) must be provided as an input property.
- Network connectivity to the Kling AI service.
- Properly formatted JWT tokens according to Kling AI specifications (header with HS256 algorithm, payload including issuer, expiration, and not-before times).
Troubleshooting
- Authentication errors (401): Usually caused by invalid or improperly formatted JWT tokens. Ensure the token is generated correctly without the "Bearer" prefix and matches Kling AI's JWT format.
- Missing or invalid images: The human image and cloth image must be valid URLs or Base64 strings. Invalid inputs may cause API errors.
- API response errors: The node surfaces error messages returned by the Kling AI API. Review these messages for clues on issues like rate limits, invalid parameters, or server problems.
- Callback URL issues: If using a callback URL, ensure it is reachable and correctly handles incoming requests from Kling AI.
- Continue on Fail: If enabled, the node will return error details in the output JSON instead of stopping execution, which helps in workflows requiring fault tolerance.
Links and References
- Kling AI API Documentation (general reference): https://docs.klingai.com/ (assumed, please verify)
- JWT Token Generation Guidelines: Refer to standard JWT libraries and Kling AI-specific instructions for creating tokens with required claims.
- n8n Documentation on HTTP Request Node and Error Handling: https://docs.n8n.io/nodes/n8n-nodes-base.httpRequest/