Automate LOFI Music Production with n8n + Suno + Kie.ai + Local Image Gen
The full automation stack for producing and publishing lofi music โ from AI generation to finished track, no manual steps.
Lesson Notes
The Opportunity
Lofi music channels on YouTube routinely earn $1,000โ$86,000 per month from ad revenue alone. The videos are simple: a looping or slowly animated image with a continuous music track. What takes a human hours to produce manually can be built as a fully automated pipeline that runs while you sleep.
This lesson walks through the complete stack: AI prompt โ music generation via Suno โ image generation via ComfyUI or Kie.ai โ video render โ social media post.
What You'll Build
An n8n workflow that:
- Reads a prompt from Google Sheets
- Uses an AI agent to generate 5 unique music prompts
- Generates 5 lofi tracks via Kie.ai's Suno API
- Generates matching cover art images (locally with ComfyUI or via Kie.ai)
- Logs everything to a Google Sheet
- Passes the assets to a sub-workflow that creates the video
- Posts to social media via Blotato
What You Need
- n8n running in Docker
- Kie.ai account with API credits (covers Suno + image generation)
- OpenAI API key (for the AI agent that writes music prompts)
- MinIO for local file storage (or use Kie.ai's hosted URLs directly)
- ComfyUI (optional โ for local image generation)
- NCA Toolkit for video rendering
- Blotato for social media posting
The AI Agent Step
Rather than hardcoding music prompts, use an n8n AI Agent node with GPT-4.1 Mini as the brain. Give it a system message describing the lofi aesthetic you want (calm, nostalgic, late-night study vibes) and ask it to produce 5 distinct Suno-ready prompts. Set Require Specific Output Format and attach a structured output parser expecting an array of 5 prompt strings.
This means every workflow run produces 5 different tracks automatically, each with its own unique feel.
Generating Music via Kie.ai / Suno API
- In Kie.ai, go to API Market โ Providers โ Suno and click Run with API to see the required fields.
- Create an HTTP POST node in n8n pointing to the Kie.ai API URL.
- Set authentication to Generic Credential Type โ Header Auth with your Kie.ai Bearer token.
- In the JSON body, include:
prompt,style,title,instrumental: true,model, and acallbackUrl(required field โ use any placeholder URL if you're not using callbacks). - The response returns a
taskId. Add a Wait node (5 minutes), then poll with a GET request to the record info endpoint. - Extract the
audioUrlfrom the response, download the MP3, upload it to MinIO.
Generating Cover Images
You have two options:
- Local (ComfyUI) โ POST to
http://host.docker.internal:8188/promptwith your exported workflow JSON. Good if you have GPU resources and want free generation. - Cloud (Kie.ai) โ POST to the Z-Image or Flux API endpoints. ~4โ10 cents per image. Good if you don't have local GPU.
Generate one image per music track using the same prompt used for the music โ this keeps the visual and audio themes aligned.
The Sub-Workflow Pattern
Once you have 5 sets of (music + image), use n8n's Split In Batches node to process each pair individually. For each pair, call a sub-workflow via the Execute Workflow node (source: Database, with Wait for Sub-Workflow to Complete checked). The sub-workflow handles video rendering, captioning, and posting so your main workflow stays clean.
Logging to Google Sheets
After each successful track, append a row to your Google Sheet: title, prompt used, audio URL, image URL, and generation date. This becomes your content library โ you can see what's been created, what's been posted, and reuse prompts that performed well.
What Makes Lofi Work at Scale
- Consistency โ Same visual style, same audio aesthetic, posted daily. Algorithms reward it.
- Variety โ The AI agent ensures each track is unique even with a consistent theme.
- Zero marginal effort โ Once the workflow is running, each new piece of content costs you seconds to trigger (or nothing if you use a schedule).
Start Suno generation with <code>instrumental: true</code> in your API call so there are no lyrics over your lofi visuals. Then set the wait node to 5 minutes โ Suno typically finishes in 2โ3 minutes but giving it extra time prevents polling an unfinished task.
Tools mentioned in this lesson: