Skip to content

Commit

Permalink
Fix ControlNetUnit legacy field alias (#2860)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored May 7, 2024
1 parent 6a86fdd commit 4cb2286
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal_controlnet/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def legacy_field_alias(cls, values: dict) -> dict:
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."
Expand Down
4 changes: 4 additions & 0 deletions unit_tests/args_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

0 comments on commit 4cb2286

Please sign in to comment.