# Generate AI media with ComfyUI: Images: n8n workflow template

> Started by an event in a connected app, and works across Discord. 34 steps, 2 branches, 3 loops or waits: large, and worth reading before you trust it with...

Source: https://millionrounds.com/workflow/generate-ai-media-with-comfyui-images (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Content](https://millionrounds.com/workflows?category=Content#library)

# Generate AI media with ComfyUI: Images

Started by an event in a connected app, and works across Discord. 34 steps, 2 branches, 3 loops or waits: large, and worth reading before you trust it with anything live.

Large

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fgenerate-ai-media-with-comfyui-images)

**34 steps** Large: read it before trusting it with anything live

**2** Branches: places the flow splits

**3** Loops or waits

**1** Service it connects to

## The flow

Starts it 2 Logic 20 Service 12

The steps in the order they run, from what starts it.

- 1 **When Executed by Another Workflow** Execute Workflow trigger *Starts it*
- 2 **Aggregate** Aggregate *Logic*
- 3 **When clicking ‘Test workflow’** Manual trigger *Starts it*
- 4 **Connection Config** Set *Logic*
- 5 **Discord Alert** Discord *Service*
- 6 **Client ID** Crypto *Service*
- 7 **Trigger LOCAL Workflow** Http Request *Service*
- 8 **Connection Config Duplicate** Set *Logic*
- 9 **HTTP Request** Http Request *Service*
- 10 **Fail Trigger** Code *Logic*
- 11 **Wait For Test Type Select** Wait *Logic*
- 12 **If** If *Logic*
- 13 **Fail Get History** Code *Logic*
- 14 **Merge** Merge *Logic*
- 15 **If Img2Img** If *Logic*
- 16 **Get Generated Image** Http Request *Service*
- 17 **Wait** Wait *Logic*
- 18 **Edit Fields** Set *Logic*
- 19 **Wait1** Wait *Logic*
- 20 **Read API Exported Txt2Img ComfyUI Workflow from Disk** Read Write File *Service*
- 21 **Return The Output JSON Instead** Set *Logic*
- 22 **Convert to File** Convert To File *Service*
- 23 **Upload Attachments LOCAL** Http Request *Service*
- 24 **Extract Txt2Img Comfy Workflow** Extract From File *Service*
- 25 **Fallback Txt2Img SDXL Turbo** Set *Logic*
- 26 **Write to error log** Read Write File *Service*
- 27 **Read API Exported Img2Img ComfyUI Workflow from Disk** Read Write File *Service*
- 28 **Fail Upload** Code *Logic*
- 29 **Edit Txt2Img Inputs** Set *Logic*
- 30 **Extract Img2Img Comfy Workflow** Extract From File *Service*
- 31 **Fallback Img2Img SDXL Turbo** Set *Logic*
- 32 **Link This To Error Handling** No Op *Logic*
- 33 **🎨🏠 Run local ComfyUI workflow** Execute Workflow *Logic*
- 34 **Edit Img2Img Inputs** Set *Logic*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 34, with 2 branches, 3 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Discord
- **Model:** None. This is plumbing, not judgement

## Questions

What does it need to run?

An n8n account, plus your own Discord account. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an event in a connected app.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 34 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 34 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fgenerate-ai-media-with-comfyui-images)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Discord](https://millionrounds.com/workflows?service=Discord#library)

## Workflows like it

Also content, with the same services where possible, closest in size first.

- [**Generate and publish SEO blog posts from Google Sheets to Webflow** 34 steps · calls a model · Discord, Google Sheets](https://millionrounds.com/workflow/generate-and-publish-seo-blog-posts-from-google-sheets-to-we)
- [**Automated Blog Creation & Multi-Platform Publishing** 33 steps · calls a model · Discord, LinkedIn](https://millionrounds.com/workflow/automated-blog-creation-and-multi-platform-publishing)
- [**Automated tweet generator & publisher with OpenAI and Discord** 33 steps · calls a model · Discord, Google Sheets](https://millionrounds.com/workflow/automated-tweet-generator-and-publisher-with-openai-and-disc)
- [**Automated PDF & Image Text Extractor & Instant Social Media** 36 steps · calls a model · Discord, Gmail](https://millionrounds.com/workflow/automated-pdf-and-image-text-extractor-and-instant-social-me)
- [**Translate RSS news and publish** 31 steps · Discord, Gmail](https://millionrounds.com/workflow/translate-rss-news-and-publish)
- [**Draft and track incident postmortems with OpenAI** 30 steps · calls a model · Discord, Gmail](https://millionrounds.com/workflow/draft-and-track-incident-postmortems-with-openai-2)
