Generate text-to-video and image-to-video clips with Kling 2.6 via KIE.AI
**This n8n template provides a comprehensive suite of Kling 2.6 video generation capabilities through the KIE.AI API. The workflow includes two independent video generation workflows: text-to-video and image-to-video. Each workflow can be used independently to create videos from different input types, making it perfect for content creators, marketers, and video production teams. ** Use cases are many: Create videos from text descriptions without any input media, transform static images into animated videos, generate engaging video content for social media, automate video production workflows, create video variations from the same source, produce marketing videos at scale, repurpose content across different video formats, or streamline video creation pipelines for content teams!
Good to know
- The workflow includes two independent Kling 2.6 video generation capabilities via KIE.AI API:
- Text-to-Video: Creates videos directly from text prompts without requiring input images or videos using
kling-2.6/text-to-videomodel - Image-to-Video: Transforms static images into animated videos based on text prompts using
kling-2.6/image-to-videomodel
- Text-to-Video: Creates videos directly from text prompts without requiring input images or videos using
- Each workflow can be used independently based on your input type and needs
- Supports customizable aspect ratios: 9:16 (vertical), 16:9 (landscape), 1:1 (square), 4:3 (classic)
- Supports customizable duration options (e.g., 5, 10, or 15 seconds)
- Sound control: Enable or disable sound in generated videos
- Text-to-video creates videos purely from text descriptions - no media input required
- Image-to-video animates static images with customizable prompts for style and movement
- KIE.AI pricing: Check current rates at https://kie.ai/ for video generation costs
- Processing time: Varies based on video length and KIE.AI queue, typically 1-5 minutes for generation
- Media requirements: Image files must be publicly accessible via URL (HTTPS recommended)
- Supported image formats: PNG, JPG, JPEG, WEBP
- Automatic polling system handles processing status checks and retries for all workflows
How it works
The template includes two independent workflows that can be used separately based on your input type:
1. Text-to-Video (Top Section):
- Video Parameters Setup: Set prompt, duration, aspect ratio (e.g., "9:16", "16:9"), and sound (true/false) in 'Set Text to Video Parameters' node
- Video Generation Submission: Parameters are submitted to KIE.AI API using
kling-2.6/text-to-videomodel - Processing Wait: Workflow waits 5 seconds, then polls the generation status
- Status Check: Checks if video generation is complete, queuing, generating, or failed
- Polling Loop: If still processing, workflow waits and checks again until completion
- Video URL Extraction: Once complete, extracts the generated video file URL from the API response
- Video Download: Downloads the generated video file for local use
2. Image-to-Video (Bottom Section):
- Video Parameters Setup: Set prompt, image URL, duration, and sound (true/false) in 'Set Prompt & Image Url' node
- Video Generation Submission: Parameters are submitted to KIE.AI API using
kling-2.6/image-to-videomodel - Processing Wait: Workflow waits 5 seconds, then polls the generation status
- Status Check: Checks if video generation is complete, queuing, generating, or failed
- Polling Loop: If still processing, workflow waits and checks again until completion
- Video URL Extraction: Once complete, extracts the generated video file URL from the API response
- Video Download: Downloads the generated video file for local use
All workflows automatically handle different processing states (queuing, generating, success, fail) and retry polling until video generation is complete. Each workflow operates independently, allowing you to use only the video generation type you need.
How to use
- Setup Credentials:
- Configure KIE.AI API key as HTTP Bearer Auth credential (used for both workflows)
- Choose Your Workflow:
- For Text-to-Video: Update 'Set Text to Video Parameters' node with prompt, duration (e.g., "5", "10", "15"), aspect ratio (e.g., "9:16", "16:9"), and sound (true/false)
- For Image-to-Video: Update 'Set Prompt & Image Url' node with prompt, image URL (publicly accessible), duration, and sound (true/false)
- Set Video Parameters:
- prompt: Detailed text description of the desired video content, style, and effects
- duration: Video duration in seconds as a string (e.g., "5", "10", "15")
- aspect_ratio: Video aspect ratio as a string (e.g., "9:16" for vertical, "16:9" for landscape, "1:1" for square, "4:3" for classic) - Text-to-Video only
- sound: Boolean value (true/false) to enable or disable sound in the generated video
- image_urls: Publicly accessible URL for image-to-video workflow (single URL string)
- Deploy Workflow: Import the template and activate the workflow
- Trigger Generation: Use manual trigger to test, or replace with webhook/other trigger
- Receive Video: Get generated video file URL and download the video file
Pro tip: Write detailed, descriptive prompts to guide the video generation - the more specific your prompt, the better the video output. Include scene details, camera movements, lighting, style, and visual effects in your prompt. For image-to-video, ensure your input image is hosted on a public URL (HTTPS recommended). Choose the aspect ratio that matches your target platform - 9:16 for mobile/social media, 16:9 for standard video, 1:1 for square posts. The workflows automatically handle polling, status checks, and video download, so you can set it and forget it. You can use different workflows for different use cases - text-to-video for pure creation, image-to-video for animating static content.
Requirements
- KIE.AI API account for accessing Kling 2.6 video generation models (
kling-2.6/text-to-videoandkling-2.6/image-to-video) - Text Prompt describing the desired video content (required for all workflows)
- Image File URL (for image-to-video) that is publicly accessible (HTTPS recommended)
- Duration value: String format (e.g., "5", "10", "15" seconds)
- Aspect Ratio value: String format (e.g., "9:16", "16:9", "1:1", "4:3") - Text-to-Video only
- Sound value: Boolean (true/false) to enable or disable sound
- n8n instance (cloud or self-hosted)
- Supported image formats: PNG, JPG, JPEG, WEBP
Customizing this workflow
Workflow Selection: Use only the workflows you need by removing or disabling nodes for text-to-video or image-to-video. Each workflow operates independently.
Trigger Options: Replace the manual trigger with webhook trigger for API-based video generation requests, schedule trigger for batch processing, or form trigger for user submissions.
Video Settings: Modify duration (as string, e.g., "5", "10", "15"), aspect ratio (e.g., "9:16", "16:9", "1:1", "4:3" for text-to-video), and sound (true/false) in the respective 'Set' nodes to match your content needs.
Prompt Engineering: Enhance prompts in the 'Set' nodes with detailed scene descriptions, visual effects, camera movements, style effects, and artistic directions for better video quality. The more descriptive your prompt, the better the output.
Aspect Ratio Selection: Choose aspect ratios based on your target platform - 9:16 for mobile/social media (Instagram Stories, TikTok), 16:9 for standard video (YouTube), 1:1 for square posts (Instagram), or 4:3 for classic format.
Batch Processing: Add loops to process multiple prompts or images from a list or spreadsheet automatically, generating videos in batch.
Storage Integration: Add nodes to save generated videos to Google Drive, Dropbox, S3, or other storage services before or after download.
Post-Processing: Add nodes between video generation and download to add captions, apply filters, add watermarks, or integrate with video editing tools.
Error Handling: Add notification nodes (Email, Slack, Telegram) to alert when video generation completes, fails, or encounters errors.
Content Management: Add nodes to log video generation results, track processing status, or store outputs in databases or spreadsheets.
Video Variations: Create multiple video variations with different prompts and settings for A/B testing or content variations.
Social Media Integration: Add nodes after video download to automatically upload videos to YouTube, Instagram, TikTok, or other platforms.
Quality Control: Add conditional logic to check video quality, file size, or other characteristics before proceeding with download or distribution.
Generate Text-to-Video and Image-to-Video Clips with KieAI
This n8n workflow demonstrates how to interact with the KieAI API to generate video clips from either text prompts or image inputs. It provides a flexible structure to handle different video generation requests and retrieve their results.
What it does
This workflow automates the process of creating video clips using the KieAI service, specifically targeting functionalities related to "Kling 2.6" for text-to-video and image-to-video generation.
- Manual Trigger: The workflow is initiated manually, allowing you to control when to generate videos.
- Edit Fields (Set): Defines a placeholder for input data, which would typically contain the text prompt for text-to-video or an image URL for image-to-video.
- Switch Node: This node acts as a router, allowing the workflow to branch based on a condition (e.g., whether the input is text or an image).
- HTTP Request (KieAI API Call):
- Text-to-Video: If the input is a text prompt, this node would send a request to the KieAI API to generate a video based on the provided text.
- Image-to-Video: If the input is an image URL, this node would send a request to the KieAI API to generate a video from the image.
- Wait: After initiating a video generation request, this node introduces a delay to allow the KieAI service to process the request and generate the video.
- HTTP Request (Check Status/Retrieve Result): After the wait period, this node would send another request to the KieAI API to check the status of the video generation and retrieve the final video clip or its URL.
- Code Node: This node provides a flexible way to process the results from the KieAI API, such as parsing the video URL, handling errors, or preparing the data for subsequent actions.
Prerequisites/Requirements
- n8n Instance: A running instance of n8n.
- KieAI Account/API Key: Access to the KieAI service and an associated API key for authentication.
- Understanding of KieAI API: Familiarity with the KieAI API endpoints for text-to-video and image-to-video generation, and how to check the status of a job.
Setup/Usage
- Import the Workflow: Import the provided JSON into your n8n instance.
- Configure KieAI Credentials:
- Locate the "HTTP Request" nodes.
- Configure the authentication method (e.g., API Key in the header) using your KieAI API key.
- Define Input in "Edit Fields":
- Modify the "Edit Fields" node to include the necessary input for video generation. This could be:
- A text prompt (e.g.,
{"prompt": "A futuristic city at sunset"}) for text-to-video. - An image URL (e.g.,
{"imageUrl": "https://example.com/my-image.jpg"}) for image-to-video.
- A text prompt (e.g.,
- You might need to add logic in the "Edit Fields" or a preceding node to dynamically determine if the input is text or an image.
- Modify the "Edit Fields" node to include the necessary input for video generation. This could be:
- Configure Switch Node:
- Adjust the "Switch" node's conditions to correctly route the workflow based on your input type (e.g., checking for the presence of a
promptorimageUrlfield).
- Adjust the "Switch" node's conditions to correctly route the workflow based on your input type (e.g., checking for the presence of a
- Configure HTTP Request Nodes:
- Initial Request: Update the URL and body of the first "HTTP Request" node (after the Switch) to match the KieAI API endpoint for initiating text-to-video or image-to-video generation.
- Status Check/Retrieve: Update the URL of the second "HTTP Request" node (after the Wait) to poll the KieAI API for the status of the video generation job and retrieve the final video. This typically involves using a job ID returned by the initial request.
- Adjust Wait Time: Modify the "Wait" node's duration based on the expected processing time for video generation by KieAI.
- Process Results in Code Node: Customize the "Code" node to extract and handle the video URL or any other relevant information returned by the KieAI API.
- Execute Workflow: Click "Execute Workflow" to run the workflow and generate your video clips.
Related Templates
Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax
Spark your creativity instantly in any chat—turn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. 📋 What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing 🔧 Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation 🔑 Required Credentials OpenAI API Setup Go to platform.openai.com → API keys (sidebar) Click "Create new secret key" → Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai → Dashboard → API Keys Generate a new API key → Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) ⚙️ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflow—chat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" 🎯 Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration ⚠️ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions
AI-powered code review with linting, red-marked corrections in Google Sheets & Slack
Advanced Code Review Automation (AI + Lint + Slack) Who’s it for For software engineers, QA teams, and tech leads who want to automate intelligent code reviews with both AI-driven suggestions and rule-based linting — all managed in Google Sheets with instant Slack summaries. How it works This workflow performs a two-layer review system: Lint Check: Runs a lightweight static analysis to find common issues (e.g., use of var, console.log, unbalanced braces). AI Review: Sends valid code to Gemini AI, which provides human-like review feedback with severity classification (Critical, Major, Minor) and visual highlights (red/orange tags). Formatter: Combines lint and AI results, calculating an overall score (0–10). Aggregator: Summarizes results for quick comparison. Google Sheets Writer: Appends results to your review log. Slack Notification: Posts a concise summary (e.g., number of issues and average score) to your team’s channel. How to set up Connect Google Sheets and Slack credentials in n8n. Replace placeholders (<YOURSPREADSHEETID>, <YOURSHEETGIDORNAME>, <YOURSLACKCHANNEL_ID>). Adjust the AI review prompt or lint rules as needed. Activate the workflow — reviews will start automatically whenever new code is added to the sheet. Requirements Google Sheets and Slack integrations enabled A configured AI node (Gemini, OpenAI, or compatible) Proper permissions to write to your target Google Sheet How to customize Add more linting rules (naming conventions, spacing, forbidden APIs) Extend the AI prompt for project-specific guidelines Customize the Slack message formatting Export analytics to a dashboard (e.g., Notion or Data Studio) Why it’s valuable This workflow brings realistic, team-oriented AI-assisted code review to n8n — combining the speed of automated linting with the nuance of human-style feedback. It saves time, improves code quality, and keeps your team’s review history transparent and centralized.
Auto-reply & create Linear tickets from Gmail with GPT-5, gotoHuman & human review
This workflow automatically classifies every new email from your linked mailbox, drafts a personalized reply, and creates Linear tickets for bugs or feature requests. It uses a human-in-the-loop with gotoHuman and continuously improves itself by learning from approved examples. How it works The workflow triggers on every new email from your linked mailbox. Self-learning Email Classifier: an AI model categorizes the email into defined categories (e.g., Bug Report, Feature Request, Sales Opportunity, etc.). It fetches previously approved classification examples from gotoHuman to refine decisions. Self-learning Email Writer: the AI drafts a reply to the email. It learns over time by using previously approved replies from gotoHuman, with per-classification context to tailor tone and style (e.g., different style for sales vs. bug reports). Human Review in gotoHuman: review the classification and the drafted reply. Drafts can be edited or retried. Approved values are used to train the self-learning agents. Send approved Reply: the approved response is sent as a reply to the email thread. Create ticket: if the classification is Bug or Feature Request, a ticket is created by another AI agent in Linear. Human Review in gotoHuman: How to set up Most importantly, install the gotoHuman node before importing this template! (Just add the node to a blank canvas before importing) Set up credentials for gotoHuman, OpenAI, your email provider (e.g. Gmail), and Linear. In gotoHuman, select and create the pre-built review template "Support email agent" or import the ID: 6fzuCJlFYJtlu9mGYcVT. Select this template in the gotoHuman node. In the "gotoHuman: Fetch approved examples" http nodes you need to add your formId. It is the ID of the review template that you just created/imported in gotoHuman. Requirements gotoHuman (human supervision, memory for self-learning) OpenAI (classification, drafting) Gmail or your preferred email provider (for email trigger+replies) Linear (ticketing) How to customize Expand or refine the categories used by the classifier. Update the prompt to reflect your own taxonomy. Filter fetched training data from gotoHuman by reviewer so the writer adapts to their personalized tone and preferences. Add more context to the AI email writer (calendar events, FAQs, product docs) to improve reply quality.