From d0c1dfab4dcfc2acd6464dfca7a7c941129c6740 Mon Sep 17 00:00:00 2001 From: Heiru Wu Date: Fri, 9 Aug 2024 03:55:11 +0800 Subject: [PATCH] chore: add text to image --- schema/ai-tasks.json | 177 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 175 insertions(+), 2 deletions(-) diff --git a/schema/ai-tasks.json b/schema/ai-tasks.json index b2a4e8b6..7f7e3f10 100644 --- a/schema/ai-tasks.json +++ b/schema/ai-tasks.json @@ -249,7 +249,7 @@ } }, "required": [ - "finish_reason", + "finish-reason", "index", "message", "created" @@ -482,7 +482,7 @@ } }, "required": [ - "finish_reason", + "finish-reason", "index", "content", "created" @@ -540,6 +540,179 @@ ] } }, + "TASK_TEXT_TO_IMAGE": { + "title": "Completion", + "instillShortDescription": "Generate text response base on input", + "input": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Completion input", + "description": "Input schema of the completion task", + "instillShortDescription": "Input schema of the completion task", + "type": "object", + "properties": { + "data": { + "description": "Input data", + "instillShortDescription": "Input data", + "type": "object", + "properties": { + "model": { + "description": "The model to be used.", + "instillShortDescription": "The model to be used.", + "instillAcceptFormats": [ + "string" + ], + "title": "Model Name", + "type": "string" + }, + "prompt": { + "title": "Input prompt", + "type": "string", + "description": "What you wish to see in the output image. A strong, descriptive prompt that clearly defines elements, colors, and subjects will lead to better results.", + "instillShortDescription": "Descriptive prompt.", + "instillAcceptFormats": [ + "string" + ] + } + }, + "required": [ + "model", + "prompt" + ] + }, + "parameter": { + "description": "Input parameter", + "instillShortDescription": "Input parameter", + "type": "object", + "properties": { + "aspect-ratio": { + "title": "Aspect ratio", + "type": "string", + "description": "Controls the aspect ratio of the generated image. Defaults to 1:1.", + "instillShortDescription": "Controls the aspect ratio of the generated image. Defaults to 1:1.", + "instillAcceptFormats": [ + "string" + ], + "default": "1:1", + "enum": [ + "16:9", + "1:1", + "21:9", + "2:3", + "3:2", + "4:5", + "5:4", + "9:16", + "9:21" + ] + }, + "negative-prompt": { + "title": "Aspect ratio", + "type": "string", + "description": "Keywords of what you do not wish to see in the output image.", + "instillShortDescription": "Keywords of what you do not wish to see in the output image.", + "instillAcceptFormats": [ + "string" + ], + "default": "1:1" + }, + "n": { + "title": "Number of choices", + "type": "integer", + "description": "How many samples to generate for each input prompt.", + "instillShortDescription": "How many samples to generate for each input prompt.", + "instillAcceptFormats": [ + "integer" + ], + "default": 1 + }, + "seed": { + "title": "Seed", + "type": "integer", + "description": "The seed, default is 0", + "instillShortDescription": "The seed, default is 0", + "instillAcceptFormats": [ + "integer" + ], + "default": 0 + } + } + } + }, + "required": [ + "data" + ] + }, + "output": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Chat output", + "description": "Output schema of the chat task", + "instillShortDescription": "Output schema of the chat task", + "type": "object", + "properties": { + "data": { + "description": "Output data", + "instillShortDescription": "Output data", + "type": "object", + "properties": { + "choices": { + "title": "Choices", + "type": "array", + "description": "List of generated sample images", + "instillShortDescription": "List of generated sample images", + "instillFormat": "array", + "items": { + "type": "object", + "properties": { + "finish-reason": { + "title": "Finish reason", + "type": "string", + "description": "The reason the model stopped generating tokens.", + "instillShortDescription": "The reason the model stopped generating tokens.", + "instillFormat": "string", + "enum": [ + "content_filtered", + "success" + ] + }, + "image": { + "title": "Image", + "type": "string", + "description": "The generated image, encoded to base64.", + "instillShortDescription": "The generated image, encoded to base64.", + "instillFormat": "string" + } + }, + "required": [ + "finish-reason", + "image" + ] + } + } + }, + "required": [ + "choices" + ] + }, + "metadata": { + "description": "Output metadata", + "instillShortDescription": "Output metadata", + "type": "object", + "properties": { + "usage": { + "description": "Usage statistics for the request.", + "instillShortDescription": "Usage statistics for the request.", + "type": "object", + "properties": {}, + "required": [] + } + } + } + }, + "required": [ + "data" + ] + } + }, "TASK_CLASSIFICATION": { "title": "Classification", "instillShortDescription": "Classify images into predefined categories.",