## 設定ガイド

中級

これは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など)は別途料金が発生する場合があります。

関連ワークフロー

Google Drive および Nano Banana API を使用したバッチ証明写真変換機・アップグレード機
Google Drive と Nano Banana API を使ったバッチ証明写真変換機とアップグレード機
If
Set
Code
+
If
Set
Code
16 ノードpanyanyany
コンテンツ作成
Sora 2 APIを使用してウイルス動画を生成
Sora 2 AIを使用してマーケティングおよびコンテンツ制作のためのソーシャルメディア動画を作成する
If
Set
Code
+
If
Set
Code
11 ノードpanyanyany
コンテンツ作成
WordPressブログの自動化プロフェッショナル版(先端研究)v2.1マーケットプラグイン
GPT-4o、Perplexity AI、そして多言語対応を使ったSEO最適化ブログ作成の自動化
If
Set
Xml
+
If
Set
Xml
125 ノードDaniel Ng
コンテンツ作成
OpenAIとFirecrawlを使って製品URLからAI生成のMeta広告キャンペーンを作成する
OpenAI と Firecrawl を使って製品 URL から AI 生成の Meta 広告キャンペーンを作成
If
Set
Code
+
If
Set
Code
40 ノードAdam Crafts
コンテンツ作成
複数のリファレンス画像からビデオクリップを生成
Fal.ai VIDU を使って参照画像からウイルスのな動画を作成して YouTube/TikTok にアップロード
If
Set
Code
+
If
Set
Code
20 ノードDavide
コンテンツ作成
Nano Banana APIを使用した商品アイデアジェネレーター
Defapiを使用してGoogle Nano-Bananaモデルを使用して製品イメージを生成する
If
Set
Wait
+
If
Set
Wait
11 ノードpanyanyany
その他
ワークフロー情報
難易度
中級
ノード数13
カテゴリー2
ノードタイプ7
難易度説明

経験者向け、6-15ノードの中程度の複雑さのワークフロー

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34