Skip to content

Commit

Permalink
Merge pull request #646 from zanllp/feat/expand-tag-generation
Browse files Browse the repository at this point in the history
feat: Expand tag generation support
  • Loading branch information
zanllp authored Jun 1, 2024
2 parents 40078c0 + 37d8950 commit 91376c2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scripts/iib/db/update_image_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,29 @@ def build_single_img_idx(conn, file_path, is_rebuild, safe_save_img_tag):
type="size",
)
safe_save_img_tag(ImageTag(img.id, size_tag.id))

for k in [
"Model",
"Sampler",
"Source Identifier",
"Postprocess upscale by",
"Postprocess upscaler",
"Size"
"Size",
"Refiner",
"Hires upscaler"
]:

v = meta.get(k)
if not v:
continue

tag = Tag.get_or_create(conn, str(v), k)
safe_save_img_tag(ImageTag(img.id, tag.id))
if "Hires upscaler" == k:
tag = Tag.get_or_create(conn, 'Hires All', k)
safe_save_img_tag(ImageTag(img.id, tag.id))
elif "Refiner" == k:
tag = Tag.get_or_create(conn, 'Refiner All', k)
safe_save_img_tag(ImageTag(img.id, tag.id))
for i in lora:
tag = Tag.get_or_create(conn, i["name"], "lora")
safe_save_img_tag(ImageTag(img.id, tag.id))
Expand Down

0 comments on commit 91376c2

Please sign in to comment.