Here is the lfow:
</>
{
“nodes”: [
{
“parameters”: {
“httpMethod”: “POST”,
“path”: “148270d8-f42b-41ef-8334-688d4d9da647”,
“options”: {}
},
“type”: “n8n-nodes-base.webhook”,
“typeVersion”: 2.1,
“position”: [
-96,
-80
],
“id”: “13fd0db3-eef1-4d38-a9a0-b159ef8f9c3c”,
“name”: “Webhook”,
“webhookId”: “148270d8-f42b-41ef-8334-688d4d9da647”
},
{
“parameters”: {
“operation”: “toBinary”,
“sourceProperty”: “candidates[0].content.parts[0].inlineData.data”,
“binaryPropertyName”: “=generated_image”,
“options”: {
“fileName”: “generated_image2”
}
},
“type”: “n8n-nodes-base.convertToFile”,
“typeVersion”: 1.1,
“position”: [
1472,
-272
],
“id”: “8b060caf-e2cf-4abd-9ac9-8270b77f1e5c”,
“name”: “Save final results”
},
{
“parameters”: {
“url”: “={{ $json.url }}”,
“options”: {
“response”: {
“response”: {
“responseFormat”: “file”
}
}
}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
496,
-112
],
“id”: “39f26c04-6365-4b9a-94f3-ee371ed5de57”,
“name”: “HTTP Request”
},
{
“parameters”: {
“operation”: “binaryToPropery”,
“destinationKey”: “=generated_image_{{$runIndex}}”,
“options”: {}
},
“type”: “n8n-nodes-base.extractFromFile”,
“typeVersion”: 1,
“position”: [
1200,
32
],
“id”: “3aecd95e-2bcc-4ec6-8cf4-2fa4b70e8dd6”,
“name”: “Extract from File”
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “e8249f97-507c-4162-9c2a-58ffe6dfff25”,
“name”: “change”,
“value”: “Create a professional e-commerce fashion photo. Take the cloth from the first image and let the model from the second image wear it. Generate a realistic, full-body shot of the model wearing the cloth, with the lighting and shadows adjusted to match the same environment of the model, the result should be the same model in the same environment wearnig the cloth”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
96,
-112
],
“id”: “f5f35748-61a5-47fa-b663-96cfc2a5bbfe”,
“name”: “Edit Fields8”
},
{
“parameters”: {
“jsCode”: “const images = $(‘Webhook’).first().json.body.images;\n\nreturn images.map(img => {\n return {\n json: {\n url: img.url,\n type: img.type\n }\n };\n});\n”
},
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [
288,
-80
],
“id”: “2698c469-3315-4385-a393-bea4921ff61e”,
“name”: “Code”
},
{
“parameters”: {
“options”: {}
},
“type”: “n8n-nodes-base.splitInBatches”,
“typeVersion”: 3,
“position”: [
736,
-96
],
“id”: “1b7f6c5b-78d1-4580-8e66-b0375c9cf5fa”,
“name”: “Loop Over Items”
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “c84c58c3-3a8a-4e82-8414-ca602730eb97”,
“name”: “product”,
“value”: “={{ $json.generated_image_0 }}”,
“type”: “string”
},
{
“id”: “15448af7-97aa-40f5-a36b-3202cbac23ea”,
“name”: “model”,
“value”: “={{ $json.generated_image_1 }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
1024,
-192
],
“id”: “edc27be1-646c-4c1d-9edc-4964bbbafdcf”,
“name”: “Edit Fields”
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image-preview:generateContent”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “x-goog-api-key”,
“value”: “yBa”
}
]
},
“sendBody”: true,
“specifyBody”: “json”,
“jsonBody”: "={\n “contents”: [\n {\n “parts”: [\n {\n “inline_data”: {\n “mime_type”: “image/png”,\n “data”: “{{ $json.product }}”\n }\n },\n {\n “inline_data”: {\n “mime_type”: “image/jpeg”,\n “data”: “{{ $json.model }}”\n }\n },\n {\n “text”: “{{ $(‘Edit Fields8’).item.json.change }}”\n }\n ]\n }\n ]\n} ",
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
1264,
-240
],
“id”: “68521d8d-60eb-41f0-a33e-48195acc7d5f”,
“name”: “Model wears the cloth”
}
],
“connections”: {
“Webhook”: {
“main”: [
[
{
“node”: “Edit Fields8”,
“type”: “main”,
“index”: 0
}
]
]
},
“HTTP Request”: {
“main”: [
[
{
“node”: “Loop Over Items”,
“type”: “main”,
“index”: 0
}
]
]
},
“Extract from File”: {
“main”: [
[
{
“node”: “Loop Over Items”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields8”: {
“main”: [
[
{
“node”: “Code”,
“type”: “main”,
“index”: 0
}
]
]
},
“Code”: {
“main”: [
[
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
}
]
]
},
“Loop Over Items”: {
“main”: [
[
{
“node”: “Edit Fields”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “Extract from File”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields”: {
“main”: [
[
{
“node”: “Model wears the cloth”,
“type”: “main”,
“index”: 0
}
]
]
},
“Model wears the cloth”: {
“main”: [
[
{
“node”: “Save final results”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {
“Webhook”: [
{
“headers”: {
“host”: “n8n.roeeaizman.com”,
“user-agent”: “Deno/2.3.1”,
“content-length”: “637”,
“accept”: “/”,
“accept-encoding”: “gzip,br”,
“accept-language”: “*”,
“cdn-loop”: “deno;s=deno;d=f67vaeed9zzc”,
“content-type”: “application/json”,
“via”: “2.0 Caddy”,
“x-forwarded-for”: “35.236.74.252”,
“x-forwarded-host”: “n8n.roeeaizman.com”,
“x-forwarded-proto”: “https”
},
“params”: {},
“query”: {},
“body”: {
“project_id”: “68d2970ebce4185676a1a08e”,
“images”: [
{
“image_number”: 1,
“type”: “product”,
“url”: “https://base44.app/api/apps/68d25b21170607c38292d2b2/files/public/68d25b21170607c38292d2b2/3c5d46d2b_f59e29cbc_15e33569-dd21-4395-93d3-3331a17ab627.png”,
“order”: 1
},
{
“image_number”: 2,
“type”: “model”,
“url”: “https://base44.app/api/apps/68d25b21170607c38292d2b2/files/public/68d25b21170607c38292d2b2/efdbc4c77_model.jpg”
}
],
“total_product_images”: 1,
“total_images”: 2,
“timeout”: 300,
“callback_instructions”: “Generate high-quality fashion visualizations showing the model wearing the products from multiple angles including front, side, and back views.”
},
“webhookUrl”: “https://n8n.roeeaizman.com/webhook-test/13dbf528-a666-4d82-bf3e-5998da0f8b1e”,
“executionMode”: “test”
}
]
},
“meta”: {
“instanceId”: “3efbe569e558a18a54352d7073a74807fb3f352c1b3f6b3fdfb719b0cd89fe51”
}
}
</>