8
n8n 한국어amn8n.com

## 설정 가이드

중급

이것은Content Creation, Multimodal AI분야의자동화 워크플로우로, 13개의 노드를 포함합니다.주로 If, Set, Code, Wait, FormTrigger 등의 노드를 사용하며. Gemini AI를 사용하여 레트로 포리스타일 사진 생성

사전 요구사항
  • 대상 API의 인증 정보가 필요할 수 있음
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": "MomV5viXB16wUmuP",
  "meta": {
    "instanceId": "61055bd86de35ef46fd36e8f404f58e3f9ad437c028cde71d16413774416da74"
  },
  "name": "Generate Vintage Polaroid Style Photo with Gemini AI",
  "tags": [],
  "nodes": [
    {
      "id": "af84ccab-6bfc-4223-a846-200942e41371",
      "name": "메모3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        -736
      ],
      "parameters": {
        "color": 3,
        "width": 780,
        "height": 760,
        "content": "# Generate Vintage Polaroid Style Photo with Gemini AI\n\n## Overview\nThis workflow uses the Defapi API with Google's **Gemini AI** to transform digital photos into authentic Polaroid-style vintage photographs. Upload your photos, provide a creative prompt, and get AI-generated vintage effects with that distinctive instant camera charm.\n\n**Input:** Digital photos + creative prompt + API key  \n**Output:** Polaroid-style vintage photographs\n\nThe system provides a simple form interface where users submit their images, prompt, and API key. It automatically processes requests through Defapi API, monitors generation status, and delivers the final vintage photo output. Ideal for photographers, content creators, and social media enthusiasts looking to add vintage charm to their digital photos.\n\n\n## Prerequisites\n- A Defapi account and API key: Sign up at [Defapi.org](https://defapi.org/model/google/gemini-2.5-flash-image)\n- An active n8n instance (cloud or self-hosted) with HTTP Request and form submission capabilities\n- Digital photos for transformation (well-lit photos work best)\n- Basic knowledge of AI prompts for vintage photo generation\n\n**Example prompt:** Take a picture with a Polaroid camera. The photo should exhibit rich saturation and vintage color cast, with soft tones, low contrast, and vignetting. The texture features distinct film grain. Do not change the faces. Replace the background behind the two people with a white curtain. Make them close to each other with clear faces and normal skin color.\n\n## Setup Instructions\n1. **Obtain API Key**: Register at Defapi.org and generate your API key. Store it securely.\n2. **Configure the Form**: Set up the \"Upload 2 Images\" form trigger with: Image 01 & Image 02 (file uploads), API Key (text field), and Prompt (text field).\n3. **Test the Workflow**:\n   - Click \"Execute Workflow\" in n8n\n   - Access the form URL, upload two photos, enter your prompt, and provide your API key\n   - The workflow processes images, sends the request to Defapi API, waits 10 seconds, then polls until generation is complete\n4. **Handle Outputs**: The final node displays the generated image URL for download or sharing.\n\n## Workflow Structure\nThe workflow consists of the following nodes:\n1. **Upload 2 Images** (Form Trigger) - Collects user input: two image files, API key, and prompt\n2. **Convert to JSON** (Code Node) - Converts uploaded images to base64 and formats data\n3. **Send Image Generation Request to Defapi.org API** (HTTP Request) - Submits generation request\n4. **Wait for Image Processing Completion** (Wait Node) - Waits 10 seconds before checking status\n5. **Obtain the generated status** (HTTP Request) - Polls API for completion status\n6. **Check if Image Generation is Complete** (IF Node) - Checks if status equals 'success'\n7. **Format and Display Image Results** (Set Node) - Formats final image URL output\n\n## Technical Details\n- **API Endpoint**: `https://api.defapi.org/api/image/gen` (POST request)\n- **Model Used**: `google/gemini` (**Gemini AI**)\n- **Status Check Endpoint**: `https://api.defapi.org/api/task/query` (GET request)\n- **Wait Time**: 10 seconds between status checks\n- **Image Processing**: Uploaded images are converted to base64 format for API submission\n- **Authentication**: Bearer token authentication using the provided API key\n- **Specialized For**: Polaroid-style vintage photography and instant camera effects\n\n## Customization Tips\n- **Enhance Prompts**: Include specifics like vintage color cast, film grain texture, vignetting, lighting conditions, and atmosphere to improve AI photo quality. Specify desired saturation levels and contrast adjustments.\n- **Photo Quality**: Use well-lit, clearly exposed photos for best results. The AI can simulate flash effects and vintage lighting, but quality input produces better output. Note that generated photos may sometimes be unclear or have incorrect skin tones - try multiple generations to achieve optimal results.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7c7629bf-0c92-4de1-b0b4-93d0bb097146",
      "name": "생성 상태 확인",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -320,
        96
      ],
      "parameters": {
        "url": "https://api.defapi.org/api/task/query",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "task_id",
              "value": "={{$json.data.task_id}}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('Convert to JSON').item.json.api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a6ff7deb-a1d7-4b4b-b0cf-a97e56805a6d",
      "name": "Defapi.org API에 이미지 생성 요청 전송",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -752,
        96
      ],
      "parameters": {
        "url": "https://api.defapi.org/api/image/gen",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"prompt\": \"{{$json.prompt}}\",\n  \"model\": \"google/nano-banana\",\n  \"images\": [\"{{ $json.img_url_01 }}\", \"{{ $json.img_url_02 }}\"]\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "Authorization",
              "value": "=Bearer {{ $json.api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "765b6cfd-8678-42f5-aad4-a4c197b0e628",
      "name": "이미지 처리 완료 대기",
      "type": "n8n-nodes-base.wait",
      "position": [
        -512,
        96
      ],
      "webhookId": "bb6c2821-9586-44b7-8606-2ee69a77ed75",
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    },
    {
      "id": "ee3bce44-c556-42af-97aa-8e7fdae40285",
      "name": "이미지 생성 완료 여부 확인",
      "type": "n8n-nodes-base.if",
      "position": [
        -128,
        96
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "db9a5dec-997b-4c3f-9582-37c9bbeb19ff",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "=true",
              "rightValue": "={{ $json.data.status == 'success' }}"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "d88742b4-960c-4bab-84da-557ec413f71e",
      "name": "이미지 결과 포맷 및 표시",
      "type": "n8n-nodes-base.set",
      "position": [
        64,
        80
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "fa5f375f-cddc-4f7b-a018-67c28015d18b",
              "name": "image_url",
              "type": "string",
              "value": "={{$json.data.result[0].image}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "22e91f6d-13a5-474a-9f93-0c66ba8540e8",
      "name": "메모2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        304
      ],
      "parameters": {
        "color": 4,
        "width": 400,
        "height": 576,
        "content": "## Input Photo 1\n![Product](https://i.imgur.com/s9KaIO2.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "98a4119e-0e06-4a61-a215-b03cfc64058c",
      "name": "메모4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        304
      ],
      "parameters": {
        "width": 640,
        "height": 608,
        "content": "## Result Image\n![Creative](https://i.imgur.com/1jYGhjc.jpeg)"
      },
      "typeVersion": 1
    },
    {
      "id": "9df109b4-077a-425b-ad08-a1b6246d4c9d",
      "name": "JSON로 변환",
      "type": "n8n-nodes-base.code",
      "position": [
        -896,
        -48
      ],
      "parameters": {
        "jsCode": "/**\n * Encodes multiple binary files from an n8n input item into Base64 strings.\n *\n * This code assumes it is running in an n8n \"Code\" or \"Function\" node\n * where 'this' refers to the node's context and 'helpers' are available.\n *\n * @returns {object} An object containing an array of file objects,\n * each with a 'path' and 'data' (Base64 string).\n */\nconst results = {};\n\nconst getImageDataUrl = async (name) => {\n    const bin = $input.first().binary[name];\n    // Use n8n's helper function to get the file buffer.\n    const binBuffer = await this.helpers.getBinaryDataBuffer(0, name);\n    return `data:${bin.mimeType};base64,${Buffer.from(binBuffer).toString('base64')}`\n}\n\n// Push a new object to the results array.\nresults.img_url_01 = await getImageDataUrl('Image_01')\nresults.img_url_02 = await getImageDataUrl('Image_02')\nresults.api_key = $input.first().json['API Key']\nresults.prompt = $input.first().json['Prompt']\n\n// Return the final object in the expected format for the next node.\nreturn results;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "c128c65c-f435-43d4-9d50-719429fa9510",
      "name": "메모",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1184,
        80
      ],
      "parameters": {
        "content": "## Example prompt\nTake a picture with a Polaroid camera. The photo should look like a normal photo, without any clear subjects or props. such as a flash from a dark room, spread throughout the photo.In terms of color, it exhibits rich saturation and a vintage color cast, with soft tones, low contrast, and often accompanied by vignetting. The texture features a distinct film grain. Do not change the faces. Replace the background behind the two people with a white curtain. Make them being close to each other.The face should be clear. Their skin should be normal color."
      },
      "typeVersion": 1
    },
    {
      "id": "bab5bb39-ecb4-41a7-9a31-06afed798ddd",
      "name": "이미지 2개 업로드",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1104,
        -48
      ],
      "webhookId": "254a1336-57d2-4ba0-93e1-e8460fc94f00",
      "parameters": {
        "options": {},
        "formTitle": "Upload 2 Images",
        "formFields": {
          "values": [
            {
              "fieldLabel": "API Key",
              "requiredField": true
            },
            {
              "fieldLabel": "Prompt",
              "requiredField": true
            },
            {
              "fieldType": "file",
              "fieldLabel": "Image 01",
              "multipleFiles": false,
              "requiredField": true,
              "acceptFileTypes": "image/*"
            },
            {
              "fieldType": "file",
              "fieldLabel": "Image 02",
              "requiredField": true,
              "acceptFileTypes": "image/*"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "1dfb0d0e-0b2c-4aa1-9a10-3b6750f797c4",
      "name": "메모5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        304
      ],
      "parameters": {
        "color": 4,
        "width": 400,
        "height": 576,
        "content": "## Input Photo 2\n![Product](https://i.imgur.com/t4GA0OJ.jpeg)"
      },
      "typeVersion": 1
    },
    {
      "id": "aaaa1a73-3682-49c4-b074-4ebb354abb6d",
      "name": "메모1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1024,
        -192
      ],
      "parameters": {
        "height": 128,
        "content": "## Convert to JSON\nConvert binary data of image to base64-style data url."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "43634557-84b0-4613-a82e-ff722c925dd8",
  "connections": {
    "9df109b4-077a-425b-ad08-a1b6246d4c9d": {
      "main": [
        [
          {
            "node": "a6ff7deb-a1d7-4b4b-b0cf-a97e56805a6d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bab5bb39-ecb4-41a7-9a31-06afed798ddd": {
      "main": [
        [
          {
            "node": "9df109b4-077a-425b-ad08-a1b6246d4c9d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7c7629bf-0c92-4de1-b0b4-93d0bb097146": {
      "main": [
        [
          {
            "node": "ee3bce44-c556-42af-97aa-8e7fdae40285",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "765b6cfd-8678-42f5-aad4-a4c197b0e628": {
      "main": [
        [
          {
            "node": "7c7629bf-0c92-4de1-b0b4-93d0bb097146",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ee3bce44-c556-42af-97aa-8e7fdae40285": {
      "main": [
        [
          {
            "node": "d88742b4-960c-4bab-84da-557ec413f71e",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "765b6cfd-8678-42f5-aad4-a4c197b0e628",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a6ff7deb-a1d7-4b4b-b0cf-a97e56805a6d": {
      "main": [
        [
          {
            "node": "765b6cfd-8678-42f5-aad4-a4c197b0e628",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

중급 - 콘텐츠 제작, 멀티모달 AI

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
중급
노드 수13
카테고리2
노드 유형7
난이도 설명

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34