Xalora AI Docs
  • Getting Started
    • Welcome to Xalora
  • Agent Framework
    • Social Agents
  • Xalora Mesh
  • Ecosystem
    • Xalora Imagine
  • imaginaries NFT
  • Developer Reference
    • Integration Overview
  • Supported Models
  • Understanding Image Prompting
  • Using Xalora API with Eliza
  • REST API
    • Xalora Mesh API
  • Synchronous Request
  • Image Generation API
  • Xalora SDK
    • Introduction
  • Getting Started
  • Basic Image Generation
  • SmartGen
  • ComfyUI Workflow
  • FluxLora Workflow
  • Text2Video Workflow
  • LLM Gateway
    • Introduction
  • LLM Tool Calling
  • Embeddings
Powered by GitBook
On this page
  • ​Supported Models to Workflow ID Mapping
  • ​Before you start
  • ​Example Request
  • ​Example Response
  • ​Parameters
  • ​Returns
  • ​Authentication
  • ​Types

Text2Video Workflow

PreviousFluxLora WorkflowNextIntroduction

Last updated 7 days ago

Generate videos from text descriptions using advanced AI models.

This workflow extends the base functionality to support text-to-video generation.

Supported Models to Workflow ID Mapping

Workflow ID
Model

1

Hunyuan

Before you start

  1. Define environment variables in .env file:

Copy

XALORA_API_KEY=your_api_key
XALORA_WORKFLOW_URL=https://sequencer-v2.xalora.xyz

Example Request

Copy

import Xalora from 'xalora'

const xalora = new Xalora({
  apiKey: process.env['XALORA_API_KEY']
});

async function generateVideo() {
  const text2VideoTask = new Text2VideoTask({
    workflow_id: '1',
    prompt: 'a rabbit moving quickly in a beautiful winter scenery nature trees sunset tracking camera',
    timeout_seconds: 600 // optional
  });

  const response = await xalora.workflow.executeWorkflowAndWaitForResult(
    text2VideoTask,
    600000,  // 10 minutes timeout
    15000    // 15 seconds polling interval
  );

  console.log('Generated video URL:', response.result);
}

Copy

{
  "task_id": "7599f1f038",
  "create_timestamp": 1733965543,
  "inference_latency": 0.608921,
  "upload_latency": 2.316333,
  "task_type": "txt2vid",
  "status": "finished",
  "result": "https://example.com/generated-video.webp",
  "task_details": {
    "parameters": {
      "fps": 24,
      "height": 480,
      "length": 37,
      "prompt": "a rabbit moving quickly in a beautiful winter scenery nature trees sunset tracking camera",
      "quality": 80,
      "seed": 704883238463297,
      "steps": 30,
      "width": 848
    }
  },
  "timeout_seconds": 600,
  "workflow_id": "1"
}

Type: Text2VideoTask

Property
Type
Required
Description

workflow_id

string

true

The ID of the workflow to execute.

prompt

string

true

The prompt to use for the video generation.

width

number

false

The width of the video. Default is 848.

height

number

false

The height of the video. Default is 480.

length

number

false

The length of the video in frames. Default is 37.

steps

number

false

The number of steps to use for the video generation. Default is 30.

seed

number

false

The seed to use for the video generation.

fps

number

false

The frames per second of the video. Default is 24.

quality

number

false

The quality of the video. Default is 80.

job_id_prefix

string

false

An optional prefix for the job ID. Default is “sdk-workflow”.

timeout_seconds

number

false

The timeout for the task in seconds. If the task is not finished within the timeout, it will be canceled.

consumer_id

string

false

The ID of the consumer.

api_key

string

false

The API key of the consumer.

Type: WorkflowTaskResult

Property
Type
Required
Description

task_id

string

true

The ID of the executed task.

status

enum

true

The status of the task.

result

any

false

The result of the task, if available.

task_details

any

false

The details of the task, if available.

timeout_seconds

number

false

The timeout for the task in seconds.

workflow_id

string

false

The ID of the workflow that executed the task.

create_timestamp

number

false

The timestamp when the task was created.

inference_latency

number

false

The latency of the inference in seconds.

upload_latency

number

false

The latency of the upload in seconds.

Authentication uses a combined consumer ID and API key format: consumerId#apiKey. You can provide these in two ways:

  1. In the Xalora client initialization using environment variables:

Copy

const xalora = new Xalora({
  apiKey: process.env['XALORA_API_KEY']  // format: consumerId#apiKey
});
  1. In the Text2VideoTask object, the task-specific values will override the client defaults if provided.

Copy

const text2VideoTask = new Text2VideoTask({
  consumer_id: 'consumerId',
  api_key: 'apiKey',
  ...
});

Text2VideoTask

A class representing a text-to-video task, extending the abstract WorkflowTask class.

Copy

class Text2VideoTask extends WorkflowTask {
  constructor(options: Text2VideoTaskOptions)
  get task_type(): WorkflowTaskType.Text2Video
  get task_details(): {
    parameters: {
      prompt: string
      width?: number
      height?: number
      length?: number
      steps?: number
      seed?: number
      fps?: number
      quality?: number
    }
  }
}

WorkflowTaskType

An enum representing the types of workflow tasks.

Copy

enum WorkflowTaskType {
  Text2Video = 'txt2vid'
}

Example Response

Parameters

Returns

Authentication

Types

ComfyUI Workflow
​
​
Get an API key
​
​
​
​
​
​