๐ŸŽต Music & Audio Advanced โฑ 25 min ๐Ÿ–ฅ๏ธ Local hardware

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:

  1. Reads a prompt from Google Sheets
  2. Uses an AI agent to generate 5 unique music prompts
  3. Generates 5 lofi tracks via Kie.ai's Suno API
  4. Generates matching cover art images (locally with ComfyUI or via Kie.ai)
  5. Logs everything to a Google Sheet
  6. Passes the assets to a sub-workflow that creates the video
  7. 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

  1. In Kie.ai, go to API Market โ†’ Providers โ†’ Suno and click Run with API to see the required fields.
  2. Create an HTTP POST node in n8n pointing to the Kie.ai API URL.
  3. Set authentication to Generic Credential Type โ†’ Header Auth with your Kie.ai Bearer token.
  4. In the JSON body, include: prompt, style, title, instrumental: true, model, and a callbackUrl (required field โ€” use any placeholder URL if you're not using callbacks).
  5. The response returns a taskId. Add a Wait node (5 minutes), then poll with a GET request to the record info endpoint.
  6. Extract the audioUrl from 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/prompt with 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).
๐Ÿ’ก Tip to Try

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.

๐Ÿ“ฆ Downloads

๐ŸŽจ
CWO-Flux-Image-Workflow.json
Flux Image Workflow for ComfyUI
3KB โ†“ 0
๐Ÿ”’ Join free
๐ŸŽจ
CWO-Music-Generation.json
ComfyUI music Generation Workflow
41KB โ†“ 0
๐Ÿ”’ Join free
๐ŸŽจ
Suno-Version1.json
ComfyUI - Suno-Version 1 Sub-Workflow
29KB โ†“ 0
๐Ÿ”’ Join free
๐ŸŽจ
Suno-Version2.json
ComfyUI Suno-Version2 Sub-Workflow
29KB โ†“ 0
๐Ÿ”’ Join free

๐Ÿ’ฌ Q&A

No comments yet. Be the first to ask a question.
โ† Previous
First lesson in this category
● Automate LOFI Music Production with n8n + Suno + Kie.ai + Local Image Gen PHP 8.x UTF-8