Download stable-diffusion-webui-wd14-tagger/scripts/tagger.py from CosVersin/e621-tagger-patch: direct link, hf CLI and curl.
- Browser
- Download file 544 Bytes
-
https://huggingface.co/datasets/CosVersin/e621-tagger-patch/resolve/main/stable-diffusion-webui-wd14-tagger/scripts/tagger.py
- Command line
-
hf download hf://datasets/CosVersin/e621-tagger-patch/stable-diffusion-webui-wd14-tagger/scripts/tagger.py
-
curl -L -o tagger.py https://huggingface.co/datasets/CosVersin/e621-tagger-patch/resolve/main/stable-diffusion-webui-wd14-tagger/scripts/tagger.py
544 Bytes
| from PIL import Image, ImageFile | |
| from modules import script_callbacks | |
| from tagger.api import on_app_started | |
| from tagger.ui import on_ui_tabs | |
| # if you do not initialize the Image object | |
| # Image.registered_extensions() returns only PNG | |
| Image.init() | |
| # PIL spits errors when loading a truncated image by default | |
| # https://pillow.readthedocs.io/en/stable/reference/ImageFile.html#PIL.ImageFile.LOAD_TRUNCATED_IMAGES | |
| ImageFile.LOAD_TRUNCATED_IMAGES = True | |
| script_callbacks.on_app_started(on_app_started) | |
| script_callbacks.on_ui_tabs(on_ui_tabs) | |