Cloudflare AI icon

Cloudflare AI

Use Cloudflare Workers AI models for text, image, and audio processing

Overview

This node integrates with Cloudflare's AI services to perform various AI-powered tasks on text, images, audio, and embeddings. Specifically for the Image Classification operation, it allows users to classify images using a pre-trained AI model hosted by Cloudflare.

Typical use cases include:

  • Automatically categorizing images into predefined classes (e.g., identifying objects or scenes).
  • Enhancing workflows that require image content analysis without manual tagging.
  • Integrating image recognition capabilities into automation pipelines.

For example, you could feed an image from a previous node and get back labels describing its content, which can then be used to trigger different actions based on the classification result.

Properties

Name Meaning
Binary Property The name of the binary property containing the image data to classify. Default is data.

Output

The node outputs JSON data representing the classification results returned by the Cloudflare AI model. The structure typically includes:

  • A success flag indicating if the request was successful.
  • A result object containing the classification details such as predicted labels and confidence scores.

If the classification fails, the output will contain error information.

No binary data is output for the classification operation; only JSON metadata about the image classification is returned.

Dependencies

  • Requires a valid Cloudflare API key credential with access to the Cloudflare AI endpoints.
  • The node makes HTTP POST requests to Cloudflare's AI API endpoint specific to the account ID.
  • The input image must be provided as binary data in the specified binary property.

Troubleshooting

  • Common issues:

    • Incorrect binary property name: Ensure the binary property name matches the actual binary data field containing the image.
    • Invalid or missing API credentials: Verify that the Cloudflare API key and account ID are correctly configured.
    • Network or permission errors when calling the Cloudflare API.
  • Error messages:

    • "Request failed": Indicates the API call did not succeed. Check the error message returned by the API for details.
    • Errors related to missing binary data or invalid image format may occur if the input data is not properly set.
  • To resolve errors, verify credentials, confirm the binary property contains valid image data, and ensure network connectivity to Cloudflare's API.

Links and References

Discussion