From 5001537316aec4000d77802d4f6062bfd30ee5b5 Mon Sep 17 00:00:00 2001 From: frostydad <64224601+Cyberes@users.noreply.github.com> Date: Thu, 22 Sep 2022 21:14:19 -0600 Subject: [PATCH] undo chages Former-commit-id: a136562113905f3529761db78f136c8eecd2a1ed [formerly 0b7dbb9becd924357b0ae8a0431f02e3aa48be17] Former-commit-id: 1807289d16e19f805940762ac7063be9170a82aa --- .github/workflows/generate-webpage.yml | 31 ---------- docs/index.html | 84 -------------------------- other/generate_tx_models_html.py | 25 +++++--- 3 files changed, 17 insertions(+), 123 deletions(-) delete mode 100644 .github/workflows/generate-webpage.yml delete mode 100644 docs/index.html diff --git a/.github/workflows/generate-webpage.yml b/.github/workflows/generate-webpage.yml deleted file mode 100644 index 3f2da81..0000000 --- a/.github/workflows/generate-webpage.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Python application - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: BSFishy/pip-action@v1 - with: - packages: | - requests - huggingface_hub - pillow - - uses: actions/checkout@v3 - with: - repository: ${{ github.repository }} - - - name: Generate Static Webpage - run: python ${{ github.workspace }}/other/generate_tx_models_html.py - shell: sh diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index d7d9196..0000000 --- a/docs/index.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - Stable Diffusion Texual Inversion Models - - - - - - -
-

Stable Diffusion Texual Inversion Models

- -

- Generated from huggingface.co/sd-concepts-library -

- -

- Downloaded models are straight from the HuggingFace repositories and are named learned_embeds.bin. Rename to model_name.pt -

- - -

-

jetsetdreamcastcovers

-

Download jetsetdreamcastcovers

-

View Repository

-
-
- -
-
- -
-
- -
-

yoji-shinkawa-style

-

Download yoji-shinkawa-style

-

View Repository

-
-
- -
-
- -
-
- -
-

million-live-akane-3k

-

Download million-live-akane-3k

-

View Repository

-
-
- -
-
- -
-
- -
-
diff --git a/other/generate_tx_models_html.py b/other/generate_tx_models_html.py index cf6891e..703d326 100644 --- a/other/generate_tx_models_html.py +++ b/other/generate_tx_models_html.py @@ -1,5 +1,8 @@ +import argparse +import datetime import os import shutil +import sys from urllib import request as ulreq import requests @@ -26,13 +29,20 @@ def getsizes(uri): file.close() return (size, None) + +parser = argparse.ArgumentParser() +parser.add_argument('out_file', nargs='?', help='file to save to') +args = parser.parse_args() + +print('Will save to file:', args.out_file) + # Get list of models under the sd-concepts-library organization +print('Getting list of models...') api = HfApi() models_list = [] for model in api.list_models(author="sd-concepts-library"): models_list.append(model.modelId.replace('sd-concepts-library/', '')) models_list.sort() -print(models_list) html_struct = """ @@ -67,6 +77,7 @@ html_struct = """

Stable Diffusion Texual Inversion Models

+

Page updates daily. Last updated {datetime.datetime.now().strftime("%A, %B %d %Y")}.

Generated from huggingface.co/sd-concepts-library @@ -80,9 +91,12 @@ html_struct = """


""" -# Move the model out i = 1 for model_name in models_list: + + if i == 3: + break + print(f'{i}/{len(models_list)} -> {model_name}') # if os.path.exists(f'{model_name}/learned_embeds.bin'): # double check the file exists since sometimes it hasn't been uploaded yet # shutil.move(f'{model_name}/learned_embeds.bin', f'{model_name}/{model_name}.pt') @@ -118,11 +132,6 @@ for model_name in models_list: html_struct = html_struct + '
' -f = open('sd-concepts-library.html', 'w') +f = open(args.out_file, 'w') f.write(html_struct) f.close() - -# markdown = markdownify.markdownify(html_struct, heading_style="ATX") -# f = open('sd-concepts-library.md', 'w') -# f.write(markdown) -# f.close()