Create Stunning Cyberpunk Videos with the fofr/wan-14b-cyberpunk-realistic Action

In the world of digital media, creating engaging content is key to capturing audience attention. The fofr/wan-14b-cyberpunk-realistic spec offers developers an exciting opportunity to leverage advanced video generation capabilities inspired by the Cyberpunk aesthetic. With the provided Cognitive Actions, you can easily create hyper-realistic video clips reminiscent of the iconic Cyberpunk 2077 game. These pre-built actions streamline the process, allowing for customization while maintaining high-quality output.
Prerequisites
Before you dive into using the Cognitive Actions, ensure you have the following:
- An API key for accessing the Cognitive Actions platform.
- Familiarity with making HTTP requests, as you'll be sending requests to the Cognitive Actions endpoint.
- A basic understanding of JSON structure, as the inputs and outputs will be in JSON format.
Authentication typically involves passing your API key in the headers of your requests, which we'll cover in the conceptual code examples.
Cognitive Actions Overview
Generate Cyberpunk Video
The Generate Cyberpunk Video action is designed to produce mesmerizing video clips in a Cyberpunk style, utilizing the Wan2.1 model fine-tuned with Cyberpunk mods. You can customize various parameters, including frames, resolution, and aspect ratios, enabling rapid video generation without sacrificing quality.
Input
The input for this action requires a JSON object with several fields. Below is the schema and an example input:
- Required Fields:
prompt: A description of the video content to generate.
- Optional Fields:
seed: Integer seed for reproducibility (default is randomly chosen).image: URI of an image to use as the initial frame.frameCount: Total number of frames to generate (options: 17, 33, 49, 65, 81; default is 81).guideScale: How closely the video adheres to the prompt (default is 5).resolution: Video resolution (options: "480p" and "720p"; default is "480p").aspectRatio: Video aspect ratio (options: "16:9", "9:16", "1:1"; default is "16:9").sampleShift: Factor for adjusting sample shifts (default is 8).sampleSteps: Number of steps in the generation process (default is 30).customWeights: Custom LoRA weights (leave blank for defaults).negativePrompt: Elements to exclude from the video.loraStrengthClip: LORA strength for the CLIP model (default is 1).loraStrengthModel: LORA strength for the generation model (default is 1).generationSpeedMode: Speed mode for generation (options: "Off", "Balanced", "Fast"; default is "Balanced").
Example Input
{
"image": "https://replicate.delivery/xezq/cPbpoOia6exgEq9sTwWMn9HsytppiVjq3cYrfYfzErlfqqsRB/tmpr4czcw2e.png",
"prompt": "in the style of CYB77, driving a car very fast through a city at night",
"frameCount": 81,
"guideScale": 5,
"resolution": "480p",
"aspectRatio": "16:9",
"sampleShift": 8,
"sampleSteps": 50,
"negativePrompt": "",
"loraStrengthClip": 1,
"loraStrengthModel": 1,
"generationSpeedMode": "Off"
}
Output
The output of the action is a JSON array containing a URL to the generated video. Here's an example of what you can expect:
Example Output
[
"https://assets.cognitiveactions.com/invocations/85fefb30-9e6c-43d6-bd35-e4bd2b429871/1ceda6f0-47c1-4168-96bd-b7771ddd1ba9.mp4"
]
Conceptual Usage Example (Python)
Below is a conceptual Python code snippet demonstrating how you might call the Generate Cyberpunk Video action:
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 = "e89554cc-c1fd-4fe0-8219-1c8cb9d2a30d" # Action ID for Generate Cyberpunk Video
# Construct the input payload based on the action's requirements
payload = {
"image": "https://replicate.delivery/xezq/cPbpoOia6exgEq9sTwWMn9HsytppiVjq3cYrfYfzErlfqqsRB/tmpr4czcw2e.png",
"prompt": "in the style of CYB77, driving a car very fast through a city at night",
"frameCount": 81,
"guideScale": 5,
"resolution": "480p",
"aspectRatio": "16:9",
"sampleShift": 8,
"sampleSteps": 50,
"negativePrompt": "",
"loraStrengthClip": 1,
"loraStrengthModel": 1,
"generationSpeedMode": "Off"
}
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, you replace the API key and endpoint with your credentials. The action ID corresponds to the Generate Cyberpunk Video action, and the payload is structured according to the required fields.
Conclusion
The fofr/wan-14b-cyberpunk-realistic Cognitive Action allows developers to harness the power of advanced video generation to create captivating Cyberpunk-themed content effortlessly. By leveraging the provided input parameters, you can fully customize your video outputs to suit your creative vision. Consider experimenting with different prompts and settings to explore the full potential of this exciting action. Happy coding!