mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-12-06 10:31:17 -08:00
rework #6329 to remove duplicate code and add prevent tab names for showing in ids for scripts that only exist on one tab
This commit is contained in:
parent
997461d3dd
commit
f8d0cf6a6e
10 changed files with 10 additions and 53 deletions
|
|
@ -8,18 +8,12 @@ from modules import processing, shared, sd_samplers, images
|
|||
from modules.processing import Processed
|
||||
from modules.sd_samplers import samplers
|
||||
from modules.shared import opts, cmd_opts, state
|
||||
import re
|
||||
|
||||
|
||||
class Script(scripts.Script):
|
||||
def title(self):
|
||||
return "Loopback"
|
||||
|
||||
def elem_id(self, item_id):
|
||||
gen_elem_id = ('img2img' if self.is_img2img else 'txt2txt') + '_script_' + re.sub(r'\s', '_', self.title().lower()) + '_' + item_id
|
||||
gen_elem_id = re.sub(r'[^a-z_0-9]', '', gen_elem_id)
|
||||
return gen_elem_id
|
||||
|
||||
def show(self, is_img2img):
|
||||
return is_img2img
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue