|
|
|
@ -3,10 +3,27 @@ package com.dsideal.aiSupport.Util.Liblib;
|
|
|
|
|
import cloud.liblibai.client.LibLib;
|
|
|
|
|
import cloud.liblibai.openapi.client.ApiException;
|
|
|
|
|
import cloud.liblibai.openapi.client.model.*;
|
|
|
|
|
import com.dsideal.aiSupport.Plugin.YamlProp;
|
|
|
|
|
import com.jfinal.kit.Prop;
|
|
|
|
|
|
|
|
|
|
import static com.dsideal.aiSupport.AiSupportApplication.getEnvPrefix;
|
|
|
|
|
|
|
|
|
|
public class TextToImageUltra {
|
|
|
|
|
// API访问凭证
|
|
|
|
|
protected static final String ak; // Access Key
|
|
|
|
|
protected static final String sk; // Secret Key
|
|
|
|
|
public static Prop PropKit; // 配置文件工具
|
|
|
|
|
|
|
|
|
|
static {
|
|
|
|
|
//加载配置文件
|
|
|
|
|
String configFile = "application_{?}.yaml".replace("{?}", getEnvPrefix());
|
|
|
|
|
PropKit = new YamlProp(configFile);
|
|
|
|
|
ak = PropKit.get("LIBLIB.accessKey"); // 从配置文件获取Access Key
|
|
|
|
|
sk = PropKit.get("LIBLIB.secretKey"); // 从配置文件获取Secret Key
|
|
|
|
|
}
|
|
|
|
|
public static void main(String[] args) throws ApiException, InterruptedException {
|
|
|
|
|
LibLib api = new LibLib();
|
|
|
|
|
LibLib api = new LibLib(ak, sk);
|
|
|
|
|
//https://liblibai.feishu.cn/wiki/UAMVw67NcifQHukf8fpccgS5n6d
|
|
|
|
|
TextToImageUltraRequest request = new TextToImageUltraRequest();
|
|
|
|
|
request.templateUuid("5d7e67009b344550bc1aa6ccbfa1d7f4");
|
|
|
|
|
TextToImageUltraRequestGenerateParams params = new TextToImageUltraRequestGenerateParams();
|
|
|
|
|