black-forest-labs/flux-dev - ポートレートジェネレーター
中級
これはContent Creation, Multimodal AI分野の自動化ワークフローで、15個のノードを含みます。主にIf, Set, Code, Wait, HttpRequestなどのノードを使用。 Replicate を使って Black Forest Labs Flux Dev によるプロンプトからのカスタム画像生成
前提条件
- •ターゲットAPIの認証情報が必要な場合あり
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"meta": {
"instanceId": "c4bbf0a0-65a0-4ec3-bdc3-2e32912a6bbc",
"model_name": "flux-dev",
"model_type": "image",
"version_id": "6e4a938f85952bdabcc15aa329178c4d681c52bf25a0342403287dc26944661d",
"model_owner": "black-forest-labs",
"generated_at": "2025-08-01T14:47:17.088667"
},
"name": "black-forest-labs/flux-dev - Image Generator",
"nodes": [
{
"id": "c2c93e7f-c084-4806-a21c-4925e5f651da",
"name": "手動トリガー",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-896,
-176
],
"parameters": {},
"typeVersion": 1
},
{
"id": "a07d2255-d941-495e-9f21-c465a6c917ed",
"name": "API トークン設定",
"type": "n8n-nodes-base.set",
"position": [
-608,
-80
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "api_token",
"name": "api_token",
"type": "string",
"value": "YOUR_REPLICATE_API_TOKEN"
}
]
}
},
"typeVersion": 3.3
},
{
"id": "fed1eea8-482c-4755-a6e7-1cd547e1669e",
"name": "画像パラメータ設定",
"type": "n8n-nodes-base.set",
"position": [
-288,
-128
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "api_token",
"name": "api_token",
"type": "string",
"value": "={{ $('Set API Token').item.json.api_token }}"
},
{
"id": "seed",
"name": "seed",
"type": "number",
"value": -1
},
{
"id": "image",
"name": "image",
"type": "string",
"value": "https://picsum.photos/512/512"
},
{
"id": "prompt",
"name": "prompt",
"type": "string",
"value": "A beautiful landscape with mountains and a lake at sunset"
},
{
"id": "go_fast",
"name": "go_fast",
"type": "boolean",
"value": true
},
{
"id": "guidance",
"name": "guidance",
"type": "number",
"value": 3
},
{
"id": "megapixels",
"name": "megapixels",
"type": "string",
"value": "1"
},
{
"id": "num_outputs",
"name": "num_outputs",
"type": "number",
"value": 1
},
{
"id": "aspect_ratio",
"name": "aspect_ratio",
"type": "string",
"value": "1:1"
},
{
"id": "output_format",
"name": "output_format",
"type": "string",
"value": "webp"
},
{
"id": "output_quality",
"name": "output_quality",
"type": "number",
"value": 80
},
{
"id": "prompt_strength",
"name": "prompt_strength",
"type": "number",
"value": 0.8
},
{
"id": "num_inference_steps",
"name": "num_inference_steps",
"type": "number",
"value": 28
},
{
"id": "disable_safety_checker",
"name": "disable_safety_checker",
"type": "boolean",
"value": false
}
]
}
},
"typeVersion": 3.3
},
{
"id": "fc1128a6-32be-4542-aaa3-fdc6cffd88a7",
"name": "画像予測作成",
"type": "n8n-nodes-base.httpRequest",
"position": [
-64,
-128
],
"parameters": {
"url": "https://api.replicate.com/v1/predictions",
"method": "POST",
"options": {
"response": {
"response": {
"neverError": true,
"responseFormat": "json"
}
}
},
"jsonBody": "={\n \"version\": \"black-forest-labs/flux-dev:6e4a938f85952bdabcc15aa329178c4d681c52bf25a0342403287dc26944661d\",\n \"input\": {\n \"seed\": {{ $json.seed }},\n \"image\": \"{{ $json.image }}\",\n \"prompt\": \"{{ $json.prompt }}\",\n \"go_fast\": {{ $json.go_fast }},\n \"guidance\": {{ $json.guidance }},\n \"megapixels\": \"{{ $json.megapixels }}\",\n \"num_outputs\": {{ $json.num_outputs }},\n \"aspect_ratio\": \"{{ $json.aspect_ratio }}\",\n \"output_format\": \"{{ $json.output_format }}\",\n \"output_quality\": {{ $json.output_quality }},\n \"prompt_strength\": {{ $json.prompt_strength }},\n \"num_inference_steps\": {{ $json.num_inference_steps }},\n \"disable_safety_checker\": {{ $json.disable_safety_checker }}\n }\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "=Bearer {{ $json.api_token }}"
},
{
"name": "Prefer",
"value": "wait"
}
]
}
},
"typeVersion": 4.1
},
{
"id": "2e929752-3c41-41e5-8b7a-21a6cbb9a98b",
"name": "5秒待機",
"type": "n8n-nodes-base.wait",
"position": [
160,
-128
],
"webhookId": "d2c4ca16-0eb2-45b4-8a2d-eec2f99df89c",
"parameters": {
"unit": "seconds",
"amount": 5
},
"typeVersion": 1
},
{
"id": "bc5166c6-26c7-48cf-8193-aea503abe702",
"name": "ステータス確認",
"type": "n8n-nodes-base.httpRequest",
"position": [
384,
-128
],
"parameters": {
"url": "=https://api.replicate.com/v1/predictions/{{ $('Create Image Prediction').item.json.id }}",
"options": {
"response": {
"response": {
"neverError": true,
"responseFormat": "json"
}
}
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "=Bearer {{ $('Set API Token').item.json.api_token }}"
}
]
}
},
"typeVersion": 4.1
},
{
"id": "3e1756cb-42d3-42b4-ad52-22b81230f270",
"name": "完了?",
"type": "n8n-nodes-base.if",
"position": [
528,
-240
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "c93d7ba1-0ef9-4087-aa10-389cb2a2c6bd",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "succeeded"
}
]
}
},
"typeVersion": 2
},
{
"id": "adafa8ab-7708-4f40-8d5e-64e3ad363866",
"name": "失敗?",
"type": "n8n-nodes-base.if",
"position": [
848,
-80
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "d1bfd044-3a07-4c18-b55f-72d192596139",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "failed"
}
]
}
},
"typeVersion": 2
},
{
"id": "0fbc9f18-d70a-45b7-bc65-6b2fff5bcd63",
"name": "10秒待機",
"type": "n8n-nodes-base.wait",
"position": [
720,
128
],
"webhookId": "51a05aef-e220-406d-8c2c-e59c82c3e26e",
"parameters": {
"unit": "seconds",
"amount": 10
},
"typeVersion": 1
},
{
"id": "fd0a0eee-30c3-4553-a843-2fdd074015f0",
"name": "成功レスポンス",
"type": "n8n-nodes-base.set",
"position": [
832,
-320
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "success-response",
"name": "response",
"type": "object",
"value": "={{ { success: true, image_url: $json.output, prediction_id: $json.id, status: $json.status, message: 'Image generated successfully' } }}"
}
]
}
},
"typeVersion": 3.3
},
{
"id": "6ffc7fe0-96ea-4242-990d-f1cc6b8ea525",
"name": "エラーレスポンス",
"type": "n8n-nodes-base.set",
"position": [
1344,
144
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "error-response",
"name": "response",
"type": "object",
"value": "={{ { success: false, error: $json.error || 'Image generation failed', prediction_id: $json.id, status: $json.status, message: 'Failed to generate image' } }}"
}
]
}
},
"typeVersion": 3.3
},
{
"id": "df61ef75-b1dd-4619-949b-98f4855620cc",
"name": "結果表示",
"type": "n8n-nodes-base.set",
"position": [
1552,
-144
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "final-result",
"name": "final_result",
"type": "object",
"value": "={{ $json.response }}"
}
]
}
},
"typeVersion": 3.3
},
{
"id": "65aa8b16-cc33-4137-aed3-955cc0ebc0db",
"name": "リクエストログ",
"type": "n8n-nodes-base.code",
"position": [
160,
-320
],
"parameters": {
"jsCode": "// Log generation details for monitoring\nconst data = $input.all()[0].json;\n\nconsole.log('black-forest-labs/flux-dev Request:', {\n timestamp: new Date().toISOString(),\n prediction_id: data.id,\n model_type: 'image'\n});\n\nreturn $input.all();"
},
"typeVersion": 2
},
{
"id": "6c29ed3f-c269-4de9-bc4e-513833cbf14d",
"name": "付箋9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1536,
-304
],
"parameters": {
"color": 4,
"width": 580,
"height": 320,
"content": "=======================================\n FLUX-DEV GENERATOR\n=======================================\nFor any questions or support, please contact:\n Yaron@nofluff.online\n\nExplore more tips and tutorials here:\n - YouTube: https://www.youtube.com/@YaronBeen/videos\n - LinkedIn: https://www.linkedin.com/in/yaronbeen/\n======================================="
},
"typeVersion": 1
},
{
"id": "f0e50513-eca7-46da-929a-3a8cf672933c",
"name": "付箋4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1536,
48
],
"parameters": {
"color": 4,
"width": 589,
"height": 1958,
"content": "## 🤖 **BLACK-FOREST-LABS/FLUX-DEV - IMAGE GENERATION WORKFLOW**\n\n**🔥 Powered by Replicate API and n8n Automation**\n\n---\n\n### 📝 **Model Overview**\n\n- **Owner**: black-forest-labs\n- **Model**: flux-dev\n- **Type**: Image Generation\n- **API Endpoint**: https://api.replicate.com/v1/predictions\n\n**🎯 What This Model Does:**\nA 12 billion parameter rectified flow transformer capable of generating images from text descriptions\n\n---\n\n### 📋 **Parameter Reference**\n\n**🔴 Required Parameters:** prompt\n**🔵 Optional Parameters:** seed, image, go_fast, guidance, megapixels, num_outputs, aspect_ratio, output_format (and 4 more)\n\n**📖 Detailed Parameter Guide:**\n- **seed** (integer): Random seed. Set for reproducible generation\n- **image** (string): Input image for image to image mode. The aspect ratio of your output will match this image\n- **prompt** (string): Prompt for generated image\n- **go_fast** (boolean): Run faster predictions with model optimized for speed (currently fp8 quantized); disable to run i... (Default: True)\n- **guidance** (number): Guidance for generated image (Default: 3)\n- **megapixels** (string): Approximate number of megapixels for generated image (Default: 1)\n- **num_outputs** (integer): Number of outputs to generate (Default: 1)\n- **aspect_ratio** (string): Aspect ratio for the generated image (Default: 1:1)\n- *...and 5 more parameters*\n\n---\n\n### 🔧 **Workflow Components Explained**\n\n**🎯 Manual Trigger**\n- Starts the workflow execution\n- Click to begin image generation process\n\n**🔐 Set API Token** \n- Configures your Replicate API authentication\n- Replace 'YOUR_REPLICATE_API_TOKEN' with your actual token\n- Essential for accessing the black-forest-labs/flux-dev model\n\n**⚙️ Set Image Parameters**\n- Configures all input parameters for the model\n- Includes both required and optional parameters\n- Pre-filled with sensible defaults for testing\n\n**🚀 Create Image Prediction**\n- Sends the generation request to Replicate API\n- Uses the image parameters you configured\n- Returns a prediction ID for status tracking\n\n**⏳ Wait & Status Checking Loop**\n- Waits 5 seconds then checks prediction status\n- Continues checking until completion or failure\n- Implements intelligent retry logic with 10-second delays\n\n**✅ Success/Error Handling**\n- Routes successful completions to success response\n- Handles failures gracefully with error details\n- Returns structured JSON response with URLs/errors\n\n**📊 Logging & Monitoring**\n- Logs all requests for debugging and monitoring\n- Tracks timestamps and prediction IDs\n- Helps identify issues during development\n\n---\n\n### 🌟 **Key Benefits**\n\n- **🎨 Instant Image Generation**: Transform ideas into images using state-of-the-art AI\n- **🔄 Automated Workflow**: Handles the complete generation pipeline automatically\n- **🛡️ Error Resilience**: Built-in retry logic and comprehensive error handling\n- **📈 Production Ready**: Includes logging, monitoring, and structured responses\n- **🔧 Customizable**: Easy to modify parameters and extend functionality\n- **⚡ Efficient Processing**: Optimized API calls with intelligent status checking\n\n---\n\n### 🚀 **Quick Start Instructions**\n\n1. **🔑 Get Your API Key**\n - Sign up at https://replicate.com\n - Navigate to your account settings\n - Copy your API token\n\n2. **🔧 Configure the Workflow**\n - Replace 'YOUR_REPLICATE_API_TOKEN' with your actual token\n - Adjust parameters in the 'Set Image Parameters' node\n - Customize the prompt or other inputs as needed\n\n3. **▶️ Execute the Workflow**\n - Click the 'Manual Trigger' to start\n - Monitor the execution in the n8n interface\n - Check logs for detailed execution information\n\n4. **📥 Get Your Results**\n - Successful generations return a URL to your image\n - Download or use the generated content as needed\n - Results are available immediately upon completion\n\n---\n\n### 🔍 **Troubleshooting Guide**\n\n**Common Issues:**\n- **Invalid API Token**: Ensure your Replicate token is valid and has sufficient credits\n- **Parameter Validation**: Check that required parameters match expected types\n- **Generation Timeout**: Some images take longer - monitor the logs\n- **Output Format**: Verify the model returns the expected output format\n\n**Best Practices:**\n- Test with default parameters first\n- Monitor your Replicate usage and billing\n- Keep API tokens secure and never commit them to code\n- Use appropriate parameter values for your use case\n\n---\n\n**🔗 Additional Resources:**\n- Model Documentation: https://replicate.com/black-forest-labs/flux-dev\n- Replicate API Docs: https://replicate.com/docs\n- n8n Documentation: https://docs.n8n.io\n\n---"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"versionId": "1",
"connections": {
"2e929752-3c41-41e5-8b7a-21a6cbb9a98b": {
"main": [
[
{
"node": "bc5166c6-26c7-48cf-8193-aea503abe702",
"type": "main",
"index": 0
}
]
]
},
"0fbc9f18-d70a-45b7-bc65-6b2fff5bcd63": {
"main": [
[
{
"node": "bc5166c6-26c7-48cf-8193-aea503abe702",
"type": "main",
"index": 0
}
]
]
},
"adafa8ab-7708-4f40-8d5e-64e3ad363866": {
"main": [
[
{
"node": "6ffc7fe0-96ea-4242-990d-f1cc6b8ea525",
"type": "main",
"index": 0
}
],
[
{
"node": "0fbc9f18-d70a-45b7-bc65-6b2fff5bcd63",
"type": "main",
"index": 0
}
]
]
},
"65aa8b16-cc33-4137-aed3-955cc0ebc0db": {
"main": [
[
{
"node": "2e929752-3c41-41e5-8b7a-21a6cbb9a98b",
"type": "main",
"index": 0
}
]
]
},
"bc5166c6-26c7-48cf-8193-aea503abe702": {
"main": [
[
{
"node": "3e1756cb-42d3-42b4-ad52-22b81230f270",
"type": "main",
"index": 0
}
]
]
},
"3e1756cb-42d3-42b4-ad52-22b81230f270": {
"main": [
[
{
"node": "fd0a0eee-30c3-4553-a843-2fdd074015f0",
"type": "main",
"index": 0
}
],
[
{
"node": "adafa8ab-7708-4f40-8d5e-64e3ad363866",
"type": "main",
"index": 0
}
]
]
},
"a07d2255-d941-495e-9f21-c465a6c917ed": {
"main": [
[
{
"node": "fed1eea8-482c-4755-a6e7-1cd547e1669e",
"type": "main",
"index": 0
}
]
]
},
"6ffc7fe0-96ea-4242-990d-f1cc6b8ea525": {
"main": [
[
{
"node": "df61ef75-b1dd-4619-949b-98f4855620cc",
"type": "main",
"index": 0
}
]
]
},
"c2c93e7f-c084-4806-a21c-4925e5f651da": {
"main": [
[
{
"node": "a07d2255-d941-495e-9f21-c465a6c917ed",
"type": "main",
"index": 0
}
]
]
},
"fd0a0eee-30c3-4553-a843-2fdd074015f0": {
"main": [
[
{
"node": "df61ef75-b1dd-4619-949b-98f4855620cc",
"type": "main",
"index": 0
}
]
]
},
"fed1eea8-482c-4755-a6e7-1cd547e1669e": {
"main": [
[
{
"node": "fc1128a6-32be-4542-aaa3-fdc6cffd88a7",
"type": "main",
"index": 0
}
]
]
},
"fc1128a6-32be-4542-aaa3-fdc6cffd88a7": {
"main": [
[
{
"node": "65aa8b16-cc33-4137-aed3-955cc0ebc0db",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
中級 - コンテンツ作成, マルチモーダルAI
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
ByteDance/Seedream-3 - ポートレートジェネレーター
字节跳动 Seedream 3:テキストから画像への変換テンプレート
If
Set
Code
+
If
Set
Code
15 ノードYaron Been
コンテンツ作成
Dessix Moss Ttsd テキストジェネレーター
会話スクリプトを自然な音声に変換するReplicate Moss-TTSDの使用
If
Set
Code
+
If
Set
Code
9 ノードYaron Been
コンテンツ作成
ibm-granite/granite-speech-3.3-8b - テキストジェネレーター
IBM Granite 3.3 8BモデルをReplicate API経由で音声をテキストに変換する
If
Set
Code
+
If
Set
Code
15 ノードYaron Been
コンテンツ作成
moicarmonas/2ndmoises_generator - その他のジェネレーター
テキストプロンプトを使って2nd MoisesジェネレータとReplicateで画像を作成
If
Set
Code
+
If
Set
Code
15 ノードYaron Been
コンテンツ作成
moicarmonas/3rdmoises_generator_oldversion - その他のジェネレーター
テキストプロンプトを使って3rd MoisesジェネレータとReplicateで画像を作成
If
Set
Code
+
If
Set
Code
15 ノードYaron Been
コンテンツ作成
alitas126/alitas2 - その他のジェネレーター
テキストプロンプトを使ってAlitas2モデルとReplicateで画像を作成
If
Set
Code
+
If
Set
Code
15 ノードYaron Been
コンテンツ作成
ワークフロー情報
難易度
中級
ノード数15
カテゴリー2
ノードタイプ7
作成者
Yaron Been
@yaron-nofluffBuilding AI Agents and Automations | Growth Marketer | Entrepreneur | Book Author & Podcast Host If you need any help with Automations, feel free to reach out via linkedin: https://www.linkedin.com/in/yaronbeen/ And check out my Youtube channel: https://www.youtube.com/@YaronBeen/videos
外部リンク
n8n.ioで表示 →
このワークフローを共有