Overview
This node, named "jimeng Node," provides image generation capabilities based on text prompts. Specifically, the "文生图" (text-to-image) operation under the "图片生成" (image generation) resource allows users to generate images by describing scenes or objects in natural language. This is useful for creative content creation, rapid prototyping of visual ideas, or generating unique images for marketing, storytelling, or design purposes.
For example, a user can input a prompt like "一个3D形象的小男孩,在公园滑滑板。" ("A 3D character of a little boy skateboarding in the park.") and receive an AI-generated image matching that description.
Properties
| Name | Meaning |
|---|---|
| 提示词 (prompt) | The text prompt describing the desired image content. Example: "一个3D形象的小男孩,在公园滑滑板。" |
| 模型 (modal) | The AI model used for image generation. Options include: jimeng-3.1, jimeng-3.0, jimeng-2.1, jimeng-2.0-pro, jimeng-2.0, jimeng-1.4, jimeng-xl-pro |
| width | Width of the generated image in pixels. Supports common aspect ratios such as 21:9, 16:9, 3:2, 4:3, 1:1, 3:4, 2:3, 9:16 |
| height | Height of the generated image in pixels. Same aspect ratio options as width. |
| 是否等待图片返回 (isImgReturn) | Boolean flag indicating whether the node should wait for the image generation to complete and return the image data before continuing. |
Output
The node outputs JSON data representing the result of the image generation request. Typically, this includes metadata about the generated image(s), such as URLs or base64-encoded image data depending on the implementation of the called API.
If the isImgReturn property is set to true, the output will contain the actual image data or links to the generated images. If false, it may only return job status or identifiers without waiting for the image to be ready.
Binary data output is not explicitly detailed in the source code but may be present if the image data is returned directly.
Dependencies
- Requires an API key credential for authentication with the external image generation service.
- The node depends on a plugin or resource factory (
plugins-help) that provides the specific implementations for each resource-operation pair. - Proper configuration of the API credentials within n8n is necessary for successful execution.
Troubleshooting
Common issues:
- Missing or invalid API credentials will cause authentication failures.
- Unsupported or unimplemented resource-operation combinations will throw errors indicating the method is not implemented.
- Incorrect image dimensions or unsupported aspect ratios might lead to API errors or unexpected results.
- Network or service downtime can cause request failures.
Error messages:
"未实现方法: 图片生成.文生图"indicates the requested resource-operation is not implemented; verify correct resource and operation names.- Errors during the call function are logged with details; enabling continue-on-fail mode allows processing to continue despite individual item errors.
Resolution:
- Ensure valid API credentials are configured.
- Confirm the resource and operation names match those supported by the node.
- Validate input parameters, especially image dimensions and prompt text.
- Check network connectivity and service status.
Links and References
- No direct external links provided in the source code.
- For more information on configuring API credentials and using custom nodes in n8n, refer to the official n8n documentation: https://docs.n8n.io/
- For general concepts on text-to-image generation, see resources on AI image generation models such as DALL·E, Stable Diffusion, or Midjourney.