Create Stunning Videos from Images and Text with Chamuel Wan

26 Apr 2025
Create Stunning Videos from Images and Text with Chamuel Wan

In today's digital landscape, the ability to transform static images and descriptive text into dynamic video content is a game-changer for developers and creators alike. The "Chamuel Wan" service offers a powerful Cognitive Action that allows you to generate short videos using an initial image combined with a detailed textual prompt. This innovative feature not only simplifies the content creation process but also enhances user engagement by providing visually rich storytelling experiences.

Imagine a scenario where you have a captivating image and a compelling narrative. With Chamuel Wan, you can quickly produce a video that brings your vision to life. This action is ideal for various use cases, including marketing campaigns, educational materials, social media content, and artistic projects. Whether you're a marketer looking to create eye-catching promotional videos or an educator wanting to illustrate complex concepts, this tool can significantly streamline your workflow and unleash your creativity.

Prerequisites

To use the Chamuel Wan Cognitive Action, you'll need an API key for the service and a basic understanding of making API calls.

Generate Video from Image and Text

This action creates a short video based on a given image and a descriptive text. You can customize various parameters such as frame rate, resolution, and video length, allowing for tailored outputs that meet specific needs.

Purpose

The "Generate Video from Image and Text" action addresses the challenge of producing engaging video content quickly and efficiently. By combining visual and textual elements, it allows users to convey complex narratives in a visually appealing format.

Input Requirements

The input for this action requires a JSON object that includes:

  • prompt: A detailed textual description guiding the video generation.
  • image: A URI pointing to the image to be used as the starting frame.
  • resolution: Sets the video resolution, defaulting to 480p.
  • numberOfFrames: Defines how many frames will be generated, representing the video length.
  • generationSteps: Determines the number of steps in the generation process, balancing quality and speed.
  • Additional optional parameters include seed, unwantedElements, videoAspectRatio, and more.

Expected Output

Upon successful execution, the output will be a link to the generated video, which can be accessed and shared across various platforms.

Use Cases for this Specific Action

  • Marketing: Create promotional videos that combine product images with engaging descriptions to capture audience attention.
  • Education: Develop instructional videos that visually explain concepts, making learning more interactive and enjoyable.
  • Social Media: Generate quick, eye-catching content for platforms like Instagram or TikTok, enhancing engagement with visually driven narratives.
  • Art Projects: Bring artistic visions to life by combining visual art with descriptive storytelling, creating unique multimedia experiences.
import requests
import json

# Replace with your actual Cognitive Actions API key and endpoint
# Ensure your environment securely handles the API key
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
# This endpoint URL is hypothetical and should be documented for users
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"

action_id = "43dc97e1-8d80-4ff0-9cc9-8c573e65d863" # Action ID for: Generate Video from Image and Text

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "prompt": "The Empress is a beautiful, full-figured woman with blonde hair and a peaceful aura about her. On her head, she wears a crown of twelve stars, showing her connection with the mystical realm and the cycles of the natural world (the twelve months of the year and the twelve planets). Her robe is patterned with pomegranates, symbolic of fertility, and sits upon a luxurious array of cushions and flowing red velvet. One cushion features the symbol of Venus, the planet of love, creativity, fertility, beauty and grace – the essence of The Empress.\n\nA beautiful, lush forest and winding stream surround The Empress, signifying her connection with Mother Earth and life itself. She draws her sense of peace from the trees and the water and is rejuvenated by the energy of nature. In the foreground, golden wheat springs from the soil, reflecting abundance from a recent harvest.",
  "modelStrength": 1,
  "numberOfFrames": 81,
  "generationSteps": 30,
  "videoAspectRatio": "9:16",
  "clipModelStrength": 1,
  "sampleShiftFactor": 8,
  "promptAdherenceScale": 5
}

headers = {
    "Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
    "Content-Type": "application/json",
    # Add any other required headers for the Cognitive Actions API
}

# Prepare the request body for the hypothetical execution endpoint
request_body = {
    "action_id": action_id,
    "inputs": payload
}

print(f"--- Calling Cognitive Action: {action.name or action_id} ---")
print(f"Endpoint: {COGNITIVE_ACTIONS_EXECUTE_URL}")
print(f"Action ID: {action_id}")
print("Payload being sent:")
print(json.dumps(request_body, indent=2))
print("------------------------------------------------")

try:
    response = requests.post(
        COGNITIVE_ACTIONS_EXECUTE_URL,
        headers=headers,
        json=request_body
    )
    response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)

    result = response.json()
    print("Action executed successfully. Result:")
    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 (non-JSON): {e.response.text}")
    print("------------------------------------------------")

Conclusion

The Chamuel Wan Cognitive Action for generating videos from images and text provides a powerful tool for developers looking to enhance their content creation capabilities. With its flexibility in customization and ease of use, it opens up numerous possibilities for engaging storytelling across various domains.

As you explore this action, consider how it can be integrated into your projects to create compelling visual narratives. Start experimenting today to unlock the full potential of your creative ideas!