Skip to content

Conversation

@marcsyp
Copy link

@marcsyp marcsyp commented Dec 23, 2024

This PR adds element IDs to the Weight Type dropdown and Weights textbox in the Advanced Weight Control section of ControlNet units. The IDs follow the existing naming pattern used throughout controlnet_ui_group.py.

The primary purpose is to enable compatibility with the Config Presets extension, allowing users to save and reload complex ControlNet configurations including advanced weight settings.

Changes:

  • Added elem_id parameters to AdvancedWeightControl.render()
  • Added elem_ids to weight_type dropdown and weight_editor textbox
  • Maintained backward compatibility for cases where render is called without parameters

The changes to the dropdown have been tested and confirmed working with both ControlNet and Config Presets. Changes to the advanced weights textbox will need to rely on custom code in the Config Presets to stop propagation of Weight Type events when both the Weight Type and Advanced Weights are updated as part of the same preset (otherwise the UI event for Weight Type overwrites the Advanced Weights).

This PR adds element IDs to the Weight Type dropdown and Weights textbox in the Advanced Weight Control section of ControlNet units. The IDs follow the existing naming pattern used throughout controlnet_ui_group.py.

The primary purpose is to enable compatibility with the Config Presets extension, allowing users to save and reload complex ControlNet configurations including advanced weight settings.

Changes:
- Added elem_id parameters to AdvancedWeightControl.render()
- Added elem_ids to weight_type dropdown and weight_editor textbox
- Maintained backward compatibility for cases where render is called without parameters

The changes to the dropdown have been tested and confirmed working with both ControlNet and Config Presets.  Changes to the advanced weights textbox will need to rely on custom code in the Config Presets to stop propagation of Weight Type events when both the Weight Type and Advanced Weights are updated as part of the same preset (otherwise the UI event for Weight Type overwrites the Advanced Weights).
@ice-fly
Copy link

ice-fly commented Jan 1, 2025

Reviewed commit appears to enhance compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants