MCPcopy
hub / github.com/AUTOMATIC1111/stable-diffusion-webui / elem_id

Method elem_id

modules/scripts.py:334–342  ·  view source on GitHub ↗

helper function to generate id for a HTML element, constructs final id out of script name, tab and user-supplied item_id

(self, item_id)

Source from the content-addressed store, hash-verified

332 return ""
333
334 def elem_id(self, item_id):
335 """helper function to generate id for a HTML element, constructs final id out of script name, tab and user-supplied item_id"""
336
337 need_tabname = self.show(True) == self.show(False)
338 tabkind = 'img2img' if self.is_img2img else 'txt2img'
339 tabname = f"{tabkind}_" if need_tabname else ""
340 title = re.sub(r'[^a-z_0-9]', '', re.sub(r'\s', '_', self.title().lower()))
341
342 return f'script_{tabname}{title}_{item_id}'
343
344 def before_hr(self, p, *args):
345 """

Callers 11

uiMethod · 0.95
uiMethod · 0.95
uiMethod · 0.95
uiMethod · 0.95
uiMethod · 0.95
uiMethod · 0.95
uiMethod · 0.95
uiMethod · 0.95
uiMethod · 0.95
uiMethod · 0.45
uiMethod · 0.45

Calls 2

showMethod · 0.95
titleMethod · 0.95

Tested by

no test coverage detected