You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
[FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
Please do not modify this template :) and fill in all the required fields.
1. Is this request related to a challenge you're experiencing? Tell me about your story.
I created a custom tool that can connect to the Litellm gateway to create a model of text and graphics. When the graphics are generated, they are returned in b64_json format and cannot be displayed directly if they are not binary. The second issue is that the returned string is too large and restricted
openapi: 3.1.0
info:
title: Dify Custom Image Generation API
version: 1.0.0
servers:
- url: https://litellm.test.co/v1
components:
schemas:
ImageGenerationRequest:
type: object
properties:
prompt:
type: string
description: A text description of the desired image.
maxLength: 2048
size:
type: string
description: The size of the generated image, default is 1024x1024.
enum: ["1024x1024", "720x1280", "1280x720"]
required:
- prompt
ImageGenerationResponse:
type: object
properties:
created:
type: integer
format: int64
description: The timestamp of when the image was created.
data:
type: array
items:
type: object
properties:
b64_json:
type: string
format: byte
description: Base64 encoded image data.
detail:
type: string
description: Additional details about the image generation process.
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
paths:
/images/generations:
post:
summary: Generate an image from a text prompt
description: Creates an image from a given text prompt using the specified model.
operationId: generateImage
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
model:
type: string
const: txt2img
prompt:
type: string
description: A text description of the desired image.
maxLength: 2048
size:
type: string
description: The size of the generated image, default is 1024x1024.
enum: ["1024x1024", "720x1280", "1280x720"]
required:
- prompt
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/ImageGenerationResponse'
'400':
description: Bad request
'401':
description: Unauthorized
security:
- bearerAuth: []
security:
- bearerAuth: []
2. Additional context or comments
Can anyone help solve this problem? Thank you very much
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
I created a custom tool that can connect to the Litellm gateway to create a model of text and graphics. When the graphics are generated, they are returned in b64_json format and cannot be displayed directly if they are not binary. The second issue is that the returned string is too large and restricted
2. Additional context or comments
Can anyone help solve this problem? Thank you very much
Beta Was this translation helpful? Give feedback.
All reactions