Skip to content

fix(setup): Add existence check for register_paste_params_button attribute#953

Merged
zanllp merged 1 commit into
zanllp:mainfrom
BlackusPL:main
May 26, 2026
Merged

fix(setup): Add existence check for register_paste_params_button attribute#953
zanllp merged 1 commit into
zanllp:mainfrom
BlackusPL:main

Conversation

@BlackusPL

Copy link
Copy Markdown
Contributor

I added check if UI have register_paste_params_button attribute because ModernUI which SD.Next uses, doesn't have it.

Error that apear when UI don't have this attribute:

Executing callback: X:\sdnext\extensions\infinite-image-browsing\scripts\iib_setup.py
                         ui_tabs_callback: AttributeError
X:\sdnext\modules\script_callbacks.py:218 in ui_tabs_callback

  217             t0 = time.time()
❱ 218             res += c.callback() or []
  219             timer(t0, c.script, 'ui_tabs')

X:\sdnext\extensions\infinite-image-browsing\scripts\iib_setup.py:56 in on_ui_tabs

  55                     # 注册粘贴56                     send.register_paste_params_button(
  57                         send.ParamBinding(
AttributeError: module 'modules.infotext_utils' has no attribute 'register_paste_params_button'

Checks if UI have `register_paste_params_button` attribute

@zanllp zanllp left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Simple compatibility fix for SD.Next's ModernUI which doesn't have register_paste_params_button. The hasattr guard is appropriate here — if the function doesn't exist, there's nothing to register, and the button wouldn't be useful without it anyway. Thanks for the fix!

@zanllp zanllp merged commit 98d5527 into zanllp:main May 26, 2026
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