[Feature Enhance] The creator name in model info

pull/249/head
sdy623 2023-09-23 17:54:28 +09:00
parent 4823680ce8
commit 10495328a3
No known key found for this signature in database
GPG Key ID: 468655D6041A7009
1 changed files with 7 additions and 0 deletions

View File

@ -64,6 +64,13 @@ def scan_model(scan_model_types, max_size_preview, skip_nsfw_preview):
# use this sha256 to get model info from civitai # use this sha256 to get model info from civitai
model_info = civitai.get_model_info_by_hash(hash) model_info = civitai.get_model_info_by_hash(hash)
# query the model's creator
if model_info != {}:
modelId = model_info["modelId"]
creator = civitai.get_model_info_by_id(str(modelId))["creator"]["username"]
model_info["model"]["creator"] = creator
# delay 1 second for ti # delay 1 second for ti
if model_type == "ti": if model_type == "ti":
util.printD("Delay 1 second for TI") util.printD("Delay 1 second for TI")