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)
| 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 | """ |