Skip to content

Support cover images embedded in safetensors metadata#15319

Merged
AUTOMATIC1111 merged 1 commit intoAUTOMATIC1111:devfrom
catboxanon:feat/ssmd_cover_images
Mar 24, 2024
Merged

Support cover images embedded in safetensors metadata#15319
AUTOMATIC1111 merged 1 commit intoAUTOMATIC1111:devfrom
catboxanon:feat/ssmd_cover_images

Conversation

@catboxanon
Copy link
Copy Markdown
Collaborator

@catboxanon catboxanon commented Mar 19, 2024

Description

Closes #15317

If an external preview image is not found, this will fallback to check if any cover image is embedded in the safetensors metadata, and if so, uses that within the UI instead.

Note that items already part of the disk cache won't initially be affected by this change, as the metadata read previously excluded this data.

Checklist:

@catboxanon catboxanon changed the title Support embedded cover images in safetensors metadata Support cover images embedded in safetensors metadata Mar 19, 2024
@AUTOMATIC1111
Copy link
Copy Markdown
Owner

Can necessary information be included in the URL so that it's not needed to do this loop?

    item = None
    for page in extra_pages:
        for _, item in page.items.items():
            if str(Path(item.get('filename'))) == str(Path(filename)):
                break

ie page and item same as in get_metadata call.

@catboxanon catboxanon force-pushed the feat/ssmd_cover_images branch from ff1a326 to c440250 Compare March 24, 2024 06:33
@catboxanon
Copy link
Copy Markdown
Collaborator Author

Thanks for the suggestion -- done.

@AUTOMATIC1111 AUTOMATIC1111 merged commit b0b90dc into AUTOMATIC1111:dev Mar 24, 2024
@catboxanon catboxanon deleted the feat/ssmd_cover_images branch March 24, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants