Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

fix(config): accept unquoted on/off for rocm_aotriton_experimental

Alexander Eichhorn6a0048a47a15
diff --git a/invokeai/app/services/config/config_default.py b/invokeai/app/services/config/config_default.py
index e55b18171c..1f20e31ffb 100644
--- a/invokeai/app/services/config/config_default.py
+++ b/invokeai/app/services/config/config_default.py
@@ -349,6 +349,14 @@ class InvokeAIAppConfig(BaseSettings):
)
return v
+ @field_validator("rocm_aotriton_experimental", mode="before")
+ @classmethod
+ def validate_rocm_aotriton_experimental(cls, v: object) -> object:
+ # YAML 1.1 reads an unquoted `on` or `off` as a boolean, and unquoted is how the setting gets written.
+ if isinstance(v, bool):
+ return "on" if v else "off"
+ return v
+
@field_validator("base_url")
@classmethod
def validate_base_url(cls, v: Optional[str]) -> Optional[str]:
diff --git a/tests/test_config.py b/tests/test_config.py
index e372baf6e3..2377ad457e 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -90,6 +90,21 @@ def test_wan_memory_optimization_defaults_to_false_and_loads_from_yaml(tmp_path:
assert load_and_migrate_config(temp_config_file).wan_memory_optimization is True
+ ("yaml_value", "expected"),
+ [("on", "on"), ("off", "off"), ('"on"', "on"), ("auto", "auto")],
+ ids=["unquoted-on", "unquoted-off", "quoted", "auto"],
+)
+def test_rocm_aotriton_experimental_loads_unquoted_on_and_off(
+ tmp_path: Path, patch_rootdir: None, yaml_value: str, expected: str
+) -> None:
+ """YAML 1.1 reads an unquoted `on`/`off` as a boolean; the startup log tells users to write exactly that."""
+ temp_config_file = tmp_path / "temp_invokeai.yaml"
+ temp_config_file.write_text(f'schema_version: "4.0.3"\nrocm_aotriton_experimental: {yaml_value}\n')
+
+ assert load_and_migrate_config(temp_config_file).rocm_aotriton_experimental == expected
+
+
def test_db_synchronous_defaults_to_full_and_loads_from_yaml(tmp_path: Path, patch_rootdir: None) -> None:
# The default must stay `full`: anything else would quietly reduce durability for every existing
# install on upgrade.