Generate AI images & videos with KIE.AI Midjourney API
Generate AI Images & Videos with KIE.AI Midjourney API
Overview
Generate high-quality AI images and videos using KIE.AI's Midjourney API through an intuitive form interface. This n8n workflow supports three distinct content creation modes, delivering professional results with automated processing and real-time progress monitoring. Supported Modes:
- Text-to-Image (
mj_txt2img): Generate original images from written descriptions - Image-to-Image (
mj_img2img): Transform or enhance existing images with AI - Image-to-Video (
mj_video): Animate still images into short video clips Users interact only through a simple form interface, requiring no coding skills. After submitting a request, the system automatically calls the KIE.AI API, monitors progress in real-time, and retrieves the final output once ready.
Perfect for
Content creators, designers, marketers, and developers who need to quickly generate diverse AI visual content with automated processing and professional quality results.
Prerequisites
- KIE.AI Account: Sign up at KIE.AI to obtain your free or paid API key.
- n8n Instance: Active n8n instance (cloud or self-hosted) with HTTP Request and form submission capabilities.
- AI Prompt Knowledge: Basic understanding of AI prompts for optimal generation results.
- Reference Images (Optional): Publicly accessible image URLs for image-to-image or image-to-video generation.
Quick Setup
1. Get API Key
Register at KIE.AI and generate your API key. Store it securely and never share it publicly.
2. Configure Form Fields
Set up these fields in your "On Form Submission" node:
tasktype(Required): Select generation modemj_txt2imgfor text-to-image generationmj_img2imgfor image-to-image generationmj_videofor image-to-video generation
prompt(Required): Text description for your content generationimgurl(Optional): Image URL array for image-to-image or image-to-video generation- Important: Leave empty for text-to-image generation (
mj_txt2img)
- Important: Leave empty for text-to-image generation (
api_key(Required): Your KIE.AI API key for authentication
3. Test & Use
- Click "Execute Workflow" in n8n.
- Access the generated form URL.
- Fill in your details and submit.
- Wait for processing (workflow polls every 10 seconds).
- Results will be displayed automatically.
Customization Tips
Write Detailed Prompts:
Include specific details for better results:
- Style: realistic, anime, cinematic, watercolor, oil painting
- Composition: close-up, wide shot, portrait, landscape
- Lighting: dramatic, soft, neon, natural, studio
- Subject Details: actions, scenes, movements, visual elements
Example Enhanced Prompt:
"Cinematic portrait of a cyberpunk character with neon blue lighting, close-up composition, dramatic shadows, futuristic mood"
Leverage Multiple Modes:
- Start with text-to-image for initial concepts.
- Use image-to-image to refine and enhance results.
- Apply image-to-video to animate your best images.
- Combine modes for complex creative workflows.
Common Use Cases:
- Social media content creation.
- Marketing material development.
- Product visualization.
- Storyboarding and prototyping.
- Creative asset generation.
Troubleshooting
- API Key Invalid: Verify your key is correct and active.
- Generation Fails: Check prompt length and content appropriateness.
- Slow Processing: Video generation can take 2-5 minutes; this is normal.
- Image URL Issues: Ensure URLs are publicly accessible and properly formatted. Keywords: KIE.AI API, AI image generation, AI video generation, text-to-image, image-to-video, automated workflows, n8n template, AI content creation
n8n Form Trigger to AI Image/Video Generation Workflow
This n8n workflow demonstrates how to trigger an AI image or video generation process based on a form submission. It uses an n8n Form Trigger to capture user input, processes it, and then makes an HTTP request to an external API (likely KieAI/Midjourney API, based on the directory name) to initiate the AI generation.
What it does
This workflow simplifies the process of generating AI-powered images or videos by:
- Listening for Form Submissions: It starts by waiting for a user to submit data through an n8n-hosted form.
- Preparing Data: It takes the submitted form data and transforms it into the required format for the external AI generation API.
- Conditional Processing: It includes an "If" node, suggesting a conditional logic path. This could be used to differentiate between image and video requests, validate input, or handle different types of AI models.
- Initiating AI Generation: It makes an HTTP POST request to an external API, passing the prepared data to trigger the AI image or video generation.
- Waiting for Completion (Implied): A "Wait" node is included, which likely pauses the workflow to allow the AI generation process to complete on the external service before any subsequent steps (though no subsequent steps are defined in this basic workflow).
Prerequisites/Requirements
- n8n Instance: A running n8n instance to host and execute the workflow.
- External AI Generation API: Access to an AI image/video generation API (e.g., KieAI, Midjourney, or a similar service). This will require an API key or other authentication details, which would be configured in the "HTTP Request" node's credentials.
Setup/Usage
- Import the Workflow:
- Copy the provided JSON code.
- In your n8n instance, go to "Workflows" and click "New".
- Click the "Import from JSON" button and paste the copied JSON.
- Configure the Form Trigger:
- Open the "On form submission" node.
- The form will automatically generate a public URL. You can share this URL for users to submit data.
- Customize the form fields as needed to capture the necessary input for your AI generation (e.g., "prompt", "style", "output_type" - image/video, etc.).
- Configure the "Edit Fields (Set)" Node:
- Adjust this node to map the incoming form data to the specific payload structure required by your AI generation API.
- Configure the "If" Node:
- Set up the conditions in this node based on your requirements. For example, you might check a field from the form to determine if the user wants an "image" or a "video".
- Configure the "HTTP Request" Node:
- Method: Set to
POST. - URL: Enter the endpoint URL for your AI generation API.
- Headers: Add any required headers, such as
Content-Type: application/jsonand your API key (e.g.,Authorization: Bearer YOUR_API_KEY). Use n8n credentials for secure storage of API keys. - Body: Configure the JSON body to send the processed data from the "Edit Fields (Set)" node to the AI API.
- Method: Set to
- Configure the "Wait" Node:
- Adjust the wait duration as appropriate for how long your AI generation typically takes.
- Activate the Workflow:
- Save the workflow and toggle it to "Active" in the top right corner of the n8n editor.
Now, whenever the n8n form is submitted, this workflow will execute, process the input, and send a request to your AI generation API.
Related Templates
AI multi-agent executive team for entrepreneurs with Gemini, Perplexity and WhatsApp
This workflow is an AI-powered multi-agent system built for startup founders and small business owners who want to automate decision-making, accountability, research, and communication, all through WhatsApp. The βvirtual executive team,β is designed to help small teams to work smarter. This workflow sends you market analysis, market and sales tips, It can also monitor what your competitors are doing using perplexity (Research agent) and help you stay a head, or make better decisions. And when you feeling stuck with your start-up accountability director is creative enough to break the barrier π― Core Features π§βπΌ 1. President (Super Agent) Acts as the main controller that coordinates all sub-agents. Routes messages, assigns tasks, and ensures workflow synchronization between the AI Directors. π 2. Sales & Marketing Director Uses SerpAPI to search for market opportunities, leads, and trends. Suggests marketing campaigns, keywords, or outreach ideas. Can analyze current engagement metrics to adjust content strategy. π΅οΈββοΈ 3. Business Research Director Powered by Perplexity AI for competitive and market analysis. Monitors competitor moves, social media engagement, and product changes. Provides concise insights to help the founder adapt and stay ahead. β° 4. Accountability Director Keeps the founder and executive team on track. Sends motivational nudges, task reminders, and progress reports. Promotes consistency and discipline β key traits for early-stage success. ποΈ 5. Executive Secretary Handles scheduling, email drafting, and reminders. Connects with Google Calendar, Gmail, and Sheets through OAuth. Automates follow-ups, meeting summaries, and notifications directly via WhatsApp. π¬ WhatsApp as the Main Interface Interact naturally with your AI team through WhatsApp Business API. All responses, updates, and summaries are delivered to your chat. Ideal for founders who want to manage operations on the go. βοΈ How It Works Trigger: The workflow starts from a WhatsApp Trigger node (via Meta Developer Account). Routing: The President agent analyzes the incoming message and determines which Director should handle it. Processing: Marketing or sales queries go to the Sales & Marketing Director. Research questions are handled by the Business Research Director. Accountability tasks are assigned to the Accountability Director. Scheduling or communication requests are managed by the Secretary. Collaboration: Each sub-agent returns results to the President, who summarizes and sends the reply back via WhatsApp. Memory: Context is maintained between sessions, ensuring personalized and coherent communication. π§© Integrations Required Gemini API β for general intelligence and task reasoning Supabase- for RAG and postgres persistent memory Perplexity API β for business and competitor analysis SerpAPI β for market research and opportunity scouting Google OAuth β to connect Sheets, Calendar, and Gmail WhatsApp Business API β for message triggers and responses π Benefits Acts like a team of tireless employees available 24/7. Saves time by automating research, reminders, and communication. Enhances accountability and strategy consistency for founders. Keeps operations centralized in a simple WhatsApp interface. π§° Setup Steps Create API credentials for: WhatsApp (via Meta Developer Account) Gemini, Perplexity, and SerpAPI Google OAuth (Sheets, Calendar, Gmail) Create a supabase account at supabase Add the credentials in the corresponding n8n nodes. Customize the system prompts for each Director based on your startupβs needs. Activate and start interacting with your virtual executive team on WhatsApp. Use Case You are a small organisation or start-up that can not afford hiring; marketing department, research department and secretar office, then this workflow is for you π‘ Need Customization? Want to tailor it for your startup or integrate with CRM tools like Notion or HubSpot? You can easily extend the workflow or contact the creator for personalized support. Consider adjusting the system prompt to suite your business
Automated YouTube video uploads with 12h interval scheduling in JST
This workflow automates a batch upload of multiple videos to YouTube, spacing each upload 12 hours apart in Japan Standard Time (UTC+9) and automatically adding them to a playlist. βοΈ Workflow Logic Manual Trigger β Starts the workflow manually. List Video Files β Uses a shell command to find all .mp4 files under the specified directory (/opt/downloads/εθ―ε‘/A1-A2). Sort and Generate Items β Sorts videos by day number (dayXX) extracted from filenames and assigns a sequential order value. Calculate Publish Schedule (+12h Interval) β Computes the next rounded JST hour plus a configurable buffer (default 30 min). Staggers each videoβs scheduled time by order Γ 12 hours. Converts JST back to UTC for YouTubeβs publishAt field. Split in Batches (1 per video) β Iterates over each video item. Read Video File β Loads the corresponding video from disk. Upload to YouTube (Scheduled) β Uploads the video privately with the computed publishAtUtc. Add to Playlist β Adds the newly uploaded video to the target playlist. π Highlights Timezone-safe: Pure UTC β JST conversion avoids double-offset errors. Sequential scheduling: Ensures each upload is 12 hours apart to prevent clustering. Customizable: Change SPANHOURS, BUFFERMIN, or directory paths easily. Retry-ready: Each upload and playlist step has retry logic to handle transient errors. π‘ Typical Use Cases Multi-part educational video series (e.g., A1βA2 English learning). Regular content release cadence without manual scheduling. Automated YouTube publishing pipelines for pre-produced content. --- Author: Zane Category: Automation / YouTube / Scheduler Timezone: JST (UTC+09:00)
Monitor bank transactions with multi-channel alerts for accounting teams
Enhance financial oversight with this automated n8n workflow. Triggered every 5 minutes, it fetches real-time bank transactions via an API, enriches and transforms the data, and applies smart logic to detect critical, high, and medium priority alerts based on error conditions, amounts, or risk scores. It sends multi-channel notifications via email and Slack, logs all data to Google Sheets, and generates summary statistics for comprehensive tracking. π°π¨ Key Features Real-time monitoring every 5 minutes for instant alerts. Smart prioritization (Critical, High, Medium) based on risk and errors. Multi-channel notifications via email and Slack. Detailed logging and summary reports in Google Sheets. How It Works Schedule Trigger: Runs every 5 minutes. Fetch Transactions: HTTP request retrieves real-time transaction data. API Error?: If condition for error logic is met, sends error alert. Enrich & Transform Data: Advanced risk calculation enhances data. Critical Alert?: If condition (50% or risk > 8) is met, raises alert. High Priority?: If condition (5% or risk > 7) is met, raises alert. Medium Priority?: If condition is met, raises alert. Log Priority to Sheet: Google Sheets appends critical, high, or medium priority data. Send Critical Email: HTML email to execute sheets append. Send High Priority Email: Email to finance team. Send High Priority Slack: Slack notification to finance team. Send Medium Priority Email: Email to finance team. Merge All Alerts: Combines all alerts for comprehensive tracking. Generate Summary Stats: Code block for analytics. Log Summary to Sheet: Summary statistics storage. Setup Instructions Import the workflow into n8n and configure the bank API credentials in "Fetch Transactions." Set up Google Sheets OAuth2 and replace the sheet ID for logging nodes. Configure Gmail API Key and Slack Bot Token for alerts. Test the workflow with sample transaction data exceeding risk or amount thresholds. Adjust priority conditions (e.g., 50%, 5%, risk > 8) based on your risk policy. Prerequisites Bank API access with real-time transaction data (e.g., https://api.bank.com) Google Sheets OAuth2 credentials Gmail API Key for email alerts Slack Bot Token (with chat:write permissions) Structured transaction data format Google Sheet Structure: Create a sheet with columns: Transaction ID Amount Date Risk Score Priority (Critical/High/Medium) Alert Sent Summary Stats Updated At Modification Options Adjust the "Schedule Trigger" interval (e.g., every 10 minutes). Modify "Critical Alert?" and "High Priority?" conditions for custom thresholds. Customize email and Slack templates with branded messaging. Integrate with fraud detection tools for enhanced risk analysis. Enhance "Generate Summary Stats" with additional metrics (e.g., average risk). Discover more workflows β Get in touch with us