Actions2
Overview
This node integrates with the Jimeng 4.0 API to generate images either from text prompts or by transforming reference images based on a prompt. It supports two main operations:
- Text to Image: Create an image purely from a descriptive text prompt.
- Image to Image: Generate a new image influenced by both a reference image URL and a text prompt.
Common use cases include creative content generation, concept art creation, marketing visuals, or any scenario where AI-assisted image generation can accelerate design workflows. For example, a user might input "A beautiful landscape painting" as a prompt to get a unique artwork or provide a photo URL plus a prompt to create stylistic variations of that photo.
Properties
| Name | Meaning |
|---|---|
| Session ID | Your jimeng.jianying.com session ID (required for authentication). |
| Operation | The action to perform: "Text to Image" or "Image to Image". |
| Prompt | Text description guiding the image generation. |
| Model | The model version used for generation. Only option is "图片 4.0" (Image 4.0). |
| Resolution | Output image resolution: "2K" or "4K". |
| Aspect Ratio | Aspect ratio of the generated image. Options: "1:1", "16:9", "9:16", "4:3", "3:4". |
| Reference Image URL | URL(s) of the reference image(s), comma-separated; required only for "Image to Image" operation. |
| Advanced > Timeout | Maximum time in seconds to wait for image generation to complete (default 180 seconds). |
Output
The node outputs JSON data with the following structure:
{
"success": true,
"imageUrls": [
"https://example.com/generated-image1.png",
"https://example.com/generated-image2.png"
]
}
success: Boolean indicating if the generation succeeded.imageUrls: An array of URLs pointing to the generated image(s).
No binary data output is produced directly by this node; instead, it provides URLs to access the generated images.
Dependencies
- Requires a valid session ID credential from jimeng.jianying.com for API authentication.
- Relies on the external Jimeng 4.0 image generation API.
- No additional environment variables or n8n-specific credentials are needed beyond the session ID input.
Troubleshooting
Common Issues:
- Invalid or expired session ID will cause authentication failures.
- Incorrect or unreachable reference image URLs may result in errors or no image generation.
- Network timeouts if the generation takes longer than the specified timeout value.
Error Messages:
- Errors thrown by the node typically contain the API error message or network failure details.
- If the node fails but "Continue On Fail" is enabled, error details are returned in the output JSON under the
errorfield.
Resolutions:
- Verify the session ID is current and correctly entered.
- Ensure reference image URLs are accessible and properly formatted.
- Increase the timeout setting if image generation frequently times out.
Links and References
- Jimeng Official Website (for session ID and API info)
- n8n Documentation on Creating Custom Nodes