# n8n-nodes-aliyun-bailian

This is an n8n community node that allows you to integrate Alibaba Cloud Aliyun Bailian AI capabilities, Bailian file APIs, and OSS functionality in your n8n workflows with dedicated credentials.

[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.

[Installation](#installation)
[Operations](#operations)
[Credentials](#credentials)
[Compatibility](#compatibility)
[Usage](#usage)
[Resources](#resources)
[Version history](#version-history)

## Installation

Follow the [n8n community node installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) for installation instructions.

## Operations

### Aliyun Bailian Node

#### Video Operations

- **Text to Video** - Generate video based on text prompts (wan2.7-t2v, wan2.6-t2v, wan2.5-t2v-preview, wan2.2-t2v-plus, wanx2.1-t2v-turbo, wanx2.1-t2v-plus)
- **Image to Video (First Frame)** - Generate coherent video from a single keyframe image (wan2.7-i2v, wan2.6-i2v, wan2.5-i2v-preview, etc.)
- **Image to Video (First & Last Frames)** - Generate complete video by interpolating between first and last keyframes (wan2.7-i2v, wan2.2-kf2v-flash, wanx2.1-kf2v-plus)
- **Video Continuation** - Continue a source clip with wan2.7-i2v, optionally constrained by a last frame. `duration` means the final output duration, not incremental appended seconds
- **Reference to Video** - Generate a new video with reference clips + prompt (wan2.6-r2v)
- **Video Animate Mix** - Tongyi Wanxiang Animate Mix model, allowing target portrait replacement in background videos (wan2.2-animate-mix)
- **Video Animate Move** - Tongyi Wanxiang Animate Move model, making static portraits move using driving videos (wan2.2-animate-move)
- **Emoji Video Generation** - Generate animated emoji videos based on portrait images and templates (emoji-v1)
- **Video Editing & Effects** - Apply Tongyi Wanxiang's editing capabilities to existing footage (wan2.7-videoedit, wanx2.1-vace-plus)
- **VideoRetalk Lip Sync** - Use VideoRetalk to synchronize audio lip movements to target videos (videoretalk)

#### Image Operations

- **Text to Image** - Generate images from prompts (wan2.6-t2i, z-image-turbo, wan2.5-t2i-preview, etc.)
- **Image to Image (Wan)** - Transform images with Wan image editing (wan2.5-i2i-preview, wanx2.1-imageedit)
- **Multimodal Image Edit (Qwen)** - Multi-image + text instruction image editing (qwen-image-edit, qwen-image-edit-plus, qwen-image-edit-max, qwen-image-2.0-pro)
- **Wan 2.6 Image Generation & Edit** - Use wan2.6-image for both text-only generation and image+text editing; optional interleaved output (wan2.6-image)

#### Vision Operations

- **Vision Understanding** - Answer questions about images or videos, with optional mixed image + video input (qwen3-vl-plus, qwen-vl-plus, qwen-vl-max)

#### Audio Operations

- **Text to Speech (Qwen TTS)** - Convert text content into synthesized speech audio, supporting multiple voices and languages
- **Fun-ASR Recorded Speech Recognition** - Speech to text transcription

#### Task Operations

- **Task Status Query** - Query the current status of a specified task ID, with support for polling until task completion

#### File Operations (Bailian Files API)

- **Upload File** - Upload one file to Bailian file storage through `multipart/form-data`
- **List Files** - List files by page, with support for automatic pagination (`Return All`)
- **Get File** - Fetch metadata for a specified file ID
- **Delete File** - Delete one file by file ID
- **Output Mode Switch** - For `List Files`, choose `Items Only` (flattened file items) or `Page Envelope` (preserve paging metadata such as `total`, `page_no`, and `page_size`)

### Aliyun OSS Node

#### Bucket Management

- Create Bucket
- Delete Bucket
- List all Buckets

#### Folder Management

- Create Folder
- Delete Folder
- List Folders

#### File Management

- Upload File
- Download File
- Delete File
- Copy File
- List Files

## Credentials

To use nodes in this package, configure the following credential types in n8n:

- **Aliyun Bailian API**: Provide the Bearer Token generated from the Bailian console. Register an Alibaba Cloud account, enable the Bailian service, and then select this credential type in n8n.
- **Aliyun OSS API**: Provide OSS AccessKeyId, AccessKeySecret (optional STS token), Endpoint or Region, default Bucket, and optional custom domain for OSS nodes.

## Compatibility

- Minimum compatible n8n version: 1.20.0
- Recommended to use the latest version of n8n for testing and development
- Manually tested on n8n versions 1.20.x ~ 1.24.x

## Usage

1. Add the "Aliyun Bailian | 阿里云百炼" node to your n8n workflow.
2. Configure the required API credentials separately.
3. Select resource type (Audio/Image/Video/Vision/Task/File) and operation.
4. Fill in necessary parameters; request body can be extended via advanced options.
5. For asynchronous generation tasks, enable task polling if needed.
6. For `Video Continuation`, `duration` means the total output duration after continuation. Example: input clip 3s + `duration=10` => final output 10s total.

For more n8n getting started information, please refer to the [Try it out](https://docs.n8n.io/try-it-out/) documentation.

## Resources

- [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
- [Alibaba Cloud official documentation](https://help.aliyun.com/)

## Version History

- v0.1.9 Added wan2.7 image generation and edit support, wan2.7 text-to-video, image-to-video, video continuation, and wan2.7 video edit support.
- v0.1.8 Added qwen-image-2.0-pro model support for text-to-image and multimodal image edit operations; Fixed qwen-image series API endpoint routing to use multimodal-generation endpoint.
- v0.1.7 Current release: Added Bailian Files API support in File resource.
- v0.1.6 Enhanced Aliyun Bailian AI capabilities with improved video processing, image understanding, and OSS integration features.
- v0.1.5 Added comprehensive Aliyun OSS node with Bucket, folder, and file management capabilities.
- v0.1.4 Initial release: Supports text/image to video generation, video editing, task polling, and Aliyun Bailian AI integration.
