Imagine receiving an email and having it magically transformed into a vibrant piece of AI-generated artwork—all in under a minute!

In this post, I’ll share how I built a no-code workflow that uses n8n, ComfyUI, and FLUX.1-dev to turn a simple email into stunning digital art. Whether you’re into automation, AI art, or simply exploring new tech, this project is sure to spark your creativity.

How It Works

At the heart of this project is a seamless workflow that bridges your inbox and an AI-powered image generator. Here’s a quick rundown of the process:

  1. Email Trigger: The journey begins when an email lands in your inbox, which activates a custom n8n node designed to handle incoming prompts.
  2. Workflow Integration: The email content is processed, and a corresponding ComfyUI workflow is exported as an API JSON file.
  3. Prompt Refinement: The system leverages OLLAMA with the Mistral small 24B model to validate and refine the prompt, ensuring that the resulting image is both creative and high quality.
  4. Stable Diffusion: The n8n node for ComfyUI with the imported JSON file describing the ComfyUI workflow then triggers the ComfyUI process that starts generating an image.
  5. Art Delivery: Finally, the generated artwork is sent back to you via email, all without any manual intervention.

Watch a vintage street scene come to life in my and see the magic unfold in real time!

Step-by-Step Guide

Ready to build your own Email-to-Art automation? Follow these steps:

1. Install n8n on Ubuntu

n8n serves as the backbone of our automation workflow. To install it on an Ubuntu system, I’ve prepared an installation script that makes the setup hassle-free. You can find the complete script and instructions on my GitHub repository:

Simply download and run the script to have n8n up and running on your system.

2. Set Up ComfyUI

Next, configure ComfyUI by exporting your workflow as an API JSON file. This file is crucial for n8n to trigger the Stable Diffusion process when an email is received.

3. Configure the Custom n8n Node

For smooth processing of email prompts, install the custom n8n node specifically created for this project. This node is available on npm and ensures that incoming emails are correctly interpreted to kickstart the workflow.

4. Integrate Ollama for Local LLM Hosting

To refine the email prompts effectively, the project uses OLLAMA with the Mistral small 24B model. However, hosting these large language models locally requires Ollama. Integrating Ollama provides the necessary environment to run and manage these models, ensuring that your prompt validation and refinement are robust and efficient.

5. Run the Workflow

With all components in place, it’s time to test the system. Send an email and watch as the automation kicks in—processing the prompt, generating a beautiful image via Stable Diffusion, and delivering the artwork right back to your inbox.

Email-to-Art Automate AI-Image Generation with n8n, ComfyUI, Ollama & FLUX.1-dev

Email-to-Art Automate AI-Image Generation with n8n, ComfyUI, Ollama & FLUX.1-dev

Final Thoughts

This project demonstrates how combining no-code automation with state-of-the-art AI technologies can unlock new creative possibilities. By integrating n8n, ComfyUI, and local LLM hosting via Ollama, you can effortlessly transform text-based prompts into stunning visual art.

If you found this tutorial helpful, be sure to check out the full video demonstration on YouTube. Don’t forget to like, comment, and subscribe for more creative low-code adventures!

Happy automating!