Back to Templates
This n8n workflow automates “cloning” a competitor ad style and re-generating it using your product image. A user uploads your product image and provides a competitor ad URL via a form trigger; the workflow downloads both images, converts them to inline/base64 parts, builds a detailed generation prompt, sends the request to a generative-vision model (Gemini-style endpoints), waits for the result, converts the output back to a file and returns it. Use-cases: rapid ad iteration, creative A/B variants, and scaled ad re-skins.
form_trigger — user submits: competitor image URL, their product file, and optional changes.convert_product_image_to_base64 — converts uploaded product file to base64 inline data.download_image — fetches the competitor ad image from the provided URL.convert_ad_image_to_base64 — converts downloaded competitor image to base64 inline data.build_prompt — assembles a careful prompt (handles partial text, labels, placements, CTA swaps, additional changes).generate_ad_image_prompt → generate_ad_image — two HTTP Request nodes call generative endpoints (first to prepare prompt/content and then flash-image generation). These include inline image data and model-specific parameters.Wait — allows async generation to complete (workflow uses a wait/webhook pattern).set_result → get_image — extract image result, convert binary to file for downstream use (download or return to the requester).Sticky Note — visual diagram / docs inside workflow.form_trigger (n8n-nodes-base.formTrigger) — entry point; validates inputs.convert_product_image_to_base64 & convert_ad_image_to_base64 (extractFromFile) — convert uploaded/downloaded binaries to inline/base64 data for the model.download_image (httpRequest) — fetches competitor image URL. Add robust URL validation.build_prompt (set) — builds the natural-language prompt that instructs the model how to replace branding, packaging, and CTAs.generate_ad_image_prompt & generate_ad_image (httpRequest) — POST to generative APIs (examples use Gemini endpoints). Have retry/backoff settings.Wait — used to allow model generation to complete before extracting results.set_result / get_image / convertToFile — assemble the final binary file to deliver to the user.httpHeaderAuth).httpBearerAuth).retryOnFail and waitBetweenTries for httpRequest nodes (example uses retryOnFail: true and waitBetweenTries: 5000). Limit retries to avoid abuse.mime_type in inline data (png/jpeg) to avoid corrupt outputs.build_prompt to detect and list text to replace automatically.image-ad-cloner, n8n, gemini, generative-ai, image-editing, ad-cloning, automation, form-trigger, viral