feat: +openai text-to-image

This commit is contained in:
莘权 马 2023-08-17 21:51:50 +08:00
parent eb232efdfc
commit 60245fbe90
3 changed files with 143 additions and 5 deletions

View file

@ -59,6 +59,44 @@ paths:
result:
type: string
'400':
description: Bad Request
description: "Bad Request"
'500':
description: Bad Request
description: "Internal Server Error"
/txt2img/openai:
post:
summary: "Convert Text to Base64-encoded Image Data Stream"
operationId: openai_text_2_image.oas3_openai_text_2_image
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
text:
type: string
description: "The text used for image conversion."
size_type:
type: string
enum: ["256x256", "512x512", "1024x1024"]
default: "1024x1024"
description: "Size of the generated image."
openai_api_key:
type: string
default: ""
description: "OpenAI API key, For more details, checkout: `https://platform.openai.com/account/api-keys`"
responses:
'200':
description: "Base64-encoded image data."
content:
application/json:
schema:
type: object
properties:
image_data:
type: string
'400':
description: "Bad Request"
'500':
description: "Internal Server Error"