
stability-ai/stable-video-diffusion - Video Generator
ๆ่ฟฐ
ๅ็ฑป
๐ค AI & Machine Learning
ไฝฟ็จ็่็น
n8n-nodes-base.ifn8n-nodes-base.ifn8n-nodes-base.setn8n-nodes-base.setn8n-nodes-base.setn8n-nodes-base.setn8n-nodes-base.setn8n-nodes-base.coden8n-nodes-base.waitn8n-nodes-base.wait
ไปทๆ ผๅ
่ดน
ๆต่ง้0
ๆๅๆดๆฐ11/28/2025
workflow.json
{
"meta": {
"instanceId": "60a7aeee-a1a7-4865-b402-78f69625bd6d",
"model_name": "stable-video-diffusion",
"model_type": "video",
"version_id": "3f0457e4619daac51203dedb472816fd4af51f3149fa7a9e0b5ffcf1b8172438",
"model_owner": "stability-ai",
"generated_at": "2025-08-01T14:47:17.115720"
},
"name": "stability-ai/stable-video-diffusion - Video Generator",
"nodes": [
{
"id": "985051af-1e1d-4b8a-9be6-2c750fa56ad6",
"name": "Manual Trigger",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-896,
-176
],
"parameters": {},
"typeVersion": 1
},
{
"id": "e0b1b71a-ef28-4c4b-b4d6-07b43d277c56",
"name": "Set API Token",
"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": "327ba78d-a3e8-4fcf-a29f-50fe5e8f3806",
"name": "Set Video Parameters",
"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": "cond_aug",
"name": "cond_aug",
"type": "number",
"value": 0.02
},
{
"id": "decoding_t",
"name": "decoding_t",
"type": "number",
"value": 14
},
{
"id": "input_image",
"name": "input_image",
"type": "string",
"value": "https://picsum.photos/512/512"
},
{
"id": "video_length",
"name": "video_length",
"type": "string",
"value": "14_frames_with_svd"
},
{
"id": "sizing_strategy",
"name": "sizing_strategy",
"type": "string",
"value": "maintain_aspect_ratio"
},
{
"id": "motion_bucket_id",
"name": "motion_bucket_id",
"type": "number",
"value": 127
},
{
"id": "frames_per_second",
"name": "frames_per_second",
"type": "number",
"value": 6
}
]
}
},
"typeVersion": 3.3
},
{
"id": "dbfff024-ee5d-4044-a047-174f2538e48f",
"name": "Create Video Prediction",
"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\": \"stability-ai/stable-video-diffusion:3f0457e4619daac51203dedb472816fd4af51f3149fa7a9e0b5ffcf1b8172438\",\n \"input\": {\n \"seed\": {{ $json.seed }},\n \"cond_aug\": {{ $json.cond_aug }},\n \"decoding_t\": {{ $json.decoding_t }},\n \"input_image\": \"{{ $json.input_image }}\",\n \"video_length\": \"{{ $json.video_length }}\",\n \"sizing_strategy\": \"{{ $json.sizing_strategy }}\",\n \"motion_bucket_id\": {{ $json.motion_bucket_id }},\n \"frames_per_second\": {{ $json.frames_per_second }}\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": "ff91c9cf-a95d-4ada-ae15-c8ce93acbc1a",
"name": "Wait 5s",
"type": "n8n-nodes-base.wait",
"position": [
160,
-128
],
"webhookId": "d2c4ca16-0eb2-45b4-8a2d-eec2f99df89c",
"parameters": {
"unit": "seconds",
"amount": 5
},
"typeVersion": 1
},
{
"id": "ddb82764-6bce-4dca-af67-aad90502646e",
"name": "Check Status",
"type": "n8n-nodes-base.httpRequest",
"position": [
384,
-128
],
"parameters": {
"url": "=https://api.replicate.com/v1/predictions/{{ $('Create Video 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": "7f46eb9a-1885-42d4-ac85-ea4e87e1dcc3",
"name": "Is Complete?",
"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": "bc4c4c38-a5de-4dd1-9ad1-e4de0a79a480",
"name": "Has Failed?",
"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": "1821bfec-8794-4827-861c-3aeb756f6d42",
"name": "Wait 10s",
"type": "n8n-nodes-base.wait",
"position": [
720,
128
],
"webhookId": "51a05aef-e220-406d-8c2c-e59c82c3e26e",
"parameters": {
"unit": "seconds",
"amount": 10
},
"typeVersion": 1
},
{
"id": "fd363ae1-dfed-43cf-b0a1-70ee412db8eb",
"name": "Success Response",
"type": "n8n-nodes-base.set",
"position": [
832,
-320
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "success-response",
"name": "response",
"type": "object",
"value": "={{ { success: true, video_url: $json.output, prediction_id: $json.id, status: $json.status, message: 'Video generated successfully' } }}"
}
]
}
},
"typeVersion": 3.3
},
{
"id": "16ed2125-a872-4f44-8982-531f25b73dca",
"name": "Error Response",
"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 || 'Video generation failed', prediction_id: $json.id, status: $json.status, message: 'Failed to generate video' } }}"
}
]
}
},
"typeVersion": 3.3
},
{
"id": "9cf9c7cb-fe1d-49f9-a27f-37dc7afbe845",
"name": "Display Result",
"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": "e5029c91-3b72-4202-9b4a-17c14fb16eca",
"name": "Log Request",
"type": "n8n-nodes-base.code",
"position": [
160,
-320
],
"parameters": {
"jsCode": "// Log generation details for monitoring\nconst data = $input.all()[0].json;\n\nconsole.log('stability-ai/stable-video-diffusion Request:', {\n timestamp: new Date().toISOString(),\n prediction_id: data.id,\n model_type: 'video'\n});\n\nreturn $input.all();"
},
"typeVersion": 2
},
{
"id": "1e5be55b-9a84-4a7b-a81c-dec3ce62b092",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1536,
-304
],
"parameters": {
"color": 4,
"width": 580,
"height": 320,
"content": "=======================================\n STABLE-VIDEO-DIFFUSION GENERATOR\n=======================================\nFor any questions or support, please contact:\n [email protected]\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": "aef3de72-a694-4a01-baae-78357c8afdda",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1536,
48
],
"parameters": {
"color": 4,
"width": 589,
"height": 1958,
"content": "## ๐ค **STABILITY-AI/STABLE-VIDEO-DIFFUSION - VIDEO GENERATION WORKFLOW**\n\n**๐ฅ Powered by Replicate API and n8n Automation**\n\n---\n\n### ๐ **Model Overview**\n\n- **Owner**: stability-ai\n- **Model**: stable-video-diffusion\n- **Type**: Video Generation\n- **API Endpoint**: https://api.replicate.com/v1/predictions\n\n**๐ฏ What This Model Does:**\nSVD is a research-only image to video model\n\n---\n\n### ๐ **Parameter Reference**\n\n**๐ด Required Parameters:** input_image\n**๐ต Optional Parameters:** seed, cond_aug, decoding_t, video_length, sizing_strategy, motion_bucket_id, frames_per_second\n\n**๐ Detailed Parameter Guide:**\n- **seed** (integer): Random seed. Leave blank to randomize the seed\n- **cond_aug** (number): Amount of noise to add to input image (Default: 0.02)\n- **decoding_t** (integer): Number of frames to decode at a time (Default: 14)\n- **input_image** (string): Input image\n- **video_length** (string): Use svd to generate 14 frames or svd_xt for 25 frames (Default: 14_frames_with_svd)\n- **sizing_strategy** (string): Decide how to resize the input image (Default: maintain_aspect_ratio)\n- **motion_bucket_id** (integer): Increase overall motion in the generated video (Default: 127)\n- **frames_per_second** (integer): Frames per second (Default: 6)\n\n---\n\n### ๐ง **Workflow Components Explained**\n\n**๐ฏ Manual Trigger**\n- Starts the workflow execution\n- Click to begin video 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 stability-ai/stable-video-diffusion model\n\n**โ๏ธ Set Video 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 Video Prediction**\n- Sends the generation request to Replicate API\n- Uses the video 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 Video Generation**: Transform ideas into videos 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 Video 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 video\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 videos 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/stability-ai/stable-video-diffusion\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": {
"Wait 5s": {
"main": [
[
{
"node": "Check Status",
"type": "main",
"index": 0
}
]
]
},
"Wait 10s": {
"main": [
[
{
"node": "Check Status",
"type": "main",
"index": 0
}
]
]
},
"Has Failed?": {
"main": [
[
{
"node": "Error Response",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait 10s",
"type": "main",
"index": 0
}
]
]
},
"Log Request": {
"main": [
[
{
"node": "Wait 5s",
"type": "main",
"index": 0
}
]
]
},
"Check Status": {
"main": [
[
{
"node": "Is Complete?",
"type": "main",
"index": 0
}
]
]
},
"Is Complete?": {
"main": [
[
{
"node": "Success Response",
"type": "main",
"index": 0
}
],
[
{
"node": "Has Failed?",
"type": "main",
"index": 0
}
]
]
},
"Set API Token": {
"main": [
[
{
"node": "Set Video Parameters",
"type": "main",
"index": 0
}
]
]
},
"Error Response": {
"main": [
[
{
"node": "Display Result",
"type": "main",
"index": 0
}
]
]
},
"Manual Trigger": {
"main": [
[
{
"node": "Set API Token",
"type": "main",
"index": 0
}
]
]
},
"Success Response": {
"main": [
[
{
"node": "Display Result",
"type": "main",
"index": 0
}
]
]
},
"Create Video Prediction": {
"main": [
[
{
"node": "Log Request",
"type": "main",
"index": 0
}
]
]
}
}
}