Skip to content

Commit

Permalink
Update sd-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaltais committed Nov 2, 2024
1 parent fe9066d commit 18e587d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion kohya_gui/sd_modeltype.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from os.path import isfile
from safetensors import safe_open
import enum
from .custom_logging import setup_logging

# methodology is based on https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/82a973c04367123ae98bd9abdf80d9eda9b910e2/modules/sd_models.py#L379-L403
# Set up logging
log = setup_logging()

# methodology is based on https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/82a973c04367123ae98bd9abdf80d9eda9b910e2/modules/sd_models.py#L379-L403

class ModelType(enum.Enum):
UNKNOWN = 0
Expand Down Expand Up @@ -44,6 +47,9 @@ def hasKeyPrefix(pfx):
self.model_type = ModelType.SD2
elif hasKeyPrefix("model."):
self.model_type = ModelType.SD1
else:
log.warning("Unknown model type")
log.warning(st.keys())
except:
pass

Expand Down
2 changes: 1 addition & 1 deletion sd-scripts
Submodule sd-scripts updated 2 files
+6 −2 README.md
+25 −5 sd3_train.py

0 comments on commit 18e587d

Please sign in to comment.