APImage を使用して画像の背景を自動で置き換え・再調整

中級

これはMiscellaneous, Multimodal AI分野の自動化ワークフローで、10個のノードを含みます。主にFormTrigger, GoogleDrive, HttpRequestなどのノードを使用。 APImage を使用して画像の背景を自動のに置き換えて再照明する

前提条件
  • Google Drive API認証情報
  • ターゲットAPIの認証情報が必要な場合あり
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "47d295a7329d3547e0e6b56de9e439dc1a0a49c6d827b2320629f54300c47e41"
  },
  "nodes": [
    {
      "id": "15ab6203-2c77-45ac-b5dd-79f404e090fa",
      "name": "付箋",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -140
      ],
      "parameters": {
        "width": 1220,
        "height": 300,
        "content": "\n\n##  🡫 How To Get Started \n\n1. Double-click the **APImage API** node to open it.\n2. Replace \"_YOUR_API_KEY_\" with your API Key.\n3. Use the **Replace Background** node to submit a request.\n\nNote: You can find your API Key inside the Dashboard of your APImage account. \n\n[Open the Dashboard 🡥](https://apimage.org/dashboard) \n\nNeed support with your API key? ✉ [ask@support.apimage.org](mailto:ask@support.apimage.org)"
      },
      "typeVersion": 1
    },
    {
      "id": "8cb25cf6-2de1-4a8a-b39f-dd3d277ef96e",
      "name": "付箋2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        920,
        180
      ],
      "parameters": {
        "color": 4,
        "width": 300,
        "height": 1160,
        "content": "### Output Images  \n\nYou can store or upload the processed images to any platform of your choice.  \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSimply connect nodes for the service where you want the images saved, for example:  \n\n- SQLite, MySQL, PostgreSQL, and other databases  \n- Google Drive, Dropbox, OneDrive, or Box  \n- S3 object storage, FTP servers, or WebDAV  \n- Airtable, Notion, Coda, or Smartsheet  \n- And many other services  \n\nBe sure to place these nodes **after the \"Download Image\" node**.  \nBy default, the output image files are named **`data`**. "
      },
      "typeVersion": 1
    },
    {
      "id": "1024a4b1-eecb-4fbd-8740-5ce45f238df0",
      "name": "付箋1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        180
      ],
      "parameters": {
        "color": 4,
        "width": 280,
        "height": 1160,
        "content": "### Input Image  \n\nThe **Replace Background** node can be substituted with any service that provides an input image URL along with a description of the desired background.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nYou can either use the **Form node** to manually enter image URLs for background removal, or connect nodes to any data source that provides image links, for example:\n\n- SQLite, MySQL, PostgreSQL, and other databases  \n- Google Drive, Dropbox, OneDrive, Box, and similar storage services  \n- S3 object storage, FTP servers, or WebDAV  \n- Airtable, Notion, Coda, or Smartsheet  \n- Google Sheets, Excel Online, or CSV files  \n- CRM systems like HubSpot, Pipedrive, or Salesforce  \n- CMS platforms like WordPress, Strapi, or Contentful  \n- Or virtually any other service that supplies image URLs"
      },
      "typeVersion": 1
    },
    {
      "id": "daaec5d9-342d-4f2f-85d2-0ca1a072dd4c",
      "name": "画像ダウンロード",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        700,
        380
      ],
      "parameters": {
        "url": "={{ $json.data.url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "3f76cef0-807e-42e7-9a6f-4d078e86aada",
      "name": "APImage API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        400,
        380
      ],
      "parameters": {
        "url": "https://apimage.org/api/ai-replace-background",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "image_url",
              "value": "={{ $json[\"Image URL\"] }}"
            },
            {
              "name": "background_prompt",
              "value": "={{ $json[\"Background Description\"] }}"
            },
            {
              "name": "preserve_subject",
              "value": "0.8"
            },
            {
              "name": "light_direction",
              "value": "above"
            },
            {
              "name": "light_strength",
              "value": "0.6"
            },
            {
              "name": "output_format",
              "value": "png"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_KEY_HERE"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ad8c0911-3d2b-4acb-ad4c-8b96e556e0d0",
      "name": "付箋3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        180
      ],
      "parameters": {
        "color": 4,
        "width": 280,
        "height": 460,
        "content": "### Replace + Relight Background\n\nThis is where the image processing happens. **APImage** removes the original background, applies the new one, and optimizes the overall lighting for a natural look.  \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nOpen the **APImage API** node above and replace \"_YOUR_API_KEY_\" with your API Key. [Get your API Key here 🡥](https://apimage.org/dashboard) \n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ad068051-dcbe-49f9-8345-f42f1edc754c",
      "name": "付箋4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        600,
        180
      ],
      "parameters": {
        "color": 4,
        "width": 300,
        "height": 460,
        "content": "### Download Image  \n\nThis step downloads the processed image and makes it available for storage, sharing, or further processing.  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "07ef7110-3d9e-4773-96f2-6f6c2143a012",
      "name": "付箋5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        660
      ],
      "parameters": {
        "width": 600,
        "height": 680,
        "content": "### Fequently Asked Questions \n\n**Q: How is background replacement different from background removal?**  \nA: Background removal makes the background transparent, while background replacement swaps it with a new one and adjusts lighting for a natural look.\n\n**Q: What types of images are supported?**  \nA: APImage works with standard image formats such as JPG, PNG, and WebP.  \n\n**Q: Can I choose a custom background?**  \nA: Yes. You can provide a description of the desired background, or integrate APImage into workflows that supply predefined background images.  \n\n**Q: What is the default filename for processed images?**  \nA: The default filename is **`data`**, unless you rename the file in your workflow.  \n\n**Q: Do I need to store the images locally?**  \nA: No. You can connect APImage to any supported service (databases, cloud storage, CMS platforms, APIs, etc.) and store images directly.  \n\n**Q: Can APImage be used in automated workflows?**  \nA: Absolutely. It integrates with n8n and can process images automatically from sources like databases, cloud storage, or APIs.  \n\n**Q: Does it also enhance image quality?**  \nA: APImage adjusts lighting and contrast to make background replacements look natural, but it does not perform full image upscaling.  \n\n**Q: Is there a limit to the number of images I can process?**  \nA: Processing limits depend on your subscription plan and allocated credits.  \n\n\n\n[APImage API Reference 🡥](https://apimage.org/docs/api) | [APImage Customer Support 🡥](https://apimage.org/support) | [Get your API Key 🡥](https://apimage.org/dashboard)"
      },
      "typeVersion": 1
    },
    {
      "id": "3d8afd28-2752-4145-bfdf-29c64e59af3b",
      "name": "背景置換(ノード交換可)",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        80,
        380
      ],
      "webhookId": "b7487db2-4581-4fd6-b4e0-afac3d8466fb",
      "parameters": {
        "options": {},
        "formTitle": "APImage Replace Background",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Image URL",
              "placeholder": "https://example.com/product-image.png",
              "requiredField": true
            },
            {
              "fieldLabel": "Background Description",
              "placeholder": "a modern office with natural lighting",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Replaces the background of images"
      },
      "typeVersion": 2.2
    },
    {
      "id": "2f066144-49d7-4f26-8278-fc778e4f37d4",
      "name": "出力画像保存(ノード交換可)",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1020,
        380
      ],
      "parameters": {
        "name": "data",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "typeVersion": 3
    }
  ],
  "pinData": {},
  "connections": {
    "3f76cef0-807e-42e7-9a6f-4d078e86aada": {
      "main": [
        [
          {
            "node": "daaec5d9-342d-4f2f-85d2-0ca1a072dd4c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "daaec5d9-342d-4f2f-85d2-0ca1a072dd4c": {
      "main": [
        [
          {
            "node": "2f066144-49d7-4f26-8278-fc778e4f37d4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3d8afd28-2752-4145-bfdf-29c64e59af3b": {
      "main": [
        [
          {
            "node": "3f76cef0-807e-42e7-9a6f-4d078e86aada",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

中級 - その他, マルチモーダルAI

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

関連ワークフロー

Google Drive に AI 画像を生成してアップロードする
APImageを使用してAI画像を生成し、Googleドライブにアップロードします
Form Trigger
Google Drive
Http Request
+
Form Trigger
Google Drive
Http Request
8 ノードGegenfeld
コンテンツ作成
画像生成と人間の審査を使用して LinkedIn および Facebook 向けに AI 駆動型ソーシャルメディアコンテンツを作成
画像生成と人間の審査を使用して LinkedIn と Facebook 向けの AI 駆動のソーシャルメディアコンテンツを作成
If
Set
Slack
+
If
Set
Slack
63 ノードDidac Fernandez
その他
TikTokの動画を署名なしでGoogle Driveにダウンロードし、テーブルに自動記録
TikTokの動画を無 watermark 版でGoogleドライブにダウンロードし、自動のにテーブルにログを記録
If
Wait
Form Trigger
+
If
Wait
Form Trigger
19 ノードEvoort Solutions
コンテンツ作成
Instagram動画をフォームトリガーでGoogle Driveにダウンロードし、テーブルに記録
Instagram動画をフォームトリガーでGoogle Driveへダウンロードし、そしてテーブルへ記録
If
Wait
Form Trigger
+
If
Wait
Form Trigger
19 ノードEvoort Solutions
その他
複数の参照画像から創造のな広告画像を生成
Seedream v4を使用して参照画像からInstagramとFacebook用に創造のな広告画像を生成
If
Set
Code
+
If
Set
Code
20 ノードDavide
その他
デモ - テンプレート共有 - 職務記述書から候補者候補リストの構築
AI採用ワークフロー:ApolloとAirtableを使用して職務から候補者候補リストを作成
Set
Limit
Switch
+
Set
Limit
Switch
40 ノードFabian Herhold
その他
ワークフロー情報
難易度
中級
ノード数10
カテゴリー2
ノードタイプ4
難易度説明

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

作成者
Gegenfeld

Gegenfeld

@gegenfeld

We at Gegenfeld are an EdTech platform dedicated to delivering high-quality on-demand courses and interactive training sessions for professional development at all skill levels. With our commitment to "Accelerate your future," we empower professionals to enhance their expertise through engaging, industry-focused learning experiences. On n8n, we share some of the workflows used in our interactive training to provide deeper insights and practical applications.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34