main
HuangHai 2 months ago
parent d3fd9bfda1
commit 709dab89f1

@ -32,3 +32,8 @@ API试用计划
# - LiblibAI自定义模型若需要特定LoRA和ControlNet只能选此模式适合高度自由、精准控制和特定风格的场景基于F.1/XL/v3/v1.5等基础算法支持自定义调用LiblibAI内全量30万+可商用模型和任意私有模型。最新开源模型和插件第一时间更新。模型挑选和商用查询可至本文档3.1或https://www.liblib.art/。
# 参考文档
https://liblibai.feishu.cn/wiki/UAMVw67NcifQHukf8fpccgS5n6d
https://www.liblib.art/workflows

@ -28,28 +28,28 @@ public class TextToImage {
public static void main(String[] args) throws ApiException, InterruptedException {
LibLib api = new LibLib(ak, sk);
GetModelVersionRequest getModelVersionRequest = new GetModelVersionRequest();
// Dream Tech XL | 筑梦工业XL
// https://www.liblib.art/modelinfo/5611e2f826be47f5b8c7eae45ed5434a?from=api&versionUuid=a57911b5dfe64c6aa78821be99367276
getModelVersionRequest.setVersionUuid("a57911b5dfe64c6aa78821be99367276");
VersionResponse modelVersion = api.getModelVersion(getModelVersionRequest);
if (modelVersion.getData().getCommercialUse() == CommercialUseEnum.CommercialUse) {
//显示模型信息
System.out.println(modelVersion);
}
TextToImageRequest request = new TextToImageRequest();
TextToImageRequestGenerateParams params = new TextToImageRequestGenerateParams();
params.checkPointId("a57911b5dfe64c6aa78821be99367276");
params.prompt("1 girl").imgCount(2);
params.cfgScale(7.5);
ControlNet controlNet = new ControlNet();
controlNet.width(1024).height(768);
Map<String, Object> annoParams = new HashMap<>();
Map<String, Object> cannyParams = new HashMap<>();
cannyParams.put("preprocessorResolution", 512);
annoParams.put("canny", cannyParams);
controlNet.unitOrder(1);
controlNet.model("efb97e9d8c237573298c3a5a7869b89c").preprocessor(1)
.sourceImage("https://liblibai-online.liblib.cloud/img/081e9f07d9bd4c2ba090efde163518f9/7c1cc38e-522c-43fe-aca9-07d5420d743e.png")
.annotationParameters(annoParams);
params.addControlNetItem(controlNet);
params.vaeId("2c1a337416e029dd65ab58784e8a4763");
//提示词
params.prompt("Candid 35mm shot capturing an extremely attractive young beauty wearing black knitted outfit with sunglasses sitting inside a bus by the window at sunset with Vancouver street view outside the bus, motion blur, cinematic expired slide film, warm color tone, highly detailed, ultra-high resolutions, 32K UHD, best quality, masterpiece")
.imgCount(1);//生成一张图片
// 参考图片右下方https://www.liblib.art/imageinfo/13ea5cca203f4ca59db98956e213aaf0
params.cfgScale(6.5);
params.setWidth(1024);
params.setHeight(768);
params.setSteps(35);
params.setSampler(7);
params.seed(567454062);
request.generateParams(params);
request.templateUuid("6f7c4652458d4802969f8d089cf5b91f");

Loading…
Cancel
Save