Generate Engaging Videos with the NOVA Cognitive Actions

24 Apr 2025
Generate Engaging Videos with the NOVA Cognitive Actions

In the realm of advanced media generation, the NOVA model stands out by offering powerful capabilities for video creation. The chenxwh/nova-t2v API provides a single Cognitive Action that allows developers to harness this model for autoregressive video generation without vector quantization. This action enables efficient frame-by-frame video prediction and supports diverse zero-shot generation, making it an essential tool for anyone looking to create dynamic video content through simple API calls.

Prerequisites

Before diving into the integration of these Cognitive Actions, ensure you have:

  • An API key for the Cognitive Actions platform, which will be required for authentication.
  • Familiarity with making HTTP requests and handling JSON data structures.

For authentication, you'll typically pass your API key in the request headers. This process allows secure access to the Cognitive Actions service.

Cognitive Actions Overview

Generate Video Using NOVA

The Generate Video Using NOVA action allows you to create videos based on textual prompts and other customizable parameters. This innovative approach leverages the NOVA model to produce high-quality video content efficiently.

  • Category: Video Generation

Input

The input for this action is structured as a JSON object and includes several parameters:

  • seed (optional): A random seed for initializing random number generators. If left blank, a random seed will be generated.
  • image (optional): A URI of an input image to be used as a prompt.
  • prompt (required): Text input to guide the generation process.
  • motionFlow (optional): Controls the flow of motion in the output (1 to 10; default is 5).
  • guidanceScale (optional): Strength of classifier-free guidance (1 to 10; default is 7).
  • negativePrompt (optional): A list of elements to avoid in the output.
  • framesPerSecond (optional): The frame rate for the output video (default is 12 fps).
  • numberOfDiffusionSteps (optional): Number of diffusion steps for smoothing the output (1 to 100; default is 100).
  • numberOfInferenceSteps (optional): Number of steps for inference processing (1 to 128; default is 128).

Here’s an example of the input JSON payload:

{
  "prompt": "The camera slowly rotates around a massive stack of vintage televisions that are placed within a large New York museum gallery.",
  "motionFlow": 5,
  "guidanceScale": 7,
  "negativePrompt": "low quality, deformed, distorted, disfigured, fused fingers, bad anatomy, weird hand",
  "framesPerSecond": 12,
  "numberOfDiffusionSteps": 100,
  "numberOfInferenceSteps": 128
}

Output

Upon successful execution, the action typically returns a URL to the generated video, which can be viewed or downloaded. Here's an example of the output:

https://assets.cognitiveactions.com/invocations/19793790-b28f-4745-878b-59a7d108760f/156019ef-6f86-49ba-b663-1539a86abe3e.mp4

Conceptual Usage Example (Python)

Below is a conceptual Python code snippet that demonstrates how to invoke the Generate Video Using NOVA action. This example illustrates how to structure the input JSON payload correctly.

import requests
import json

# Replace with your Cognitive Actions API key and endpoint
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"  # Hypothetical endpoint

action_id = "d984ee4f-63d7-4879-9df8-b4064bfd02c0"  # Action ID for Generate Video Using NOVA

# Construct the input payload based on the action's requirements
payload = {
    "prompt": "The camera slowly rotates around a massive stack of vintage televisions that are placed within a large New York museum gallery.",
    "motionFlow": 5,
    "guidanceScale": 7,
    "negativePrompt": "low quality, deformed, distorted, disfigured, fused fingers, bad anatomy, weird hand",
    "framesPerSecond": 12,
    "numberOfDiffusionSteps": 100,
    "numberOfInferenceSteps": 128
}

headers = {
    "Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
    "Content-Type": "application/json"
}

try:
    response = requests.post(
        COGNITIVE_ACTIONS_EXECUTE_URL,
        headers=headers,
        json={"action_id": action_id, "inputs": payload}  # Hypothetical structure
    )
    response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)

    result = response.json()
    print("Action executed successfully:")
    print(json.dumps(result, indent=2))

except requests.exceptions.RequestException as e:
    print(f"Error executing action {action_id}: {e}")
    if e.response is not None:
        print(f"Response status: {e.response.status_code}")
        try:
            print(f"Response body: {e.response.json()}")
        except json.JSONDecodeError:
            print(f"Response body: {e.response.text}")

In this code, replace "YOUR_COGNITIVE_ACTIONS_API_KEY" with your actual API key. The action_id corresponds to the Generate Video Using NOVA action. The input payload is constructed according to the requirements specified above.

Conclusion

The Generate Video Using NOVA Cognitive Action provides developers with an innovative solution for dynamic video content creation. By leveraging this action, you can easily integrate advanced video generation capabilities into your applications, enhancing user experiences with rich, engaging media. Consider exploring various prompts and parameters to fully utilize the potential of the NOVA model in your projects. Happy coding!