Prompts of Fine-Tune

Learn about Prompts of Fine-Tunes. Create, retrieve, delete, and list Prompts.

The Prompt Model

The Prompt contains all the information you need about Prompt which generates the image results of a Fine-Tune.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier of the Prompt.

  • Name
    prompt
    Type
    string
    Description

    The prompt to generate on the Fine-Tune model. It must to include the Fine-Tune name, which identifies the trained object.

  • Name
    negative_prompt
    Type
    string
    Description

    The negative prompt to not generate some things, such as hands, or nudes.

  • Name
    cfg
    Type
    float
    Description

    Scale for classifier-free guidance (minimum: 1; maximum: 20).

  • Name
    steps
    Type
    integer
    Description

    Number of denoising steps (minimum: 1; maximum: 50).

  • Name
    seed
    Type
    integer
    Description

    Seed number to create random generations.

  • Name
    high_resolution
    Type
    boolean
    Description

    4K generated images. True to receive 4K images.

  • Name
    aspect_ratio
    Type
    string
    Description

    You can choose different Aspect Ratio to your output images, like square or portrait for social media.

  • Name
    images
    Type
    array
    Description

    The resulting images.

  • Name
    metadata
    Type
    JSON
    Description

    You can add metadata info about your Prompt like my_system_prompt_id, as well as other information you want to include to integrate it with your system.

  • Name
    error_message
    Type
    string
    Description

    An error message just in case any errors occur.


POST/v1/finetunes/:id/prompts

Add Prompts to Fine-Tune

This endpoint allows you to add prompts to a specific Fine-Tune.

Required attributes

  • Name
    prompt
    Type
    string
    Description

    The prompt required to generate on the Fine-Tune Model, It must to include the Fine-Tune name which identifies the trained object.

Optional attributes

  • Name
    negative_prompt
    Type
    string
    Description

    The negative prompt to not generate some things, like hands, or nudes.

  • Name
    cfg
    Type
    float
    Description

    Scale for classifier-free guidance (minimum: 1; maximum: 20).

  • Name
    steps
    Type
    integer
    Description

    Number of denoising steps (minimum: 1; maximum: 50).

  • Name
    seed
    Type
    integer
    Description

    Seed number to random generations.

  • Name
    high_resolution
    Type
    boolean
    Description

    4K generated images. True for receive 4K images.

  • Name
    aspect_ratio
    Type
    string
    Description

    You can choose different Aspect Ratio for your output images, like square or portrait for social media.

  • Name
    metadata
    Type
    JSON
    Description

    You can add metadata info about your Prompt, like my_system_prompt_id, and other information you want to include to integrate it with your system.

Request

POST
/v1/finetunes/:id/prompts
  curl --request POST \
    --url https://api.bodia.ai/v1/finetunes/{TUNE_ID}/prompts \  
    --header 'Authorization: Bearer {API_KEY}' \
    --data '[
      {
        "prompt": "A car on the route 99 road",
        "negative_prompt": "stones",
        "cfg": 7.5,
        "steps": 35,
        "seed": 2323,
        "high_resolution": true,
        "aspect_ratio": "square",
        "metadata": {
          "info": "example info I want to include"
        }
      },{
        "prompt": "A mediterranean portrait of a car driving in the mediterranean sea"
      }
    ]'

Response

[
  {
      "id": "ui7xBN30TS8_xZeR-I4QbJv3",
      "prompt": "A car on the route 99 road",
      "negative_prompt": "stones",
      "cfg": "7.50",
      "steps": 35,
      "seed": "2323",
      "error_message": null,
      "images": [],
      "metadata": {
          "info": "example info I want to include"
      },
      "created_at": "2023-02-15T12:41:19.178Z",
      "high_resolution": true,
      "aspect_ratio": "square"
  },
  {
      "id": "A-zKhoJBUqf4uV35tvxgFYTH",
      "prompt": "A mediterranean portrait of a car driving in the mediterranean sea",
      "negative_prompt": null,
      "cfg": "7.50",
      "steps": 45,
      "seed": "11",
      "error_message": null,
      "images": [],
      "metadata": null,
      "created_at": "2023-02-15T12:41:19.235Z",
      "high_resolution": false,
      "aspect_ratio": "square"
  }
]

POST/v1/finetunes/:id/styles

Add Styles to Fine Tune

This endpoint allows you to add styles or collections of styles for a specific Fine Tune. You can know more about Collections and Styles in the next section, but to summarize a Style is a Prompt with features like Cfg and Steps already defined.

Required attributes

  • Name
    id
    Type
    string
    Description

    Unique identifier for Collection or Style. If the Id is from a Collection, all Styles contained in that Collection will be used. On the other hand, in the case of being a Style Id, only that Style will be used.

