From 80465b8c5d94a862a5e44dc15fdae23a252355f4 Mon Sep 17 00:00:00 2001 From: db0 Date: Wed, 11 Sep 2024 16:26:52 +0200 Subject: [PATCH 1/4] feat: support for flux --- README.md | 1 + horde_model_reference/meta_consts.py | 2 ++ stable_diffusion.schema.json | 5 +++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index abd1010..fb803c4 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Some key takeaways for the new `stable_diffusion.json`: - `stable_diffusion_2_512` - `stable_diffusion_xl` - `stable_cascade` + - `flux_1` - An MD5 sum is no longer included. All models (of all types) will have an SHA included from now on. - `download` entries optionally contain a new key, `known_slow_download`, which indicates this download host is known to be slow at times. diff --git a/horde_model_reference/meta_consts.py b/horde_model_reference/meta_consts.py index b89dfcb..2a31250 100644 --- a/horde_model_reference/meta_consts.py +++ b/horde_model_reference/meta_consts.py @@ -90,6 +90,7 @@ class STABLE_DIFFUSION_BASELINE_CATEGORY(StrEnum): stable_diffusion_2_512 = auto() stable_diffusion_xl = auto() stable_cascade = auto() + flux_1 = auto() MODEL_PURPOSE_LOOKUP: dict[MODEL_REFERENCE_CATEGORY, MODEL_PURPOSE] = { @@ -110,6 +111,7 @@ class STABLE_DIFFUSION_BASELINE_CATEGORY(StrEnum): STABLE_DIFFUSION_BASELINE_CATEGORY.stable_diffusion_2_512: 512, STABLE_DIFFUSION_BASELINE_CATEGORY.stable_diffusion_xl: 1024, STABLE_DIFFUSION_BASELINE_CATEGORY.stable_cascade: 1024, + STABLE_DIFFUSION_BASELINE_CATEGORY.flux_1: 1024, } """The single-side preferred resolution for each known stable diffusion baseline.""" diff --git a/stable_diffusion.schema.json b/stable_diffusion.schema.json index 5ee10b1..79d120f 100644 --- a/stable_diffusion.schema.json +++ b/stable_diffusion.schema.json @@ -74,13 +74,14 @@ "type": "string" }, "STABLE_DIFFUSION_BASELINE_CATEGORY": { - "description": "An enum of all the stable diffusion baselines.", + "description": "An enum of all the image generation baselines.", "enum": [ "stable_diffusion_1", "stable_diffusion_2_768", "stable_diffusion_2_512", "stable_diffusion_xl", - "stable_cascade" + "stable_cascade", + "flux_1" ], "title": "STABLE_DIFFUSION_BASELINE_CATEGORY", "type": "string" From 4e015687615b5aa14c49d4319ed67a003f4d9458 Mon Sep 17 00:00:00 2001 From: tazlin Date: Wed, 11 Sep 2024 11:32:04 -0400 Subject: [PATCH 2/4] fix: update docstring for `STABLE_DIFFUSION_BASELINE_CATEGORY` The tests automatically generation the `.schema` file using this docstring, so it must also be updated. --- horde_model_reference/meta_consts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/horde_model_reference/meta_consts.py b/horde_model_reference/meta_consts.py index 2a31250..d109ac5 100644 --- a/horde_model_reference/meta_consts.py +++ b/horde_model_reference/meta_consts.py @@ -82,15 +82,15 @@ class MODEL_PURPOSE(StrEnum): miscellaneous = auto() -class STABLE_DIFFUSION_BASELINE_CATEGORY(StrEnum): - """An enum of all the stable diffusion baselines.""" +class STABLE_DIFFUSION_BASELINE_CATEGORY(StrEnum): + """An enum of all the image generation baselines.""" stable_diffusion_1 = auto() stable_diffusion_2_768 = auto() stable_diffusion_2_512 = auto() stable_diffusion_xl = auto() stable_cascade = auto() - flux_1 = auto() + flux_1 = auto() # TODO: Extract flux and create "IMAGE_GENERATION_BASELINE_CATEGORY" due to name inconsistency MODEL_PURPOSE_LOOKUP: dict[MODEL_REFERENCE_CATEGORY, MODEL_PURPOSE] = { From cf896b6ed7cd71320cc15ac239ea6881fddc5b3a Mon Sep 17 00:00:00 2001 From: tazlin Date: Wed, 11 Sep 2024 11:38:10 -0400 Subject: [PATCH 3/4] style: fix --- horde_model_reference/meta_consts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/horde_model_reference/meta_consts.py b/horde_model_reference/meta_consts.py index d109ac5..8eab357 100644 --- a/horde_model_reference/meta_consts.py +++ b/horde_model_reference/meta_consts.py @@ -82,7 +82,7 @@ class MODEL_PURPOSE(StrEnum): miscellaneous = auto() -class STABLE_DIFFUSION_BASELINE_CATEGORY(StrEnum): +class STABLE_DIFFUSION_BASELINE_CATEGORY(StrEnum): """An enum of all the image generation baselines.""" stable_diffusion_1 = auto() @@ -90,7 +90,7 @@ class STABLE_DIFFUSION_BASELINE_CATEGORY(StrEnum): stable_diffusion_2_512 = auto() stable_diffusion_xl = auto() stable_cascade = auto() - flux_1 = auto() # TODO: Extract flux and create "IMAGE_GENERATION_BASELINE_CATEGORY" due to name inconsistency + flux_1 = auto() # TODO: Extract flux and create "IMAGE_GENERATION_BASELINE_CATEGORY" due to name inconsistency MODEL_PURPOSE_LOOKUP: dict[MODEL_REFERENCE_CATEGORY, MODEL_PURPOSE] = { From 3db2a3978219350a48daf23e52886fa51ba60528 Mon Sep 17 00:00:00 2001 From: tazlin Date: Wed, 11 Sep 2024 11:39:50 -0400 Subject: [PATCH 4/4] tests: run pre-commit against incoming branch on PRs --- .github/workflows/prtests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/prtests.yml b/.github/workflows/prtests.yml index dbfda9d..d4b1681 100644 --- a/.github/workflows/prtests.yml +++ b/.github/workflows/prtests.yml @@ -23,6 +23,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Run pre-commit uses: pre-commit/action@v3.0.0 with: