AI-YIAPI-全球AI分发站
  1. SDXL & SD1.6
AI-YIAPI-全球AI分发站
  • 关于我们
  • Open AI
    • gpt-4-all(生成图片)
    • 内容补全接口
    • DALL·E 3
    • 创建嵌入
    • 创建转录
    • 创建翻译
    • TTS文本转语音
    • 合并音乐
  • InsightFace任务提交
    • 提交swap_face任务
  • 任务管理
    • 任务查询
  • Midjourney接口
    • 任务提交
      • 执行动作
      • 提交Blend任务
      • 提交Describe任务
      • 提交Imagine任务
      • 提交Modal
      • 提交Shorten任务
    • 任务查询
      • 指定ID获取任务
      • 获取任务图片的seed(需设置mj或niji的私信ID)
  • 暂时未启用
    • Generate
      • Stable Image Ultra
      • Stable Image Core
      • Stable Diffusion 3
    • SDXL & SD1.6
      • Text-to-image
        POST
    • styles
      • 创建样式
    • images
      • 生成图像
      • 图像矢量化
      • 移除背景
      • 清晰度提升
      • 生成式放大
    • 视频生成
      • 图生视频
    • 生成音乐
      POST
    • 获取音乐
      GET
    • 生成音乐
      POST
    • 获取音乐
      GET
    • flux-pro-1.1
      POST
    • flux-pro
      POST
    • flux-dev
      POST
    • flux-查询
      GET
    • Generate(文生图)
      POST
    • Remix(混合图)
      POST
    • Upscale(放大高清)
      POST
    • Describe(描述)
      POST
    • 图像生成
      POST
    • 文生视频
      POST
    • 图生视频
      POST
    • 查询任务
      GET
    • 获取视频
      GET
    • 生成视频
      POST
    • 图片描述
      POST
    • 文生图
      POST
    • 合成图
      POST
    • 放大图片
      POST
    • ideogram任务查询
      POST
    • CogVideoX视频生成
      POST
    • CogVideoX视频查询
      GET
    • Mix上传视频并生成视频
      POST
    • 查询视频任务
      GET
    • Multi模板列表
      GET
    • Mix官方模板列表
      GET
    • Mix上传视频素材库
      GET
    • Mix上传图片素材库
      GET
    • 剩余积分查询
      GET
    • Multi上传视频并生成视频
      POST
    • Move上传视频并生成视频
      POST
  • 数据模型
    • Schemas
      • AccountChooseRule
      • 401
      • AccountFilter
      • 403
      • AliyunOssOptions
      • 404
      • AutoLoginRequest
      • 500
      • BaiduTranslateConfig
      • Blend提交参数
      • BannedLimitingOptions
      • TaskResponse
      • BannedWord
      • CheckActivationDTO
      • BannedWordStandardTableParam
      • ErrorResponse
      • BannedWordStandardTableResult
      • BaseCreateCompletionRequest
      • BlendDimensions
      • Describe提交参数
      • CaptchaVerfyRequest
      • ImagePosition
      • CloudflareR2Options
      • Discord账号
      • Component
      • ChatMessageContent
      • CustomComponentModel
      • Filter
      • DatabaseType
      • Imagine提交参数
      • DiscordAccount
      • ChatCompletionRequestMessage
      • DiscordAccountConfig
      • Map«string,object»
      • DiscordAccountResult
      • Message«Discord账号»
      • DiscordAccountStandardTableParam
      • ChatCompletionResponseMessage
      • DiscordAccountStandardTableResult
      • Message«Map«string,object»»
      • DomainTag
      • Message«Void»
      • DomainTagStandardTableParam
      • ChatCompletionMessageToolCalls
      • DomainTagStandardTableResult
      • Message«string»
      • EBotType
      • Modal提交参数
      • EUserRole
      • ChatCompletionMessageToolCall
      • EUserStatus
      • Emoji
      • Pageable
      • GenerationSpeedMode
      • UsageInfo
      • HomeDto
      • Page«Map«string,object»»
      • HomeDtoResult
      • Page«任务»
      • ImageStorageType
      • ChatCompletionTool
      • InsightFaceSwapDto
      • Shorten提交参数
      • IpBlackRateLimitingOptions
      • Sort
      • IpRateLimitingOptions
      • CreateChatCompletionExclusiveFields
      • LocalStorageOptions
      • SwapFace提交参数
      • MjPlusMigrationDto
      • TaskQueryDTO
      • NgDiscordConfig
      • FunctionObject
      • OpenaiConfig
      • 任务
      • Option
      • 任务查询参数
      • ProxyConfig
      • FunctionParameters
      • RegisterDto
      • 变化任务提交参数
      • ReplicateOptions
      • 变化任务提交参数-simple
      • Result
      • GenerationID
      • SelectOption
      • 可执行按钮
      • SelectOptionListResult
      • 可执行按钮_1
      • Setting
      • ImageToVideoRequest
      • SettingResult
      • 执行动作参数
      • SmtpConfig
      • 提交结果
      • StandardSort
      • ContentModerationResponse
      • StandardTablePagination
      • 激活服务参数
      • StandardTablePaginationRequest
      • 账号修改参数
      • SubmitActionDTO
      • InpaintingSearchModeRequestBody
      • SubmitBlendDTO
      • 账号创建参数
      • SubmitChangeDTO
      • 账号查询参数
      • SubmitDescribeDTO
      • InpaintingMaskingModeRequestBody
      • SubmitImagineDTO
      • 账号筛选条件
      • SubmitModalDTO
      • Creativity
      • SubmitResultVO
      • Engine
      • SubmitShowDTO
      • Error
      • SubmitSimpleChangeDTO
      • CfgScale
      • SubmitUploadDiscordDto
      • ClipGuidancePreset
      • TaskAction
      • UpscaleImageHeight
      • TaskConditionDTO
      • UpscaleImageWidth
      • TaskInfo
      • DiffuseImageHeight
      • TaskInfoStandardTableParam
      • DiffuseImageWidth
      • TaskInfoStandardTableResult
      • Sampler
      • TaskStatus
      • Samples
      • TencentCosOptions
      • Seed
      • TranslateWay
      • Steps
      • User
      • Extras
      • UserStandardTableParam
      • StylePreset
      • UserStandardTableResult
      • TextPrompt
      • TextPrompts
      • TextPrompts
      • InputImage
      • InitImage
      • InitImageStrength
      • InitImageMode
      • StepScheduleStart
      • StepScheduleEnd
      • MaskImage
      • MaskSource
      • GenerationRequestOptionalParams
      • RealESRGANUpscaleRequestBody
      • ImageToImageRequestBody
      • ImageToImageUsingImageStrengthRequestBody
      • ImageToImageUsingStepScheduleRequestBody
      • MaskingRequestBody
      • MaskingUsingMaskImageRequestBody
      • MaskingUsingInitImageAlphaRequestBody
      • TextToImageRequestBody
      • AccountResponseBody
      • BalanceResponseBody
      • ListEnginesResponseBody
      • FinishReason
      • Image
      • OrganizationMembership
      • GenerationResponse
      • 400FromGeneration
      • 400FromUpscale
  1. SDXL & SD1.6

