Files
dsProject/dsLightRag/Liblib/T2.py
2025-09-04 10:59:06 +08:00

32 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from Liblib.LibLibGenerator import LibLibGenerator
if __name__ == '__main__':
generate_params = {
"templateUuid": "6f7c4652458d4802969f8d089cf5b91f", # 参数模板ID F.1文生图
"generateParams": {
"prompt": "filmfotos, Asian portrait,A young woman wearing a green baseball cap,covering one eye with her hand",
"steps": 20, # 采样步数
"width": 768, # 宽
"height": 1024, # 高
"imgCount": 1, # 图片数量
"seed": -1, # 随机种子值,-1 表示随机
"restoreFaces": 0, # 面部修复0 关闭1 开启
# Lora添加最多5个不添加lora时请删除此结构体
"additionalNetwork": [
{
"modelId": "169505112cee468b95d5e4a5db0e5669", # LoRA的模型版本uuid
"weight": 1.0 # LoRA权重
}
]
}
}
liblib = LibLibGenerator()
# 调用生成接口
response = liblib.post_request(
"/api/generate/webui/text2img",
generate_params
)
# {'generateUuid': 'f16463d55e144214ae12d5177f8256fc'}
print(response)