Actions21
Overview
This node provides a "绘图" (Drawing) operation under the default resource, which appears to generate images based on textual prompts. Users input a description or prompt of what they want to visualize, and the node processes this input to produce an image output. This kind of node is useful in scenarios such as creative content generation, visual prototyping, or enhancing chatbot responses with generated images.
For example, a user might input the prompt "一只可爱的猫吃恐龙" ("a cute cat eating a dinosaur") to generate a corresponding image. This can be beneficial for artists, marketers, or developers who want to quickly create visuals from text descriptions without manual drawing.
Properties
| Name | Meaning |
|---|---|
| 模型 (assistantId) | The model or intelligent agent used for generating the image. Placeholder suggests it can be any string if unknown. |
| 提示 (prompt) | The textual prompt describing the desired image content, e.g., "a cute cat eating a dinosaur". |
| 语音列表 (voice) | A selection of voice options, primarily relevant when using text-to-speech features (not directly related to drawing). Options include official voices and cloned voices. |
Note: The "语音列表" property is shown only when text-to-speech usage is enabled and hidden for the "绘图" operation, so it does not affect the drawing operation directly.
Output
The node outputs JSON data representing the result of the drawing operation. Although the exact structure is not detailed in the provided code, typically such nodes return:
- An array of items where each item contains:
json: The main JSON object with details about the generated image(s), such as URLs or base64 encoded image data.- Possibly binary data fields containing the actual image files.
Since the bundled code delegates execution to an external router module (actions/router), the precise output format depends on that implementation but generally includes the generated image data accessible for further workflow steps.
Dependencies
- The node relies on an external routing mechanism imported from
./actions/routerto handle the core logic of the drawing operation. - It also imports version and description metadata from
./actions/versionDescription. - No direct API keys or credentials are referenced in the provided snippet for the drawing operation, but depending on the external router's implementation, an API key or authentication token may be required.
- The voice list property indicates integration with a text-to-speech service, which requires access to a voice database or API, but this is unrelated to the drawing operation itself.
Troubleshooting
- Missing or invalid prompt: If the prompt property is empty or malformed, the node may fail to generate an image or return an error. Ensure the prompt is a meaningful descriptive string.
- Model identifier issues: Providing an incorrect or unsupported model/agent name might cause failures or unexpected results. Use valid model identifiers or leave blank if unsure.
- External service errors: Since the execution is delegated to an external router, network issues or API limits could cause errors. Check connectivity and API quota.
- Voice property confusion: The voice list property is irrelevant for the drawing operation; enabling text-to-speech features without proper configuration might cause unexpected behavior in other operations.
Common error messages would likely relate to invalid inputs, missing authentication, or service unavailability. To resolve, verify all inputs, ensure necessary credentials are configured, and check external service status.
Links and References
- No direct links are provided in the source code.
- For more information on text-to-image generation APIs or services, users can refer to popular platforms like OpenAI DALL·E, Stability AI, or similar.
- For n8n custom node development, see the official documentation: https://docs.n8n.io/integrations/creating-nodes/