# Text to video

**Action ID:** `text_to_video`

## Description

Text to video

## Connection

| Name               | Description                                 | Required | Category |
| ------------------ | ------------------------------------------- | -------- | -------- |
| PixelML Connection | The PixelML connection to call PixelML API. | True     | pixelml  |

## Input Schema

```json
{
  "description": "Text to video node input.",
  "properties": {
    "model": {
      "default": "Pixel S",
      "description": "Model",
      "enum": [
        "Pixel S",
        "Pixel M",
        "Pixel L"
      ],
      "title": "Model",
      "type": "string"
    },
    "prompt": {
      "description": "Prompt",
      "title": "Prompt",
      "type": "string"
    },
    "negative_prompt": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Negative prompt",
      "title": "Negative prompt"
    },
    "steps": {
      "default": 30,
      "description": "Steps",
      "maximum": 50,
      "minimum": 1,
      "title": "Steps",
      "type": "integer"
    },
    "guidance_scale": {
      "default": 7,
      "description": "Guidance scale",
      "maximum": 10,
      "minimum": 2,
      "title": "Guidance scale",
      "type": "integer"
    },
    "size": {
      "default": "Landscape HD (16:9)",
      "description": "Size (Only for Pixel M)",
      "enum": [
        "Square HD (1:1)",
        "Square FullHD (1:1)",
        "Portrait HD (3:4)",
        "Portrait FullHD (3:4)",
        "Portrait HD (9:16)",
        "Portrait FullHD (9:16)",
        "Landscape HD (4:3)",
        "Landscape FullHD (4:3)",
        "Landscape HD (16:9)",
        "Landscape FullHD (16:9)"
      ],
      "title": "Size (Only for Pixel M)",
      "type": "string"
    },
    "fps": {
      "default": 30,
      "description": "FPS (Only for Pixel M)",
      "title": "FPS (Only for Pixel M)",
      "type": "integer"
    },
    "duration": {
      "default": 2,
      "description": "Duration in seconds (Only for Pixel L)",
      "title": "Duration in seconds (Only for Pixel L)",
      "type": "integer"
    }
  },
  "required": [
    "prompt"
  ],
  "title": "TextToVideoNodeInput",
  "type": "object"
}
```

## Output Schema

```json
{
  "description": "Text to video node output.",
  "properties": {
    "video_url": {
      "description": "Video URL",
      "title": "Video URL",
      "type": "string"
    }
  },
  "required": [
    "video_url"
  ],
  "title": "TextToVideoNodeOutput",
  "type": "object"
}
```

## How It Works

This node generates AI-powered videos from text descriptions using PixelML's text-to-video models. You select a model size (S, M, or L) based on your quality and duration needs, then provide a descriptive prompt. The AI interprets your text, creates a sequence of frames that match your description, and renders them into a smooth video with motion. Quality is controlled through steps and guidance scale parameters, while negative prompts help exclude unwanted elements. Different model sizes offer different capabilities—Pixel S for quick previews, Pixel M for customizable size and FPS, and Pixel L for longer durations.

## Usage Examples

### Example 1: Quick Social Media Clip (Pixel S)

**Input:**

```
model: "Pixel S"
prompt: "A coffee cup steaming on a wooden table, morning sunlight streaming through window, peaceful and calming atmosphere"
negative_prompt: "people, text, logos, blurry, distorted"
steps: 30
guidance_scale: 7
```

**Output:**

```
video_url: "https://pixelml.com/output/coffee_morning_scene.mp4"
```

### Example 2: Product Demo Video (Pixel M)

**Input:**

```
model: "Pixel M"
prompt: "Modern smartphone rotating slowly, sleek black finish, studio lighting with reflections, professional product showcase"
negative_prompt: "scratches, fingerprints, text, watermarks"
steps: 40
guidance_scale: 8
size: "Landscape HD (16:9)"
fps: 60
```

**Output:**

```
video_url: "https://pixelml.com/output/smartphone_showcase_hd.mp4"
```

### Example 3: Extended Cinematic Scene (Pixel L)

**Input:**

```
model: "Pixel L"
prompt: "Majestic mountain landscape at sunset, clouds moving slowly across orange sky, camera slowly panning across peaks, cinematic and epic"
negative_prompt: "people, buildings, cars, modern objects, text"
steps: 50
guidance_scale: 9
duration: 5
```

**Output:**

```
video_url: "https://pixelml.com/output/mountain_sunset_cinematic.mp4"
```

## Common Use Cases

* **Social Media Content**: Create engaging video clips for Instagram Stories, TikTok, and other social platforms
* **Product Demonstrations**: Generate product showcase videos without filming physical products
* **Marketing Materials**: Produce b-roll footage and background videos for marketing campaigns
* **Concept Visualization**: Visualize ideas and concepts for presentations and pitches
* **Video Backgrounds**: Create looping background videos for websites, streams, and virtual events
* **Educational Content**: Generate illustrative videos to explain concepts and processes
* **Prototyping**: Quickly create video mockups to test ideas before investing in professional production

## Error Handling

| Error Type               | Cause                                           | Solution                                                                 |
| ------------------------ | ----------------------------------------------- | ------------------------------------------------------------------------ |
| Empty Prompt             | Prompt field is empty or null                   | Provide a descriptive text prompt for the video you want to generate     |
| Invalid Model            | Model selection not in allowed values (S, M, L) | Choose one of the supported models: Pixel S, Pixel M, or Pixel L         |
| Invalid Steps            | Steps value outside 1-50 range                  | Set steps between 1 and 50 (recommended: 30-40 for quality)              |
| Invalid Guidance Scale   | Guidance scale outside 2-10 range               | Set guidance scale between 2 and 10 (recommended: 7-9)                   |
| Invalid Size             | Size format not recognized (Pixel M only)       | Choose from predefined size options like "Landscape HD (16:9)"           |
| Duration Too Long        | Duration exceeds model limits (Pixel L only)    | Reduce duration or split into multiple shorter videos                    |
| PixelML Connection Error | Invalid or missing PixelML API credentials      | Verify your PixelML connection is properly configured with valid API key |

## Notes

* **Model Selection**: Pixel S is fastest (quick previews), Pixel M offers more control (custom size/FPS), Pixel L creates longer videos (up to several seconds)
* **Prompt Quality**: Detailed prompts with camera movement, lighting, and mood descriptions produce better results
* **Negative Prompts**: Use to exclude unwanted elements like text, people, or artifacts from generated videos
* **Steps Parameter**: More steps (40-50) produce smoother motion but take longer to process
* **Guidance Scale**: Higher values (8-10) stick closer to your prompt, lower values (3-6) allow more creative interpretation
* **FPS Consideration**: Higher FPS (60) creates smoother motion but increases file size (Pixel M only)
* **Processing Time**: Video generation takes significantly longer than image generation—expect 2-10 minutes depending on model and settings
* **Size vs Quality**: Higher resolutions (FullHD) produce better quality but require more processing time and credits


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.agenticflow.ai/reference/nodes/text_to_video.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
