github.com/instill-ai/component@v0.16.0-beta/pkg/connector/instill/v0/README.mdx (about) 1 --- 2 title: "Instill Model" 3 lang: "en-US" 4 draft: false 5 description: "Learn about how to set up a VDP Instill Model connector https://github.com/instill-ai/instill-core" 6 --- 7 8 The Instill Model component is an AI connector that allows users to connect the AI models served on the Instill Model Platform. 9 It can carry out the following tasks: 10 11 - [Classification](#classification) 12 - [Instance Segmentation](#instance-segmentation) 13 - [Keypoint](#keypoint) 14 - [Detection](#detection) 15 - [Ocr](#ocr) 16 - [Semantic Segmentation](#semantic-segmentation) 17 - [Text Generation](#text-generation) 18 - [Text Generation Chat](#text-generation-chat) 19 - [Text To Image](#text-to-image) 20 - [Visual Question Answering](#visual-question-answering) 21 - [Image To Image](#image-to-image) 22 23 ## Release Stage 24 25 `Alpha` 26 27 ## Configuration 28 29 The component configuration is defined and maintained [here](https://github.com/instill-ai/component/blob/main/pkg/connector/instill/v0/config/definition.json). 30 31 ## Supported Tasks 32 33 ### Classification 34 35 Classify images into predefined categories. 36 37 | Input | ID | Type | Description | 38 | :--- | :--- | :--- | :--- | 39 | Task ID (required) | `task` | string | `TASK_CLASSIFICATION` | 40 | Model Name (required) | `model_name` | string | The Instill Model model to be used. | 41 | Image (required) | `image_base64` | string | Image base64 | 42 43 | Output | ID | Type | Description | 44 | :--- | :--- | :--- | :--- | 45 | Category | `category` | string | The predicted category of the input. | 46 | Score | `score` | number | The confidence score of the predicted category of the input. | 47 48 ### Instance Segmentation 49 50 Detect, localize and delineate multiple objects in images. 51 52 | Input | ID | Type | Description | 53 | :--- | :--- | :--- | :--- | 54 | Task ID (required) | `task` | string | `TASK_INSTANCE_SEGMENTATION` | 55 | Model Name (required) | `model_name` | string | The Instill Model model to be used. | 56 | Image (required) | `image_base64` | string | Image base64 | 57 58 | Output | ID | Type | Description | 59 | :--- | :--- | :--- | :--- | 60 | Objects | `objects` | array[object] | A list of detected instance bounding boxes. | 61 62 ### Keypoint 63 64 Detect and localize multiple keypoints of objects in images. 65 66 | Input | ID | Type | Description | 67 | :--- | :--- | :--- | :--- | 68 | Task ID (required) | `task` | string | `TASK_KEYPOINT` | 69 | Model Name (required) | `model_name` | string | The Instill Model model to be used. | 70 | Image (required) | `image_base64` | string | Image base64 | 71 72 | Output | ID | Type | Description | 73 | :--- | :--- | :--- | :--- | 74 | Objects | `objects` | array[object] | A list of keypoint objects, a keypoint object includes all the pre-defined keypoints of a detected object. | 75 76 ### Detection 77 78 Detect and localize multiple objects in images. 79 80 | Input | ID | Type | Description | 81 | :--- | :--- | :--- | :--- | 82 | Task ID (required) | `task` | string | `TASK_DETECTION` | 83 | Model Name (required) | `model_name` | string | The Instill Model model to be used. | 84 | Image (required) | `image_base64` | string | Image base64 | 85 86 | Output | ID | Type | Description | 87 | :--- | :--- | :--- | :--- | 88 | Objects | `objects` | array[object] | A list of detected objects. | 89 90 ### Ocr 91 92 Detect and recognize text in images. 93 94 | Input | ID | Type | Description | 95 | :--- | :--- | :--- | :--- | 96 | Task ID (required) | `task` | string | `TASK_OCR` | 97 | Model Name (required) | `model_name` | string | The Instill Model model to be used. | 98 | Image (required) | `image_base64` | string | Image base64 | 99 100 | Output | ID | Type | Description | 101 | :--- | :--- | :--- | :--- | 102 | Objects | `objects` | array[object] | A list of detected bounding boxes. | 103 104 ### Semantic Segmentation 105 106 Classify image pixels into predefined categories. 107 108 | Input | ID | Type | Description | 109 | :--- | :--- | :--- | :--- | 110 | Task ID (required) | `task` | string | `TASK_SEMANTIC_SEGMENTATION` | 111 | Model Name (required) | `model_name` | string | The Instill Model model to be used. | 112 | Image (required) | `image_base64` | string | Image base64 | 113 114 | Output | ID | Type | Description | 115 | :--- | :--- | :--- | :--- | 116 | Stuffs | `stuffs` | array[object] | A list of RLE binary masks. | 117 118 ### Text Generation 119 120 Generate texts from input text prompts. 121 122 | Input | ID | Type | Description | 123 | :--- | :--- | :--- | :--- | 124 | Task ID (required) | `task` | string | `TASK_TEXT_GENERATION` | 125 | Model Name (required) | `model_name` | string | The Instill Model model to be used. | 126 | Prompt (required) | `prompt` | string | The prompt text | 127 | System message | `system_message` | string | The system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is using a generic message as "You are a helpful assistant." | 128 | Extra Parameters | `extra_params` | object | Extra Parameters | 129 | Prompt Images | `prompt_images` | array[string] | The prompt images | 130 | Chat history | `chat_history` | array[object] | Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : \{"role": "The message role, i.e. 'system', 'user' or 'assistant'", "content": "message content"\{. | 131 | Seed | `seed` | integer | The seed | 132 | Temperature | `temperature` | number | The temperature for sampling | 133 | Top K | `top_k` | integer | Top k for sampling | 134 | Max new tokens | `max_new_tokens` | integer | The maximum number of tokens for model to generate | 135 136 | Output | ID | Type | Description | 137 | :--- | :--- | :--- | :--- | 138 | Text | `text` | string | Text | 139 140 ### Text Generation Chat 141 142 Generate texts from input text prompts and chat history. 143 144 | Input | ID | Type | Description | 145 | :--- | :--- | :--- | :--- | 146 | Task ID (required) | `task` | string | `TASK_TEXT_GENERATION_CHAT` | 147 | Model Name (required) | `model_name` | string | The Instill Model model to be used. | 148 | Prompt (required) | `prompt` | string | The prompt text | 149 | System message | `system_message` | string | The system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is using a generic message as "You are a helpful assistant." | 150 | Extra Parameters | `extra_params` | object | Extra Parameters | 151 | Prompt Images | `prompt_images` | array[string] | The prompt images | 152 | Chat history | `chat_history` | array[object] | Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : \{"role": "The message role, i.e. 'system', 'user' or 'assistant'", "content": "message content"\{. | 153 | Seed | `seed` | integer | The seed | 154 | Temperature | `temperature` | number | The temperature for sampling | 155 | Top K | `top_k` | integer | Top k for sampling | 156 | Max new tokens | `max_new_tokens` | integer | The maximum number of tokens for model to generate | 157 158 | Output | ID | Type | Description | 159 | :--- | :--- | :--- | :--- | 160 | Text | `text` | string | Text | 161 162 ### Text To Image 163 164 Generate images from input text prompts. 165 166 | Input | ID | Type | Description | 167 | :--- | :--- | :--- | :--- | 168 | Task ID (required) | `task` | string | `TASK_TEXT_TO_IMAGE` | 169 | Model Name (required) | `model_name` | string | The Instill Model model to be used. | 170 | Prompt (required) | `prompt` | string | The prompt text | 171 | Extra Parameters | `extra_params` | object | Extra Parameters | 172 | CFG Scale | `cfg_scale` | number | The guidance scale, default is 7.5 | 173 | Samples | `samples` | integer | The number of generated samples, default is 1 | 174 | Seed | `seed` | integer | The seed, default is 0 | 175 | Steps | `steps` | integer | The steps, default is 5 | 176 177 | Output | ID | Type | Description | 178 | :--- | :--- | :--- | :--- | 179 | Images | `images` | array[string] | Images | 180 181 ### Visual Question Answering 182 183 Answer questions based on a prompt and an image. 184 185 | Input | ID | Type | Description | 186 | :--- | :--- | :--- | :--- | 187 | Task ID (required) | `task` | string | `TASK_VISUAL_QUESTION_ANSWERING` | 188 | Model Name (required) | `model_name` | string | The Instill Model model to be used. | 189 | Prompt (required) | `prompt` | string | The prompt text | 190 | System message | `system_message` | string | The system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is using a generic message as "You are a helpful assistant." | 191 | Extra Parameters | `extra_params` | object | Extra Parameters | 192 | Prompt Images (required) | `prompt_images` | array[string] | The prompt images | 193 | Chat history | `chat_history` | array[object] | Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : \{"role": "The message role, i.e. 'system', 'user' or 'assistant'", "content": "message content"\{. | 194 | Seed | `seed` | integer | The seed | 195 | Temperature | `temperature` | number | The temperature for sampling | 196 | Top K | `top_k` | integer | Top k for sampling | 197 | Max new tokens | `max_new_tokens` | integer | The maximum number of tokens for model to generate | 198 199 | Output | ID | Type | Description | 200 | :--- | :--- | :--- | :--- | 201 | Text | `text` | string | Text | 202 203 ### Image To Image 204 205 Generate image from input text prompt and image. 206 207 | Input | ID | Type | Description | 208 | :--- | :--- | :--- | :--- | 209 | Task ID (required) | `task` | string | `TASK_IMAGE_TO_IMAGE` | 210 | Model Name (required) | `model_name` | string | The Instill Model model to be used. | 211 | Prompt (required) | `prompt` | string | The prompt text | 212 | Extra Parameters | `extra_params` | object | Extra Parameters | 213 | Prompt Image (required) | `image_base64` | string | The prompt image | 214 | CFG Scale | `cfg_scale` | number | The guidance scale, default is 7.5 | 215 | Seed | `seed` | integer | The seed | 216 | Samples | `samples` | integer | The number of generated samples, default is 1 | 217 | Top K | `top_k` | integer | Top k for sampling | 218 219 | Output | ID | Type | Description | 220 | :--- | :--- | :--- | :--- | 221 | Images | `images` | array[string] | Images |