Actions4
- 图像生成 Actions
- 视频生成 Actions
- 任务结果 Actions
Overview
This node integrates with the Aliyun BaiLian API to generate images from text prompts. It allows users to create AI-generated images by specifying descriptive text and various parameters such as model choice, image size, and quantity. The node supports asynchronous task handling by optionally waiting and polling for the generation task to complete before returning results.
Common scenarios:
- Creating unique artwork or illustrations based on textual descriptions.
- Generating visual content for marketing, social media, or creative projects.
- Automating image creation workflows where batch generation of images is needed.
Practical example:
You want to generate three images of "a cute kitten" using the "Wanx Image" model at 1024x1024 resolution. You can configure the prompt, specify the number of images, and let the node wait until the images are ready, then use the output URLs in your workflow.
Properties
| Name | Meaning |
|---|---|
| 模型 (model) | The AI model to use for image generation. Options: "Wanx Image", "Stable Diffusion XL". |
| 提示词 (prompt) | Text description used to generate the image. |
| 负面提示词 (negativePrompt) | Text specifying undesired content to exclude from the generated image. |
| 输出图片数量 (n) | Number of images to generate. |
| 尺寸 (size) | Output image dimensions. Options: "1024 X 1024", "720 X 1280", "1280 X 720". |
| 是否持续轮询任务结果 (waitingForTask) | Whether to wait and poll until the image generation task completes. |
| 轮询时间间隔 (interval) | Polling interval in milliseconds when waiting for task completion. |
| 最长等待时间 (maxWaitTime) | Maximum time in seconds to wait for task completion. |
| 高级选项 (additionalOptions) | Additional advanced options; currently supports "种子值" (seed) to set a random seed for reproducibility (0 means random). |
Output
The node outputs JSON data containing the response from the Aliyun BaiLian API. This includes:
- Task information such as
task_idif the request is asynchronous. - When waiting for task completion, the final output will include generated image URLs or related metadata.
- The structure depends on the API response but generally contains an
outputfield with image data.
If binary data (e.g., actual image files) were returned, it would be handled separately, but this node returns JSON with image references/URLs.
Dependencies
- Requires an API key credential for the Aliyun BaiLian service.
- Uses Axios HTTP client internally to communicate with the Aliyun BaiLian API endpoints.
- The node expects network access to
https://dashscope.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesisand related task status endpoints.
Troubleshooting
- Polling failures: If the node fails while polling for task completion, it throws an error indicating polling failure. Check network connectivity and API key validity.
- Timeouts: If the maximum wait time is too short, the task may not complete in time. Increase the "最长等待时间" property.
- Invalid prompts or parameters: The API may reject requests with invalid or empty prompts. Ensure required fields like "提示词" are properly set.
- API authentication errors: Verify that the API key credential is correctly configured and has necessary permissions.
- Handling task failures: If the generation task fails on the server side, the node returns the error message in the output JSON.
Links and References
- Aliyun BaiLian Official API Documentation (example link, replace with actual if available)
- Stable Diffusion XL Model Info
- Axios HTTP Client