From 68fa7a53b9ca40938bef9613f9762aec719dbc2c Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Thu, 4 Sep 2025 08:17:22 +0800 Subject: [PATCH] 'commit' --- dsLightRag/Liblib/T3.py | 29 ++++++++++++------ .../PuLIDGenerator.cpython-310.pyc | Bin 3259 -> 3259 bytes dsLightRag/Liblib/config.json | 14 +++++++++ 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 dsLightRag/Liblib/config.json diff --git a/dsLightRag/Liblib/T3.py b/dsLightRag/Liblib/T3.py index 52a5f1e2..4ea0b41b 100644 --- a/dsLightRag/Liblib/T3.py +++ b/dsLightRag/Liblib/T3.py @@ -1,20 +1,31 @@ +import json from PuLIDGenerator import PuLIDGenerator +# 加载配置文件 +with open('config.json', 'r', encoding='utf-8') as f: + config = json.load(f) + if __name__ == "__main__": - # 创建生成器实例 - 传入模型ID(template_uuid) + # 获取第一个模型的配置 + model_config = config["models"][0] + + # 创建生成器实例 generator = PuLIDGenerator() - # 可选:修改默认参数 + + # 使用配置参数 generator.set_default_params( - template_uuid="6f7c4652458d4802969f8d089cf5b91f", - steps=25, - width=800, - height=1000 + template_uuid=model_config["template_uuid"], + steps=model_config["steps"], + width=model_config["width"], + height=model_config["height"] ) + # 生成图像 obs_url = generator.generate_image( - prompt="filmfotos, Asian portrait,A young woman wearing a green baseball cap,covering one eye with her hand", - reference_image_url="https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/Backup/HuangWanQiao.jpg", - control_weight=0.8 + prompt=model_config["prompt"], + reference_image_url=model_config["reference_image_url"], + control_weight=model_config["control_weight"] ) + if obs_url: print(f"最终OBS地址: {obs_url}") diff --git a/dsLightRag/Liblib/__pycache__/PuLIDGenerator.cpython-310.pyc b/dsLightRag/Liblib/__pycache__/PuLIDGenerator.cpython-310.pyc index ffef952a24ce12b3f764de35769849a51a43d1a4..a4aef6cc9078d97b7a2c58d854a85fff216c698f 100644 GIT binary patch delta 19 Zcmdljxm%JepO=@50SI(%ZRFa>0{}0k1jGOU delta 19 Zcmdljxm%JepO=@50SLISZsgj?0{||^1fBo@ diff --git a/dsLightRag/Liblib/config.json b/dsLightRag/Liblib/config.json new file mode 100644 index 00000000..4cefcf11 --- /dev/null +++ b/dsLightRag/Liblib/config.json @@ -0,0 +1,14 @@ +{ + "models": [ + { + "name": "PuLID模型", + "template_uuid": "6f7c4652458d4802969f8d089cf5b91f", + "steps": 25, + "width": 800, + "height": 1000, + "prompt": "filmfotos, Asian portrait,A young woman wearing a green baseball cap,covering one eye with her hand", + "reference_image_url": "https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/Backup/HuangWanQiao.jpg", + "control_weight": 0.8 + } + ] +} \ No newline at end of file