mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
tidy(mm): rename ckpt "last_modified" -> "converted_at"
Clarify what this timestamp means
This commit is contained in:
parent
9b40c28144
commit
bd4fd9693d
@ -74,7 +74,7 @@ example_model_config = {
|
|||||||
"current_hash": "string",
|
"current_hash": "string",
|
||||||
"description": "string",
|
"description": "string",
|
||||||
"source": "string",
|
"source": "string",
|
||||||
"last_modified": 0,
|
"converted_at": 0,
|
||||||
"variant": "normal",
|
"variant": "normal",
|
||||||
"prediction_type": "epsilon",
|
"prediction_type": "epsilon",
|
||||||
"repo_variant": "fp16",
|
"repo_variant": "fp16",
|
||||||
|
@ -138,9 +138,7 @@ class ModelConfigBase(BaseModel):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def json_schema_extra(schema: dict[str, Any], model_class: Type[BaseModel]) -> None:
|
def json_schema_extra(schema: dict[str, Any], model_class: Type[BaseModel]) -> None:
|
||||||
schema["required"].extend(
|
schema["required"].extend(["key", "base", "type", "format", "original_hash", "current_hash", "source"])
|
||||||
["key", "base", "type", "format", "original_hash", "current_hash", "source", "last_modified"]
|
|
||||||
)
|
|
||||||
|
|
||||||
model_config = ConfigDict(
|
model_config = ConfigDict(
|
||||||
use_enum_values=False,
|
use_enum_values=False,
|
||||||
@ -159,7 +157,7 @@ class CheckpointConfigBase(ModelConfigBase):
|
|||||||
|
|
||||||
format: Literal[ModelFormat.Checkpoint] = ModelFormat.Checkpoint
|
format: Literal[ModelFormat.Checkpoint] = ModelFormat.Checkpoint
|
||||||
config_path: str = Field(description="path to the checkpoint model config file")
|
config_path: str = Field(description="path to the checkpoint model config file")
|
||||||
last_modified: Optional[float] = Field(
|
converted_at: Optional[float] = Field(
|
||||||
description="When this model was last converted to diffusers", default_factory=time.time
|
description="When this model was last converted to diffusers", default_factory=time.time
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -380,5 +378,5 @@ class ModelConfigFactory(object):
|
|||||||
if key:
|
if key:
|
||||||
model.key = key
|
model.key = key
|
||||||
if isinstance(model, CheckpointConfigBase) and timestamp is not None:
|
if isinstance(model, CheckpointConfigBase) and timestamp is not None:
|
||||||
model.last_modified = timestamp
|
model.converted_at = timestamp
|
||||||
return model # type: ignore
|
return model # type: ignore
|
||||||
|
@ -29,7 +29,7 @@ class ControlNetLoader(GenericDiffusersLoader):
|
|||||||
return False
|
return False
|
||||||
elif (
|
elif (
|
||||||
dest_path.exists()
|
dest_path.exists()
|
||||||
and (dest_path / "config.json").stat().st_mtime >= (config.last_modified or 0.0)
|
and (dest_path / "config.json").stat().st_mtime >= (config.converted_at or 0.0)
|
||||||
and (dest_path / "config.json").stat().st_mtime >= model_path.stat().st_mtime
|
and (dest_path / "config.json").stat().st_mtime >= model_path.stat().st_mtime
|
||||||
):
|
):
|
||||||
return False
|
return False
|
||||||
|
@ -59,7 +59,7 @@ class StableDiffusionDiffusersModel(GenericDiffusersLoader):
|
|||||||
return False
|
return False
|
||||||
elif (
|
elif (
|
||||||
dest_path.exists()
|
dest_path.exists()
|
||||||
and (dest_path / "model_index.json").stat().st_mtime >= (config.last_modified or 0.0)
|
and (dest_path / "model_index.json").stat().st_mtime >= (config.converted_at or 0.0)
|
||||||
and (dest_path / "model_index.json").stat().st_mtime >= model_path.stat().st_mtime
|
and (dest_path / "model_index.json").stat().st_mtime >= model_path.stat().st_mtime
|
||||||
):
|
):
|
||||||
return False
|
return False
|
||||||
|
@ -31,7 +31,7 @@ class VaeLoader(GenericDiffusersLoader):
|
|||||||
return False
|
return False
|
||||||
elif (
|
elif (
|
||||||
dest_path.exists()
|
dest_path.exists()
|
||||||
and (dest_path / "config.json").stat().st_mtime >= (config.last_modified or 0.0)
|
and (dest_path / "config.json").stat().st_mtime >= (config.converted_at or 0.0)
|
||||||
and (dest_path / "config.json").stat().st_mtime >= model_path.stat().st_mtime
|
and (dest_path / "config.json").stat().st_mtime >= model_path.stat().st_mtime
|
||||||
):
|
):
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user