Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ControlNetUnit legacy field alias #2860

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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})
Loading