Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Request for Assistance with Vertex AI Image Editing API Endpoint URL

Hello everyone

I am writing to request assistance with identifying the correct API endpoint URL for the Vertex AI image editing functionality, specifically the imagegeneration@002 model.

I am currently working on a project that involves image editing using the aforementioned model. While I have found success using the Vertex AI SDK in Python, I am facing challenges replicating the functionality in a Node environment due to the lack of a dedicated SDK.

My goal is to directly call the API endpoint URL using Node.js and Axios. However, I have been unable to find clear documentation outlining the specific endpoint URL format for image editing requests.

I have attempted to analyze network traffic using WireShark and explore the Vertex AI documentation, but I haven't been able to determine the exact URL structure.

Information I have gathered so far:

I am using the imagegeneration@002 model for image editing.

My Python code successfully utilizes the Vertex AI SDK for image editing.

My Node code attempts to call an API endpoint URL using Axios, but I suspect the URL format might be incorrect.

WireShark captures indicate a TLS connection to "europe-west9-aiplatform...", from python request, but the specific API endpoint path remains unclear.

Request:

I would greatly appreciate it if you could provide guidance on the following:

The correct API endpoint URL format for image editing requests using the imagegeneration@002 model.

Any relevant documentation or resources that could help me understand the API structure and usage.

Recommendations for Node.js libraries or tools that could facilitate interaction with the Vertex AI image editing API.

Thank you for your time and assistance. I look forward to your response.

0 1 3,547
1 REPLY 1

To utilize the Vertex AI image editing functionality, specifically the imagegeneration@002 model, you'll need to interact with Google Cloud's AI Platform. The API endpoint URL format typically follows the standard pattern for Google Cloud services.

You'll need to enable the Vertex AI API and set up authentication credentials to authorize your requests.

Once you have your authentication set up, you can use the following steps to construct the API endpoint URL:

  1. Determine the regional endpoint: Since you mentioned observing traffic to "europe-west9-aiplatform...", it seems you're working in the European region. You'll need to find the correct regional endpoint for your project. Typically, for Vertex AI, the endpoint follows the pattern {region}-aiplatform.googleapis.com.

  2. Construct the model-specific path: For the imagegeneration@002 model, the path will depend on how it's deployed within your Vertex AI environment. If you're using a custom model, you'll need to provide the version ID as well. The path typically follows /v1/{parent=projects/*/locations/*}/models/{model}/versions/{version}:predict, where {model} and {version} correspond to your specific model and version.

  3. Include any necessary parameters: Depending on your specific use case and the requirements of the model, you may need to include additional parameters in your request, such as the input image data, desired edits, etc. These will typically be included in the request body as JSON.

Given these steps, you can construct the complete API endpoint URL for making predictions with your imagegeneration@002 model.

As for resources and documentation:

  • Google Cloud documentation: The official documentation for Vertex AI provides detailed information on using the API, including constructing requests and managing models. You can find the documentation here.
  • Sample code and tutorials: Google Cloud often provides sample code and tutorials for using their services, including Vertex AI. These can be valuable resources for understanding best practices and getting started quickly. You can find tutorials and sample code in the documentation linked above.
  • Community forums and support: If you encounter specific issues or have questions while working with Vertex AI, the Google Cloud community forums and support channels can be helpful resources. You can ask questions and seek assistance from experts and other users who may have encountered similar challenges.

For Node.js libraries or tools to facilitate interaction with the Vertex AI image editing API:

  • Google Cloud Client Libraries for Node.js: While there might not be a dedicated SDK for Vertex AI in Node.js at the moment, you can still use the Google Cloud Client Libraries for Node.js to interact with Google Cloud services, including Vertex AI. These libraries provide idiomatic Node.js bindings for Google Cloud APIs and can simplify your code by handling authentication and other common tasks.