Remplacer et éclairer automatiquement l'arrière-plan de n'importe quelle image avec APImage
Ceci est unMiscellaneous, Multimodal AIworkflow d'automatisation du domainecontenant 10 nœuds.Utilise principalement des nœuds comme FormTrigger, GoogleDrive, HttpRequest. Remplacer et rééclairer automatiquement l'arrière-plan de n'importe quelle image avec APImage
- •Informations d'identification Google Drive API
- •Peut nécessiter les informations d'identification d'authentification de l'API cible
Nœuds utilisés (10)
Catégorie
{
"meta": {
"instanceId": "47d295a7329d3547e0e6b56de9e439dc1a0a49c6d827b2320629f54300c47e41"
},
"nodes": [
{
"id": "15ab6203-2c77-45ac-b5dd-79f404e090fa",
"name": "Note adhésive",
"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": "Note adhésive2",
"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": "Note adhésive1",
"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": "Télécharger l'image",
"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": "Note adhésive3",
"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": "Note adhésive4",
"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": "Note adhésive5",
"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": "Remplacer le fond (node can be exchanged)",
"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": "Stocker l'image de sortie (node can be exchanged)",
"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
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Intermédiaire - Divers, IA Multimodale
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
Gegenfeld
@gegenfeldWe 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.
Partager ce workflow