🎬 Create social media videos with Sora 2 AI for marketing & content creation

2,916 views · 🎬 Content Creation & Video

💡 Pro Tip — Since TikTok doesn’t have a public API, getting data usually means fragile HTTP scraping. ScraperNode is a community node that gives you clean JSON for TikTok profiles, videos, and comments — drop it into your workflow and skip the parsing.

View All Scrapers

Description

Overview

This 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.

Input: Creative prompt (required) + optional image
Output: AI-generated viral video ready for social media and content marketing

Users 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.

Prerequisites

Setup Instructions

  1. Obtain API Key: Register at Defapi.org and generate your API key with Sora 2 access. Store it securely—do not share it publicly.
  2. Configure Credentials: In n8n, create HTTP Bearer Auth credentials named “Defapi account” with your API key.
  3. Configure the Form: In the “Upload Image” form trigger node, ensure the following fields are set up:
    • Prompt (text field, required) - Describe the video scene you want to generate
    • Image (file upload, optional) - Optionally upload .jpg, .png, or .webp image files as reference
  4. Test the Workflow:
    • Click “Execute Workflow” in n8n to activate the form trigger.
    • Access the generated form URL and enter your creative video prompt. Optionally upload an image for additional context.
    • The workflow will process any uploaded image through the “Convert to JSON” node, converting it to base64 format.
    • The request is sent to the Sora 2 API endpoint at Defapi.org.
    • The system will wait 10 seconds and then poll the API status until video generation is complete.
  5. Handle Outputs: The final “Format and Display Results” node formats and displays the generated video URL for download or embedding.

Workflow Structure

The workflow consists of the following nodes:

  1. Upload Image (Form Trigger) - Collects user input: creative prompt (required) and optional image file
  2. Convert to JSON (Code Node) - Converts any uploaded image to base64 data URI and formats prompt
  3. Send Sora 2 Generation Request to Defapi.org API (HTTP Request) - Submits video generation request to Sora 2 API
  4. Wait for Processing Completion (Wait Node) - Waits 10 seconds before checking status
  5. Obtain the generated status (HTTP Request) - Polls API task query endpoint for completion status
  6. Check if Image Generation is Complete (IF Node) - Checks if status equals ‘success’
  7. Format and Display Results (Set Node) - Extracts and formats final video URL output

Technical Details

Customization Tips

Content Moderation

The API implements a three-stage content review process:

  1. Image Review: Rejects images with real people or highly realistic human faces
  2. Prompt Filtering: Checks for violence, adult content, copyrighted material, and living celebrities
  3. Output Review: Final check after generation (often causes failures at 90%+ completion)

Best Practices:

Example Prompts

Use Cases

🔗 Nodes Used

HTTP Request, n8n Form Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup