Sora 2 API를 사용하여 바이러스 비디오 생성
중급
이것은Content Creation, Multimodal AI분야의자동화 워크플로우로, 11개의 노드를 포함합니다.주로 If, Set, Code, Wait, FormTrigger 등의 노드를 사용하며. Sora 2 AI를 사용하여 마케팅과 콘텐츠 제작에 소셜 미디어 비디오 만들기
사전 요구사항
- •대상 API의 인증 정보가 필요할 수 있음
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
"id": "hnQkgo39M1YbV8JR",
"meta": {
"instanceId": "8dc97f110c3d1c4c1312bf2ee1e5a9845338284bdb271e93c73c8939c0887ef7"
},
"name": "Generate Viral Video Using Sora 2 API",
"tags": [],
"nodes": [
{
"id": "b120b3de-3959-4ac9-b57d-e69dcb3ea216",
"name": "고정 메모3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1104,
16
],
"parameters": {
"color": 3,
"width": 780,
"height": 1016,
"content": "# Generate Viral Video Using Sora 2 API\n\n## Overview\nThis workflow utilizes the Defapi API with **Sora 2 AI** model to generate stunning **viral videos** with creative AI-generated motion, effects, and storytelling. Simply provide a creative prompt describing your desired video scene, and optionally upload an image as a reference. The AI generates professional-quality video content perfect for tiktok, youtube, marketing campaigns, and creative projects.\n\n**Input:** Creative prompt (required) + optional image \n**Output:** AI-generated viral video ready for social media and content marketing\n\nUsers can interact through a simple form, providing a text prompt describing the desired video scene and optionally uploading an image for context. The system automatically submits the request to the Defapi Sora 2 API, monitors the generation status in real time, and retrieves the final video output. This solution is ideal for content creators, social media marketers, video producers, and businesses who want to quickly generate engaging video content with minimal setup.\n\n## Prerequisites\n- A Defapi account and API key: Sign up at [Defapi.org](https://defapi.org) to obtain your API key for Sora 2 access.\n- An active n8n instance (cloud or self-hosted) with HTTP Request and form submission capabilities.\n- Basic knowledge of AI prompts for video generation to achieve optimal results.\n - Example prompt: A pack of dogs driving tiny cars in a high-speed chase through a city, wearing sunglasses and honking their horns, with dramatic action music and slow-motion jumps over fire hydrants.\n - For 15-second HD videos, prefix your prompt with `(15s,hd)`.\n- (Optional) An image to use as a reference or starting point for video generation.\n - **Image Restrictions**: Avoid uploading images with real people or highly realistic human faces, as they will be rejected during content review.\n- **Important Notes**: \n - The API requires proper authentication via Bearer token for all requests.\n - Content undergoes multi-stage moderation. Avoid violence, adult content, copyrighted material, and living celebrities in both prompts and images.\n\n## Setup Instructions\n1. **Obtain API Key**: Register at Defapi.org and generate your API key with Sora 2 access. Store it securely—do not share it publicly.\n2. **Configure Credentials**: In n8n, create HTTP Bearer Auth credentials named \"Defapi account\" with your API key.\n3. **Configure the Form**: In the \"Upload Image\" form trigger node, ensure the following fields are set up:\n - **Prompt** (text field, required) - Describe the video scene you want to generate\n - **Image** (file upload, optional) - Optionally upload .jpg, .png, or .webp image files as reference\n4. **Test the Workflow**:\n - Click \"Execute Workflow\" in n8n to activate the form trigger.\n - Access the generated form URL and enter your creative video prompt. Optionally upload an image for additional context.\n - The workflow will process any uploaded image through the \"Convert to JSON\" node, converting it to base64 format.\n - The request is sent to the Sora 2 API endpoint at Defapi.org.\n - The system will wait 10 seconds and then poll the API status until video generation is complete.\n5. **Handle Outputs**: The final \"Format and Display Results\" node formats and displays the generated video URL for download or embedding.\n\n## Workflow Structure\nThe workflow consists of the following nodes:\n1. **Upload Image** (Form Trigger) - Collects user input: creative prompt (required) and optional image file\n2. **Convert to JSON** (Code Node) - Converts any uploaded image to base64 data URI and formats prompt\n3. **Send Sora 2 Generation Request to Defapi.org API** (HTTP Request) - Submits video generation request to Sora 2 API\n4. **Wait for Processing Completion** (Wait Node) - Waits 10 seconds before checking status\n5. **Obtain the generated status** (HTTP Request) - Polls API task query endpoint for completion status\n6. **Check if Image Generation is Complete** (IF Node) - Checks if status equals 'success'\n7. **Format and Display Results** (Set Node) - Extracts and formats final video URL output\n\n## Technical Details\n- **API Endpoint**: `https://api.defapi.org/api/sora2/gen` (POST request)\n- **Model Used**: Sora 2 AI video generation model\n- **Video Capabilities**: Supports 15-second videos and high-definition (HD) output\n- **Status Check Endpoint**: `https://api.defapi.org/api/task/query` (GET request)\n- **Wait Time**: 10 seconds between status checks\n- **Image Processing**: If an image is uploaded, it is converted to base64 data URI format (`data:image/[type];base64,[data]`) for API submission\n- **Authentication**: Bearer token authentication using the configured Defapi account credentials\n- **Request Body Format**:\n ```json\n {\n \"prompt\": \"Your video description here\",\n \"images\": [\"data:image/jpeg;base64,...\"]\n }\n ```\n Note: The `images` array can contain an image or be empty if no image is provided\n- **Response Format**: The API returns a task_id which is used to poll for completion status. Final result contains `data.result.video` with the video URL.\n- **Accepted Image Formats**: .jpg, .png, .webp\n- **Specialized For**: Viral video content, social media videos, creative video marketing\n\n## Customization Tips\n- **Enhance Prompts**: Include specifics like:\n - Scene description and action sequences\n - Character behaviors and emotions\n - Camera movements and angles (e.g., slow-motion, dramatic zoom)\n - Audio/music style (e.g., dramatic, upbeat, cinematic)\n - Visual effects and atmosphere\n - Timing and pacing details\n- **Enable 15s and HD Output**: To generate 15-second high-definition videos, start your prompt with `(15s,hd)`. For example: `(15s,hd) A pack of dogs driving tiny cars in a high-speed chase through a city...`\n\n## Content Moderation\n\nThe API implements a three-stage content review process:\n\n1. **Image Review**: Rejects images with real people or highly realistic human faces\n2. **Prompt Filtering**: Checks for violence, adult content, copyrighted material, and living celebrities\n3. **Output Review**: Final check after generation (often causes failures at 90%+ completion)\n\n**Best Practices:**\n- Avoid real human photos; use illustrations or cartoons instead\n- Keep prompts generic; avoid brand names and celebrity names\n- You can reference verified Sora accounts (e.g., \"let @sama dance\")\n- If generation fails at 90%+, simplify your prompt and try again\n\n## Example Prompts\n- \"A pack of dogs driving tiny cars in a high-speed chase through a city, wearing sunglasses and honking their horns, with dramatic action music and slow-motion jumps over fire hydrants.\"\n- \"(15s,hd) Animated fantasy landscape with floating islands, waterfalls cascading into clouds, magical creatures flying, golden sunset lighting, epic orchestral music.\"\n- \"(15s,hd) Product showcase with 360-degree rotation, dramatic lighting changes, particle effects, modern electronic background music.\"\n\n## Use Cases\n- **Social Media Content**: Generate eye-catching videos for Instagram Reels, TikTok, and YouTube Shorts\n- **Marketing Campaigns**: Create unique promotional videos from product images\n- **Creative Projects**: Transform static images into dynamic storytelling videos\n- **Content Marketing**: Produce engaging video content without expensive production costs\n- **Viral Content Creation**: Generate shareable, attention-grabbing videos for maximum engagement\n\n"
},
"typeVersion": 1
},
{
"id": "67dce728-a195-403b-9a53-e029adc6031a",
"name": "생성 상태 확인",
"type": "n8n-nodes-base.httpRequest",
"position": [
-16,
256
],
"parameters": {
"url": "https://api.defapi.org/api/task/query",
"options": {},
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth",
"queryParameters": {
"parameters": [
{
"name": "task_id",
"value": "={{$json.data.task_id}}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"credentials": {
"httpBearerAuth": {
"id": "uZqL4UNyrG73Kntx",
"name": "Defapi account"
}
},
"typeVersion": 4.2
},
{
"id": "e6193ed3-bde1-4ca5-ba5b-2b62c2106348",
"name": "고정 메모4",
"type": "n8n-nodes-base.stickyNote",
"position": [
288,
528
],
"parameters": {
"width": 416,
"height": 480,
"content": "## Result\n"
},
"typeVersion": 1
},
{
"id": "1c0ba59b-a0f1-4d7b-a9a8-dc415e6f0b14",
"name": "JSON로 변환",
"type": "n8n-nodes-base.code",
"position": [
-32,
32
],
"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 = {args: {}};\nconsole.log('----', $input.first());\n\nconst bin = $input.first().binary?.['Image'];\n\n// Push a new object to the results array.\nif (bin) {\n results.args.images = [`data:${bin.mimeType};base64,${bin.data}`]\n}\nresults.args.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": "5987c5d7-e3ee-45ac-808f-48bdfa444748",
"name": "고정 메모",
"type": "n8n-nodes-base.stickyNote",
"position": [
-304,
528
],
"parameters": {
"width": 544,
"height": 128,
"content": "## Example prompt\nA pack of dogs driving tiny cars in a high-speed chase through a city, wearing sunglasses and honking their horns, with dramatic action music and slow-motion jumps over fire hydrants."
},
"typeVersion": 1
},
{
"id": "8c98ae55-80b6-43aa-bd52-0ea3b78ebfb3",
"name": "결과 형식화 및 표시",
"type": "n8n-nodes-base.set",
"position": [
432,
320
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "fa5f375f-cddc-4f7b-a018-67c28015d18b",
"name": "image_url",
"type": "string",
"value": "={{$json.data.result.video}}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "2573c2b2-fed6-4ebd-8034-e87c6cc464c4",
"name": "Defapi.org로 Sora 2 생성 요청 전송 API",
"type": "n8n-nodes-base.httpRequest",
"position": [
192,
32
],
"parameters": {
"url": "https://api.defapi.org/api/sora2/gen",
"method": "POST",
"options": {},
"jsonBody": "={{ JSON.stringify($json.args, null, 2) }}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth"
},
"credentials": {
"httpBearerAuth": {
"id": "uZqL4UNyrG73Kntx",
"name": "Defapi account"
}
},
"typeVersion": 4.2
},
{
"id": "70d6346b-9ae3-42d9-8af6-66add1b1e3b3",
"name": "처리 완료 대기",
"type": "n8n-nodes-base.wait",
"position": [
-240,
320
],
"webhookId": "e1e38844-d037-40bd-b420-0c89e86348b5",
"parameters": {
"amount": 10
},
"typeVersion": 1.1
},
{
"id": "7b882afa-5fa9-4188-b225-77c77f506cf5",
"name": "고정 메모1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-304,
672
],
"parameters": {
"width": 544,
"height": 352,
"content": "\n## Content Moderation\n\nThe API implements a three-stage content review process:\n\n1. **Image Review**: Rejects images with real people or highly realistic human faces\n2. **Prompt Filtering**: Checks for violence, adult content, copyrighted material, and living celebrities\n3. **Output Review**: Final check after generation (often causes failures at 90%+ completion)\n\n**Best Practices:**\n- Avoid real human photos; use illustrations or cartoons instead\n- Keep prompts generic; avoid brand names and celebrity names\n- You can reference verified Sora accounts (e.g., \"let @sama dance\")\n- If generation fails at 90%+, simplify your prompt and try again"
},
"typeVersion": 1
},
{
"id": "d3932fe6-2a4a-468d-bf7e-8006e35b0625",
"name": "폼 제출 시",
"type": "n8n-nodes-base.formTrigger",
"position": [
-256,
32
],
"webhookId": "035fad50-e97c-4155-939d-c26c2545f743",
"parameters": {
"options": {},
"formTitle": "Upload Image",
"formFields": {
"values": [
{
"fieldLabel": "Prompt",
"requiredField": true
},
{
"fieldType": "file",
"fieldLabel": "Image",
"multipleFiles": false,
"acceptFileTypes": ".jpg,.png,.webp"
}
]
}
},
"typeVersion": 2.3
},
{
"id": "b0c9e335-8e5b-4904-a8d1-fcea76eeceeb",
"name": "생성 완료 여부 확인",
"type": "n8n-nodes-base.if",
"position": [
208,
320
],
"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
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "c0b1c92f-782e-4d36-a1ea-c7459e116c47",
"connections": {
"1c0ba59b-a0f1-4d7b-a9a8-dc415e6f0b14": {
"main": [
[
{
"node": "2573c2b2-fed6-4ebd-8034-e87c6cc464c4",
"type": "main",
"index": 0
}
]
]
},
"d3932fe6-2a4a-468d-bf7e-8006e35b0625": {
"main": [
[
{
"node": "1c0ba59b-a0f1-4d7b-a9a8-dc415e6f0b14",
"type": "main",
"index": 0
}
]
]
},
"67dce728-a195-403b-9a53-e029adc6031a": {
"main": [
[
{
"node": "b0c9e335-8e5b-4904-a8d1-fcea76eeceeb",
"type": "main",
"index": 0
}
]
]
},
"70d6346b-9ae3-42d9-8af6-66add1b1e3b3": {
"main": [
[
{
"node": "67dce728-a195-403b-9a53-e029adc6031a",
"type": "main",
"index": 0
}
]
]
},
"b0c9e335-8e5b-4904-a8d1-fcea76eeceeb": {
"main": [
[
{
"node": "8c98ae55-80b6-43aa-bd52-0ea3b78ebfb3",
"type": "main",
"index": 0
}
],
[
{
"node": "70d6346b-9ae3-42d9-8af6-66add1b1e3b3",
"type": "main",
"index": 0
}
]
]
},
"2573c2b2-fed6-4ebd-8034-e87c6cc464c4": {
"main": [
[
{
"node": "70d6346b-9ae3-42d9-8af6-66add1b1e3b3",
"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
콘텐츠 제작
## 설정 가이드
Gemini AI를 사용하여 레트로 포리스타일 사진 생성
If
Set
Code
+
If
Set
Code
13 노드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
기타