Create Stunning Cyberpunk Videos with the Hunyuan Cyberpunk Mod Actions

21 Apr 2025
Create Stunning Cyberpunk Videos with the Hunyuan Cyberpunk Mod Actions

In the realm of digital creativity, the ability to generate immersive video content can significantly enhance applications in gaming, storytelling, and virtual experiences. The Hunyuan Cyberpunk Mod offers developers a powerful API for generating photorealistic video scenes inspired by the iconic Cyberpunk 2077 universe. This spec provides a set of pre-built Cognitive Actions that simplify the process of video generation, allowing creators to focus on their unique visions while leveraging advanced model capabilities.

Prerequisites

Before you start integrating the Hunyuan Cyberpunk Mod actions into your application, ensure you have the following:

  • An API key for the Cognitive Actions platform, which you will pass in the headers of your requests for authentication.
  • Familiarity with JSON for structuring input requests and handling responses.

Typically, authentication involves including your API key in the request headers, enabling secure communication with the Cognitive Actions service.

Cognitive Actions Overview

Generate Cyberpunk 2077 Video Mod

The Generate Cyberpunk 2077 Video Mod action allows you to create stunning video scenes by leveraging a fine-tuned model based on Cyberpunk 2077 aesthetics. You can customize the output using various parameters, including prompts, dimensions, and more.

Input

The input schema for this action consists of several fields, each with specific roles in the video generation process:

  • seed (optional): An integer for consistent results; defaults to random.
  • steps (optional): Number of iterative diffusion steps (default: 50; min: 1, max: 150).
  • width (optional): Width of the generated video in pixels (default: 640; min: 64, max: 1536).
  • height (optional): Height of the generated video in pixels (default: 360; min: 64, max: 1024).
  • prompt (required): Descriptive text that specifies the style and content of the video scene.
  • loraUrl (optional): URL for a LoRA .safetensors file.
  • flowShift (optional): Controls video continuity across frames (default: 9; min: 0, max: 20).
  • frameRate (optional): Frames per second (default: 24; min: 1, max: 60).
  • frameCount (optional): Total number of frames in the video (default: 85; min: 1, max: 300).
  • forceOffload (optional): Determines if model layers are offloaded to CPU (default: true).
  • loraStrength (optional): Influence of the LoRA model on the video (default: 1).
  • guidanceScale (optional): Balance between textual input and model output (default: 6).
  • denoiseStrength (optional): Intensity of noise applied at diffusion steps (default: 1).
  • videoQualityFactor (optional): CRF for h264 encoding (default: 19; ranges from 0 to 51).

Example Input:

{
  "steps": 50,
  "width": 854,
  "height": 480,
  "prompt": "In the style of CYB77, first person view of a gunfight in a cyberpunk city",
  "loraUrl": "",
  "flowShift": 9,
  "frameRate": 24,
  "frameCount": 85,
  "forceOffload": true,
  "loraStrength": 1,
  "guidanceScale": 6,
  "denoiseStrength": 1,
  "videoQualityFactor": 19
}

Output

Upon successful execution, this action returns a URL pointing to the generated video output, which can be accessed for playback or further use.

Example Output:

https://assets.cognitiveactions.com/invocations/4314d78b-6ad7-4b38-98e4-d71fca22e025/f60aa6d4-b353-47d3-b871-767ce1a9acad.mp4

Conceptual Usage Example (Python)

Here's a conceptual Python code snippet illustrating how to invoke this action using a hypothetical endpoint.

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 = "e3cc17bb-657a-4b47-9186-2e07c7b99a67"  # Action ID for Generate Cyberpunk 2077 Video Mod

# Construct the input payload based on the action's requirements
payload = {
    "steps": 50,
    "width": 854,
    "height": 480,
    "prompt": "In the style of CYB77, first person view of a gunfight in a cyberpunk city",
    "loraUrl": "",
    "flowShift": 9,
    "frameRate": 24,
    "frameCount": 85,
    "forceOffload": True,
    "loraStrength": 1,
    "guidanceScale": 6,
    "denoiseStrength": 1,
    "videoQualityFactor": 19
}

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 snippet, replace the placeholder for the API key and ensure that the action ID corresponds to the desired action. The payload structure directly reflects the schema from the action's input requirements.

Conclusion

Integrating the Hunyuan Cyberpunk Mod's video generation capabilities into your application can vastly enhance the quality and creativity of your video content. By utilizing the provided Cognitive Actions, developers can quickly generate stunning, immersive scenes that resonate with audiences. Explore the possibilities and bring your unique visions to life through the power of AI-driven video generation!