Fix ControlNetUnit legacy field alias (#2860)

pull/2861/head
Chenlei Hu 2024-05-07 07:54:35 -04:00 committed by GitHub
parent 6a86fdd78d
commit 4cb22867c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -292,7 +292,7 @@ class ControlNetUnit(BaseModel):
for alias, key in ext_compat_keys.items():
if alias in values:
assert key not in values, f"Conflict of field '{alias}' and '{key}'"
values[key] = alias
values[key] = values[alias]
cls.cls_logger.warn(
f"Deprecated alias '{alias}' detected. This field will be removed on 2024-06-01"
f"Please use '{key}' instead."

View File

@ -239,3 +239,7 @@ def test_infotext_parsing():
pixel_perfect=True,
control_mode="Balanced",
) == ControlNetUnit.parse(infotext)
def test_alias():
ControlNetUnit.from_dict({"lowvram": True})