PTENES
Home/Video Systems/Module 5.5

Video Systems · Module 5/6

Ad images with Nano Banana

Description

_(no description)_

Downloaded Resources

{ "name": "NanoBanana OpenRouter", "nodes": [ { "parameters": { "formTitle": "UGC Ad Generator", "formDescription": "Generates UGC ads from the user's description and photo", "formFields": { "values": [ { "fieldLabel": "Image description", "requiredField": true }, { "fieldLabel": "Image", "fieldType": "file", "acceptFileTypes": ".jpg, .png" } ] }, "options": {} }, "type": "n8n-nodes-base.formTrigger", "typeVersion": 2.3, "position": [ -320, -240 ], "id": "3b426721-8a1d-455f-b119-9421e8a76d60", "name": "On form submission", "webhookId": "52e0abd7-0e7b-427d-80d1-ba9f3558f456" }, { "parameters": { "inputDataFieldName": "Image", "driveId": { "__rl": true, "value": "My Drive", "mode": "list", "cachedResultName": "My Drive", "cachedResultUrl": "https://drive.google.com/drive/my-drive" }, "folderId": { "__rl": true, "value": "1MxaX7NrmmTHQtHLLEw3JqXqjMbNKU2lx", "mode": "list", "cachedResultName": "image urls", "cachedResultUrl": "https://drive.google.com/drive/folders/1MxaX7NrmmTHQtHLLEw3JqXqjMbNKU2lx" }, "options": {} }, "type": "n8n-nodes-base.googleDrive", "typeVersion": 3, "position": [ -144, -240 ], "id": "2de4ef12-1d72-427e-85ee-754b0190a405", "name": "Upload file", "credentials": { "googleDriveOAuth2Api": { "id": "tTKNlY1ktx7UntI0", "name": "Google Drive account" } } }, { "parameters": { "resource": "image", "operation": "analyze", "modelId": { "__rl": true, "value": "chatgpt-4o-latest", "mode": "list", "cachedResultName": "CHATGPT-4O-LATEST" },

"text": "=Analyze the provided image and determine whether it mainly depicts a product, a character, or BOTH.\n\n- If the image shows a product, return the analysis in YAML format with the following fields:\n\nbrand_name: (Name of the brand shown in the image, if visible or inferable)\ncolor_scheme:\n - hex: (Hex code for each prominent color used)\n name: (Descriptive name of the color)\nfont_style: (Describe the font family or style used: serif/sans-serif, bold/thin, etc.)\nvisual_description: (One or two complete sentences summarizing what is shown in the image, ignoring the background)\n\n- If the image shows a character, return the analysis in YAML format with the following fields:\n\ncharacter_name: (Name of the character, if visible or inferable)\ncolor_scheme:\n - hex: (Hex code for each prominent color used on the character)\n name: (Descriptive name of the color)\noutfit_style: (Description of the clothing style, accessories, or notable features)\nvisual_description: (One or two complete sentences summarizing what the character looks like, ignoring the background)\n\nReturn only the YAML. Do not explain or add any other comments.\n\n\n- If it is BOTH, return both descriptions as instructed above in YAML format\n", "imageUrls": "={{ $json.webContentLink }}", "simplify": false, "options": {} }, "type": "@n8n/n8n-nodes-langchain.openAi", "typeVersion": 1.8, "position": [ 16, -240 ], "id": "24f6e9ea-2455-44c7-a9f1-48b89f6204a7", "name": "Describe Img", "credentials": { "openAiApi": { "id": "zE5O89L0JjnRwfPU", "name": "OpenAi account" } } }, { "parameters": { "model": { "__rl": true, "value": "gpt-4.1-mini", "mode": "list", "cachedResultName": "gpt-4.1-mini" }, "options": {} }, "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "typeVersion": 1.2, "position": [ -544, ], "id": "31ed2fc5-3789-456d-9c1a-6db3685367f9", "name": "OpenAI Chat Model", "credentials": { "openAiApi": { "id": "zE5O89L0JjnRwfPU", "name": "OpenAi account" } } }, { "parameters": { "promptType": "define", "text": "=Your task: Create an image prompt as instructed by your system guidelines.\n\nMake sure the reference image is reproduced as ACCURATELY as possible in the resulting images, especially all text.\n\n\nThese are the user's descriptions:\n{{ $('On form submission').item.json['Image description'] }}\n\n\nReference image description:\n{{ $('Describe Img').first().json.choices[0].message.content }}\n\n", "hasOutputParser": true, "options": {

"systemMessage": "=ROLE: Ad Prompt Creator\n\nPurpose: Given an image URL or product information, write a short natural description for an AI image/video generator to use in an ad.\n\nDefaults:\n\nIf vague, place the product with a person in a suitable everyday setting.\nIf no style is given, use casual ad-ready realism.\n\nRealism:\n\nMake it feel authentic and relatable.\nLight imperfections: off-center framing, natural light, slight motion blur, subtle grain.\nKeep packaging text exactly as shown. No invented claims.\n\nCamera Cues (use ≥2):\nphone photo, handheld framing, off-center composition, natural indoor light, soft shadows, slight motion blur, auto exposure, unpolished look, subtle grain.\n\n\nOutput:\nReturn only one JSON object:\n{ \"image_prompt\": \"a string (≤120 words) covering subject, action, mood, setting, style/camera, colors, and text accuracy\" }\n\nDiversity:\n\nIf unspecified, vary gender/ethnicity naturally.\nDefault age: 21–38.\nPrefer real-world spaces.\n\nGood Example:\n\n{ \"image_prompt\": \"young professional holding a reusable water bottle while walking to work; action: casually sipping; mood: energetic morning; setting: busy city street; style/camera: phone photo, handheld framing, off-center composition, natural light, slight motion blur; colors: bright blue bottle stands out; text accuracy: keep the logo exactly as visible\" }" } }, "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 2, "position": [ -480, ], "id": "81622c7e-e50d-4419-a431-d2b58115cd4b", "name": "Image Prompt Generator" }, { "parameters": { "jsonSchemaExample": "{\n\t\"image_prompt\": \"string\"\n}", "autoFix": true }, "type": "@n8n/n8n-nodes-langchain.outputParserStructured", "typeVersion": 1.3, "position": [ -368, ], "id": "e7f159bd-83d4-466d-aee9-ba4d4d86d170", "name": "Structured Output Parser" }, { "parameters": { "operation": "toBinary", "sourceProperty": "base", "options": {} }, "type": "n8n-nodes-base.convertToFile", "typeVersion": 1.1, "position": [ 192, ], "id": "617a6e32-916a-4ef3-8575-7f30f167cb21", "name": "Convert to File1" }, { "parameters": { "method": "POST", "url": "https://openrouter.ai/api/v1/chat/completions", "authentication": "predefinedCredentialType", "nodeCredentialType": "openRouterApi", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Content-Type", "value": "application/json" } ] }, "sendBody": true, "specifyBody": "json",

"jsonBody": "={\n \"model\": \"google/gemini-2.5-flash-image-preview\",\n \"modalities\": [\"image\", \"text\"],\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"{{ $json.output.image_prompt.replace(/\\\"/g, '\\\\\\\"').replace(/\\n/g, '\\\\n') }}\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"{{ $('Upload file').item.json.webContentLink }}\"\n }\n }\n ]\n }\n ]\n}\n\n", "options": { "response": { "response": { "responseFormat": "json" } } } }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ -144, ], "id": "7214c3be-b59b-4cef-9d76-f116b05fc7a3", "name": "HTTP Request", "credentials": { "openRouterApi": { "id": "NrrkWrl89ut7kmrh", "name": "OpenRouter account 2" } } }, { "parameters": { "assignments": { "assignments": [ { "id": "0d3e1ea2-9386-47bf-8f8a-cce7f349dbe5", "name": "=data", "value": "={{$json[\"choices\"][0][\"message\"][\"images\"][0][\"image_url\"][\"url\"]}}", "type": "string" }, { "id": "393caf3e-e367-4490-8ee3-28bfc83318b1", "name": "=base", "value": "={{$json[\"choices\"][0][\"message\"][\"images\"][0][\"image_url\"][\"url\"].split(\",\")[1]}}", "type": "string" }, { "id": "f827ebfd-c7d3-48f1-8589-74965070f910", "name": "mime", "value": "={{$json[\"choices\"][0][\"message\"][\"images\"][0][\"image_url\"][\"url\"].match(/^data:([^;]+)/)[1]}}", "type": "string" }, { "id": "7de58815-fa11-46ba-acb4-eb4563120218", "name": "fileName", "value": ".png", "type": "string" } ] }, "options": {} }, "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 32, ], "id": "463632f6-2b25-40e3-81f9-3686b1b2d2ec", "name": "Edit Fields1" }, { "parameters": { "content": "# Upload Image & Description", "height": 288, "width": 656, "color": 6 }, "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -432, -336 ], "id": "226d7112-a7ea-466f-94f7-e88a218f2eb6", "name": "Sticky Note2" }, { "parameters": { "content": "# Get New/Edited Image from NanoBanana via OpenRouter", "height": 448, "width": 1008, "color": 5 }, "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -608, -16 ], "id": "ac044ae6-31b2-4c08-9e33-7abfae52c0ab", "name": "Sticky Note3"

} ], "pinData": {}, "connections": { "On form submission": { "main": [ [ { "node": "Upload file", "type": "main", "index": 0 } ] ] }, "Upload file": { "main": [ [ { "node": "Describe Img", "type": "main", "index": 0 } ] ] }, "Describe Img": { "main": [ [ { "node": "Image Prompt Generator", "type": "main", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "Image Prompt Generator", "type": "ai_languageModel", "index": 0 }, { "node": "Structured Output Parser", "type": "ai_languageModel", "index": 0 } ] ] }, "Image Prompt Generator": { "main": [ [ { "node": "HTTP Request", "type": "main", "index": 0 } ] ] }, "Structured Output Parser": { "ai_outputParser": [ [ { "node": "Image Prompt Generator", "type": "ai_outputParser", "index": 0 } ] ] }, "HTTP Request": { "main": [ [ { "node": "Edit Fields1", "type": "main", "index": 0 } ] ] }, "Edit Fields1": { "main": [ [ { "node": "Convert to File1", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1" }, "versionId": "c78cbaf2-7510-43aa-8c59-eb1e0014f05c", "meta": { "instanceId": "5f99b345c3a4501a22438ba5962ff6685e5e97ee4bd0a17cc04a19ed072b5c2a" }, "id": "DofPrW2OLpB8QJiO", "tags": [] }

← Previous
Planet Cutting ASMR
Next →
AI UGC Ads