'commit'
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import json
|
||||
|
||||
from Liblib.LibLibUtil import SAMPLING_METHODS
|
||||
from PuLIDGenerator import PuLIDGenerator
|
||||
|
||||
# 加载配置文件
|
||||
@@ -7,11 +9,14 @@ with open('config.json', 'r', encoding='utf-8') as f:
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 获取第一个模型的配置
|
||||
model_config = config["models"][0]
|
||||
|
||||
model_config = config["models"][1]
|
||||
|
||||
# 通过枚举转换
|
||||
print(f'使用采样方法: {model_config["sampler"]}')
|
||||
model_config["sampler"] = SAMPLING_METHODS[model_config["sampler"]]
|
||||
# 创建生成器实例
|
||||
generator = PuLIDGenerator()
|
||||
|
||||
|
||||
# 使用配置参数
|
||||
generator.set_default_params(
|
||||
template_uuid=model_config["template_uuid"],
|
||||
@@ -19,13 +24,13 @@ if __name__ == "__main__":
|
||||
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}")
|
||||
|
Reference in New Issue
Block a user