Image to Prompt

This API extracts information from a given image and user input to generate a detailed prompt description for creating a poster. Note: This API typically requires approximately 15 seconds to process and return a response.

API Endpoint

POST https://api.genaifactory.ai/v1/image_to_prompt

Headers

Name
Type
Required
Description

formacloud-api-key

string

Yes

API key for authentication

Request Body

Name
Type
Required
Description

user_input

string

Yes

The user’s input text describing requirements (max 200 characters)

referring_image

file

No

The image file to be used for inspiration

referring_image_url

string

No

URL of the image to be used for inspiration

Note: referring_image and referring_image_url cannot be provided together.

Example Request

curl --location 'https://api.genaifactory.ai/v1/image_to_prompt' \
--header 'formacloud-api-key: abc123' \
--header 'Content-Type: application/json' \
--form  'user_input="Help me extract the contents of the entire image"'\
--form  'referring_image_url="https://example.com/inspiration_image.jpg"'

Response

Returns a JSON object containing the generated detailed prompt description.

Field
Type
Description

image_to_prompt

string

Detailed prompt text generated by the API

Example Response

{
  "image_to_prompt": "In this picture, you can see a winding \"river\" made of white rice grains, with a black background forming the outline of the river. In the center of the river, there is a lonely black figure walking on the river, giving people a feeling of walking alone, thinking or reminiscing. At the bottom right of the picture, there are Chinese words: \"The long river of time always has some people worth remembering\", and the English translation: "THERE ARE ALWAYS SOME PEOPLE WORTH REMEMBERING". \n\nThe content of this picture conveys a feeling of time passing, nostalgia and gratitude. The overall color tone is mainly white and black, simple but meaningful. The whole picture indicates that people move forward in the long river of time. Although the years are ruthless, there are always some people who are worth remembering and remembering."
}

Last updated