Img2text
To deploy the model, you can use the identifier below:
- Img2text laion:
img2text-laion
Pass a base64 encoded image to the model and receive specialized prompts that work well with Stable Diffusion 2. Once you’ve deployed a model, you can follow this example of how to call the deployed endpoint:
Request Parameters
curl --location --request POST 'https://run.cerebrium.ai/img2text-laion-webhook/predict' \
--header 'Authorization: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"image": "<BASE_64_STRING>"
"webhook_endpoint": "https://your-url.com"
}'
This is the Cerebrium API key used to authenticate your request. You can get it from your Cerebrium dashboard.
This is a base64 encoded string of your initial image. This is a required parameter.
The url endpoint you would like us to send the image results to once it has finished generating.
{
"run_id": "<UUID_STRING>",
"run_time_ms": 500
"message": "Successfully generated text",
"result": "a man in a suit holding a camera, light stubble with red shirt, mateo dineen, vp of marketing, miro, speech, slight friendly smile, photo taken in 2018, xiaofan zhang, young male, charlie cox, 2014, more details, amber, very consistent, very detailed picture, front facing, awarded, 3 meters"
}
Response Parameters
A unique identifier for the run that you can use to associate prompts with webhook endpoints.
The amount of time in millisecond it took to run your function. This is what you will be billed for.
Whether of not the response was successful
The prompt generated by the model based on your input image
curl --location --request POST 'https://run.cerebrium.ai/img2text-laion-webhook/predict' \
--header 'Authorization: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"image": "<BASE_64_STRING>"
"webhook_endpoint": "https://your-url.com"
}'
{
"run_id": "<UUID_STRING>",
"run_time_ms": 500
"message": "Successfully generated text",
"result": "a man in a suit holding a camera, light stubble with red shirt, mateo dineen, vp of marketing, miro, speech, slight friendly smile, photo taken in 2018, xiaofan zhang, young male, charlie cox, 2014, more details, amber, very consistent, very detailed picture, front facing, awarded, 3 meters"
}