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