2025-09-04 11:30:58 +08:00
|
|
|
|
from Liblib.Kit.LibLibGenerator import LibLibGenerator
|
2025-09-04 11:09:36 +08:00
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
liblib = LibLibGenerator()
|
2025-09-04 11:27:59 +08:00
|
|
|
|
|
|
|
|
|
# 设置高分辨率修复参数
|
|
|
|
|
hi_res_fix_info = {
|
|
|
|
|
"hiresSteps": 20,
|
|
|
|
|
"hiresDenoisingStrength": 0.75,
|
|
|
|
|
"upscaler": 10,
|
|
|
|
|
"resizedWidth": 1024,
|
|
|
|
|
"resizedHeight": 1536
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# 调用自定义Checkpoint方法进行文生图
|
|
|
|
|
result = liblib.generate_custom_checkpoint_text_to_image(
|
|
|
|
|
template_uuid="e10adc3949ba59abbe56e057f20f883e",
|
|
|
|
|
checkpoint_id="0ea388c7eb854be3ba3c6f65aac6bfd3",
|
|
|
|
|
prompt="Asian portrait,A young woman wearing a green baseball cap,covering one eye with her hand",
|
|
|
|
|
negative_prompt="ng_deepnegative_v1_75t,(badhandv4:1.2),EasyNegative,(worst quality:2),",
|
|
|
|
|
sampler=15,
|
|
|
|
|
steps=20,
|
|
|
|
|
cfg_scale=7,
|
|
|
|
|
width=768,
|
|
|
|
|
height=1024,
|
|
|
|
|
img_count=1,
|
|
|
|
|
randn_source=0,
|
|
|
|
|
seed=2228967414,
|
|
|
|
|
restore_faces=0,
|
|
|
|
|
hi_res_fix_info=hi_res_fix_info
|
2025-09-04 11:09:36 +08:00
|
|
|
|
)
|
2025-09-04 11:27:59 +08:00
|
|
|
|
|
|
|
|
|
if result:
|
|
|
|
|
print(f"🎉 生图任务完成!最终OBS地址: {result}")
|
|
|
|
|
else:
|
|
|
|
|
print("❌ 生图任务失败")
|