LiblibAI icon

LiblibAI

基于星流Star-3 Alpha模型的AI图片生成服务

文生图

AI-generated

Summary

Generate images from text prompts or reference images.

Inputs

  • prompt (required) — The positive text prompt for image generation, in English, not exceeding 2000 characters.
  • imgCount — The number of images to generate in a single request, between 1 and 4.
  • sizeMode — Configuration mode for size, either 'aspectRatio' for predefined ratios or 'custom' for specific width and height.
  • aspectRatio — The image aspect ratio, selectable from square, portrait, or landscape if using aspectRatio mode.
  • imageWidth — Custom image width, between 512 and 2048 pixels, applicable if sizeMode is set to custom.
  • imageHeight — Custom image height, between 512 and 2048 pixels, applicable if sizeMode is set to custom.
  • enableAdvancedSettings — Whether to enable advanced parameter settings.
  • steps — The number of sampling steps for image generation, suggested to be 30, between 10 and 100.
  • enableControlNet — Whether to enable composition control functionality.
  • controlType — Type of ControlNet to be applied, such as line, depth, pose, IPAdapter, or subject.
  • controlImage (required) — URL of the reference image used for ControlNet.
  • waitForCompletion — Indicates whether to wait for the image generation task to complete before returning results.
  • maxWaitTime — Maximum time to wait for task completion, in seconds, with a minimum of 30 seconds.
  • pollInterval — Interval time, in seconds, for polling the task status.

Output shape

a list of generated images or task status details

The response includes success status and, if applicable, image data or task UUID for checking status.

Examples

Example 1: Generate an image based on a prompt

Set prompt to '1 girl, masterpiece, best quality', imgCount to 2, waitForCompletion to true.

Example 2: Generate an image from a reference image

Set sourceImage for image-to-image processing, enableControlNet to true, and specify controlImage.

Discussion