Jimeng icon

Jimeng

Generate images with Jimeng 4.0 API

Overview

This node integrates with the Jimeng 4.0 API to generate images based on textual prompts or reference images. It supports two main operations:

  • Text to Image: Generates an image purely from a text description.
  • Image to Image: Generates a new image influenced by both a text prompt and one or more reference images.

This node is useful for creative workflows where automated image generation is needed, such as content creation, marketing materials, concept art, or rapid prototyping of visual ideas. For example, you could input a prompt like "A beautiful landscape painting" to get a generated image matching that description, or provide a reference image URL plus a prompt to create variations or enhancements of an existing image.

Properties

Name Meaning
Session ID Your jimeng.jianying.com session ID (required, password type)
Operation The operation to perform: "Text to Image" or "Image to Image"
Prompt The text prompt describing the desired image (required for both operations)
Model The model version to use for image generation; currently only "图片 4.0" (value "4.0")
Resolution The resolution of the generated image; options are "2K" or "4K"
Aspect Ratio The aspect ratio of the generated image; options include "1:1", "16:9", "9:16", "4:3", "3:4"
Reference Image URL (Only for Image to Image) One or more URLs of reference images, separated by commas (required for this operation)
Advanced > Timeout (Seconds) Maximum time in seconds to wait for the image generation to complete (default 180)

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: A boolean indicating whether the image generation was successful.
  • imageUrls: An array of URLs pointing to the generated images.

No binary data output is produced by this node; all generated images are accessible via URLs.

Dependencies

  • Requires a valid session ID from jimeng.jianying.com to authenticate API requests.
  • Relies on the external Jimeng 4.0 API service for image generation.
  • No additional environment variables or n8n credentials beyond the session ID input property are required.

Troubleshooting

  • Common Issues:

    • Invalid or expired session ID will cause authentication failures.
    • Incorrect or malformed reference image URLs may result in errors or no image generation.
    • Network issues or API downtime can cause timeouts or failed requests.
  • Error Messages:

    • Errors thrown by the node typically contain the error message from the API or network layer.
    • If the node is set to continue on failure, errors will be returned in the output JSON under an error field.
  • Resolutions:

    • Verify the session ID is current and correctly entered.
    • Ensure reference image URLs are publicly accessible and properly formatted.
    • Adjust the timeout setting if image generation takes longer than expected.
    • Check network connectivity and API status.

Links and References

Discussion