Optional attributes

  • Name
    seed
    Type
    integer
    Description

    Seed number to random generations.

  • Name
    high_resolution
    Type
    boolean
    Description

    4K generated images. True for receive 4K images.

  • Name
    aspect_ratio
    Type
    string
    Description

    You can choose different Aspect Ratio to your output images, like square or portrait for social media.

  • Name
    metadata
    Type
    JSON
    Description

    You can add metadata info about your Prompt, like my_system_prompt_id, and other information you want to include to integrate it with your system.

Request

POST
/v1/finetunes/:id/styles
  curl --request POST \
    --url https://api.bodia.ai/v1/finetunes/{TUNE_ID}/styles \  
    --header 'Authorization: Bearer {API_KEY}' \
    --data '[          
      {
        "id": "Fn-3ZldnR24Hy0pNkSl32Tn7"
      },{
        "id": "YF1xORgvKIbHy-LeF1vvWYDp",
        "aspect_ratio": "portrait",
        "high_resolution": true,
        "seed": 2423,
        "metadata": {
          "info": "some info you want to include"
        }
      }
    ]'

Response

[
  {
      "id": "ui7xBN30TS8_xZeR-I4QbJv3",          
      "error_message": null,
      "images": [],          
      "created_at": "2023-02-15T12:41:19.178Z",          
  },
  {
      "id": "A-zKhoJBUqf4uV35tvxgFYTH",                                        
      "error_message": null,
      "images": [],
      "seed": "2423",
      "aspect_ratio": "portrait",
      "high_resolution": true,
      "seed": 2423,
      "metdata": {
        "info": "some info you want to include"
      },
      "created_at": "2023-02-15T12:41:19.235Z",          
  }
]

GET/v1/finetunes/:id/prompts

List Prompts of a Fine-Tune

This endpoint allows you to retrieve the prompts list of a Fine-Tune. Refer to Prompt Properties to see which properties are included inside the Fine-Tune objects.

Request

GET
/v1/finetunes/:id/prompts
curl -G https://api.bodia.ai/v1/finetunes/{TUNE_ID}/prompts \
  -H "Authorization: Bearer {API_KEY}"

Response

[
  {
    "id": "WAz8eIbvDR60rouK",
    "prompt": "A mediterranean portrait of a car driving in the mediterranean sea",        
    "negative_prompt": "rocks",
    "cfg": 7.5,
    "steps": 45,
    "seed": 11,
    "error_message": null,        
    "images": [
      "https://images.bodia.ai/gen1.jpg",
      "https://images.bodia.ai/gen2.jpg",
      "https://images.bodia.ai/gen3.jpg"
    ],
    "metadata": {
      "info": "example info I want to include"
    },       
    "created_at": "2023-02-07T23:55:37.584Z",
    "high_resolution": false,        
    "aspect_ratio": "square"
  }
]

GET/v1/finetunes/:id/prompts/:prompt_id

Retrieve a Prompt from a Fine-Tune

This endpoint allows you to retrieve a Prompt from a Fine-Tune by providing their IDs. Refer to the list at the top of this page to see which properties are included with Prompt objects.

Request

GET
/v1/finetunes/:id/prompts/:prompt_id
curl -G https://api.bodia.ai/v1/finetunes/{TUNE_ID}/prompts/{PROMPT_ID} \
  -H "Authorization: Bearer {API_KEY}"

Response

{
    "id": "WAz8eIbvDR60rouK",
    "prompt": "A mediterranean portrait of a car driving in the mediterranean sea",        
    "negative_prompt": "rocks",
    "cfg": 7.5,
    "steps": 45,
    "seed": 11,
    "error_message": null,        
    "images": [
      "https://images.bodia.ai/gen1.jpg",
      "https://images.bodia.ai/gen2.jpg",
      "https://images.bodia.ai/gen3.jpg"
    ],
    "metadata": {
      "info": "example info I want to include"
    },       
    "created_at": "2023-02-07T23:55:37.584Z",
    "high_resolution": false,        
    "aspect_ratio": "square"
  }

DELETE/v1/finetunes/:id/prompts/:prompt_id

Delete Prompt from a Fine-Tune

This endpoint allows you to delete one Prompt from a Fine-Tune.

Request

DELETE
/v1/finetunes/:id/prompts/:prompt_id
curl -X DELETE https://api.bodia.ai/v1/finetunes/{TUNE_ID}/prompts/{PROMPT_ID} \
  -H "Authorization: Bearer {API_KEY}"

Response

{
  "delete": "it has been deleted successfully"
}