Connect OpenAI’s New Image Model to n8n (Step-By-Step)

Jono CatliffAbout 5 min readJun 8, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

  • OpenAI Image Generation Model (newest version)
  • Image generation via API
  • NAD (NAND?) integration
  • Image merging
  • Text generation in images
  • HTTP Request module in NAD
  • API Key
  • Base64 to Image Conversion
  • Aggregator module in NAD
  • Curl request formatting for NAD

Image Generation with OpenAI's Newest Model in NAD

Use Cases

The video focuses on two primary use cases for OpenAI's new image generation model within the NAD platform:

  1. Generating standalone images from text prompts: Creating images from scratch based on textual descriptions. The model's improved text generation capabilities within images are highlighted.
  2. Merging multiple images into a single, new image: Combining existing images, such as product photos, into a composite image, like a gift basket arrangement.

Generating Images from Text Prompts (Use Case 1)

Step-by-Step Process:

  1. Accessing the OpenAI Image Generation API: Navigating to the OpenAI platform and selecting the image generation API.
  2. Obtaining the Curl Request: Switching the code example from Python to Curl format.
  3. Importing the Curl Request into NAD: Using the HTTP Request module in NAD and utilizing the "Import Curl" function.
  4. Removing the Last Line: Deleting the last line of the imported Curl request to avoid errors in NAD.
  5. Setting the API Key: Obtaining an API key from platform.openai.com and inserting it into the NAD configuration.
  6. Verifying Identity: Completing the OpenAI identity verification process (driver's license upload).
  7. Executing the Request: Running the HTTP Request module to generate the image.
  8. Converting Base64 to Image: Using the "Convert to File" module in NAD to transform the Base64 encoded image data into a viewable image file.

Example:

  • The video demonstrates generating an image of "a stunning cinematic wide-angle shot of a futuristic workspace glowing with a soft neon light."
  • Another example is "a hyperrealistic otter with an orange scarf being hugged by a cat."

Technical Details:

  • HTTP Request Module: Used for interacting with external APIs within NAD. Requires manual configuration compared to pre-built NAD modules.
  • API Key: A unique identifier required to authenticate requests to the OpenAI API.
  • Base64 Encoding: The image data is returned in Base64 format, which needs to be converted to a standard image format (e.g., PNG, JPEG).

Merging Images (Use Case 2)

Step-by-Step Process:

  1. Downloading Images: Using Google Drive folders as the source for the images to be merged. Downloading the images separately into NAD.
  2. Aggregating Images: Using the "Aggregator" module to combine the two downloaded images into a single list or item containing both images.
  3. Formatting the Curl Request: Obtaining the Curl request for image editing from the OpenAI API.
  4. Reformatting Curl with ChatGPT: Using ChatGPT to reformat the Curl request to be compatible with NAD, as the original Curl request may produce errors.
  5. Importing the Reformatted Curl Request: Importing the ChatGPT-reformatted Curl request into an HTTP Request module in NAD.
  6. Setting the API Key: Inserting the OpenAI API key into the NAD configuration.
  7. Configuring the Request Body: Ensuring the request body is in "form data" format and includes the image model (gpt-4-turbo) and the prompt.
  8. Passing Image Data: Passing the two image files as binary data with the same name ("image[]") in the request body.
  9. Executing the Request: Running the HTTP Request module to generate the merged image.

Example:

  • The video demonstrates merging two product images (shower gel and body lotion) into a single image depicting a gift basket containing both products.

Technical Details:

  • Aggregator Module: Combines multiple data items into a single list, allowing for processing them together.
  • Form Data: A specific format for sending data in HTTP requests, often used for file uploads.
  • Binary Data: The raw data of the image files, as opposed to text-based representations.

Challenges:

  • The video mentions difficulties in getting the aggregator module to work correctly and the need for specific formatting to create a list of images.
  • The initial Curl request from OpenAI did not import cleanly into NAD, requiring reformatting with ChatGPT.

Results and Limitations

  • The generated images are generally of high quality, with the model demonstrating an ability to upscale lower-resolution images.
  • The model's text generation capabilities within images are improving but still not perfect. The generated text may contain errors or be nonsensical in some cases.
  • The identity verification process required by OpenAI (driver's license upload) is a potential privacy concern.

Notable Quotes:

  • "Forget having to go into Photoshop or in design or whatever and divi design something like this quickly you can mock this up in a matter of a couple seconds automatically using the newest image generation model from ChachiBT."
  • "I think that this technology has come a long way if you guys liked this video today please do me a favor and hit that subscribe button really helps me out"

Synthesis/Conclusion

The video demonstrates the capabilities of OpenAI's newest image generation model within the NAD platform, focusing on generating images from text prompts and merging existing images. While the model shows significant improvements in image quality and text generation, there are still limitations, particularly in text accuracy. The integration with NAD allows for programmatic image generation, but requires some technical expertise in configuring HTTP requests and handling data formats. The video provides a practical guide to using the API, highlighting both the potential and the challenges involved.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.