Text-to-image

POST
/sd/v1/generation/stable-diffusion-xl-1024-v1-0/text-to-image
Generate an image from a text prompt.

Using SDXL 1.0#

Use stable-diffusion-xl-1024-v1-0 as the engine_id of your request and pass in height & width as one of the following combinations:
1024x1024
1152x896
896x1152
1216x832
1344x768
768x1344
1536x640
640x1536.

Using SD 1.6#

Pass in stable-diffusion-v1-6 as the engine_id of your request and ensure the height & width you pass in adhere to the following restrictions:
No dimension can be less than 320 pixels
No dimension can be greater than 1536 pixels

Using SD Beta#

Pass in stable-diffusion-xl-beta-v2-2-2 as the engine_id of your request and ensure the height & width you pass in adhere to the following restrictions:
dimensions must be between 128x128 and 512x896 (or 896x512)
only one dimension can be greater than 512, but not both
NOTE: Only Version 1 engines will work with this endpoint.

请求参数

Authorization
Bearer Token
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
or
Header 参数

Body 参数application/json

示例
{
    "cfg_scale": 7,
    "height": 512,
    "width": 512,
    "sampler": "K_DPM_2_ANCESTRAL",
    "samples": 1,
    "steps": 30,
    "text_prompts": [
        {
            "text": "A lighthouse on a cliff",
            "weight": 1
        }
    ]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/sd/v1/generation/stable-diffusion-xl-1024-v1-0/text-to-image' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "cfg_scale": 7,
    "height": 512,
    "width": 512,
    "sampler": "K_DPM_2_ANCESTRAL",
    "samples": 1,
    "steps": 30,
    "text_prompts": [
        {
            "text": "A lighthouse on a cliff",
            "weight": 1
        }
    ]
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "artifacts": [
        [
            {
                "base64": "...very long string...",
                "finishReason": "SUCCESS",
                "seed": 1050625087
            },
            {
                "base64": "...very long string...",
                "finishReason": "CONTENT_FILTERED",
                "seed": 1229191277
            }
        ]
    ]
}
🟠400请求有误
🟠401没有权限
🟠403禁止访问
🟠404记录不存在
🔴500服务器错误
修改于 2025-04-07 07:23:29
上一页
Stable Diffusion 3
下一页
创建样式
Built with