LiblibAI API
- API version: 1.0.0
- Build date: 2025-01-21T17:23:45.937473883+08:00[Asia/Shanghai]
- Generator version: 7.10.0
LiblibAI x 星流 图像大模型API
Automatically generated by the OpenAPI Generator
Building the API client library requires:
- Java 1.8+
- Maven (3.8.3+)/Gradle (7.2+)
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deploy
Refer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>cloud.liblibai.openapi</groupId>
<artifactId>java-sdk</artifactId>
<version>0.0.9</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
repositories {
mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central.
mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo.
}
dependencies {
implementation "cloud.liblibai.openai:java-sdk:0.0.9"
}
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/openapi-java-client-1.0.0.jar
target/lib/*.jar
Set LIBLIB_ACCESS_KEY and LIBLIB_SECRET_KEY enviroments, or pass AccessKey and SecretKey argument
Please follow the installation instruction and execute the following Java code:
import cloud.liblibai.client.LibLib;
import cloud.liblibai.openapi.client.ApiException;
import cloud.liblibai.openapi.client.model.*;
public class Example {
public static void main(String[] args) throws ApiException, InterruptedException {
LibLib api = new LibLib(); //Read LIBLIB_ACCESS_KEY and LIBLIB_SECRET_KEY from env
//LibLib api = new LibLib("access_key", "secret_key")
TextToImageRequest request = new TextToImageRequest();
TextToImageRequestGenerateParams params = new TextToImageRequestGenerateParams();
params.prompt("1 girl").imgCount(2);
request.generateParams(params);
request.templateUuid("6f7c4652458d4802969f8d089cf5b91f");
//NOTE(gz): 异步 SDK 调用方法
SubmitResponse submitResponse = api.submitTextToImage(request);
while(true) {
StatusResponse status = api.getStatus(new StatusRequest().generateUuid(submitResponse.getData().getGenerateUuid()));
System.out.println(status);
if (status.getData().getGenerateStatus() == GenerateStatus.SUCCEED) {
System.out.println(status.getData().getImages());
break;
}
Thread.sleep(5000);
}
//NOTE(gz): 同步 SDK 调用方法
StatusResponseData statusResponseData = api.textToImage(request);
if (statusResponseData.getGenerateStatus() == GenerateStatus.SUCCEED) {
System.out.println(statusResponseData.getImages());
}
}
}
All URIs are relative to https://openapi.liblibai.cloud
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | getComfyStatus | POST /api/generate/comfy/status | 查询 comfy 生图结果 |
DefaultApi | getModelVersion | POST /api/model/version/get | 查询模型版本参数 |
DefaultApi | getStatus | POST /api/generate/webui/status | 查询生图任务状态 |
DefaultApi | submitComfyTask | POST /api/generate/comfyui/app | 提交 ComfyUI 工作流生图任务 |
DefaultApi | submitImageToImage | POST /api/generate/webui/img2img | 提交图生图任务 |
DefaultApi | submitTextToImage | POST /api/generate/webui/text2img | 提交文生图任务 |
DefaultApi | submitTextToImageUltra | POST /api/generate/webui/text2img/ultra | 星流Star-3 Alpha 文生图 |
DefaultApi | submitImageToImageUltra | POST /api/generate/webui/img2img/ultra | 星流Star-3 Alpha 图生图 |
- AdditionalNetwork
- AuditStatus
- ComfyNodeParams
- ComfyRequest
- ComfyStatusResponse
- ComfyStatusResponseData
- ComfyStatusResponseDataVideosInner
- ControlNet
- GenerateStatus
- GetModelVersion400Response
- GetModelVersion404Response
- GetModelVersionRequest
- Image
- ImageToImageRequest
- ImageToImageRequestGenerateParams
- NodeImage
- StatusResponse
- StatusResponseData
- SubmitComfyResponse
- SubmitComfyResponseData
- SubmitResponse
- SubmitResponseData
- TextToImageRequest
- TextToImageRequestGenerateParams
- TextToImageRequestGenerateParamsHiResFixInfo
- TextToImageRequestGenerateParamsInpaintParam
- TextToImageUltraRequest
- TextToImageUltraRequestGenerateParams
- TextToImageUltraRequestGenerateParamsImageSize
- UltraControlNet
- VersionResponse
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: AccessKey
- Location: URL query string
通过 new LibLib() 来调用 API, 不建议使用 DefaultApi 来调用