32 lines
886 B
Python
32 lines
886 B
Python
import json
|
|
from PuLIDGenerator import PuLIDGenerator
|
|
|
|
# 加载配置文件
|
|
with open('config.json', 'r', encoding='utf-8') as f:
|
|
config = json.load(f)
|
|
|
|
if __name__ == "__main__":
|
|
# 获取第一个模型的配置
|
|
model_config = config["models"][0]
|
|
|
|
# 创建生成器实例
|
|
generator = PuLIDGenerator()
|
|
|
|
# 使用配置参数
|
|
generator.set_default_params(
|
|
template_uuid=model_config["template_uuid"],
|
|
steps=model_config["steps"],
|
|
width=model_config["width"],
|
|
height=model_config["height"]
|
|
)
|
|
|
|
# 生成图像
|
|
obs_url = generator.generate_image(
|
|
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}")
|