'commit'
This commit is contained in:
@@ -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}")
|
||||
|
Binary file not shown.
14
dsLightRag/Liblib/config.json
Normal file
14
dsLightRag/Liblib/config.json
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user