mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-29 19:05:05 +08:00
Adjusted prefix from i2i/t2i to txt2img and img2img and removed those prefixes from img exclusive scripts
This commit is contained in:
parent
5851bc839b
commit
c3109fa18a
@ -14,7 +14,7 @@ class Script(scripts.Script):
|
||||
return cmd_opts.allow_code
|
||||
|
||||
def ui(self, is_img2img):
|
||||
elem_prefix = ('i2i' if is_img2img else 't2i') + '_script_custom_code_'
|
||||
elem_prefix = ('img2img' if is_img2img else 'txt2txt') + '_script_custom_code_'
|
||||
|
||||
code = gr.Textbox(label="Python code", lines=1, elem_id=elem_prefix + "code")
|
||||
|
||||
|
@ -126,7 +126,7 @@ class Script(scripts.Script):
|
||||
return is_img2img
|
||||
|
||||
def ui(self, is_img2img):
|
||||
elem_prefix = ('i2i' if is_img2img else 't2i') + '_script_i2i_alternative_test_'
|
||||
elem_prefix = 'script_i2i_alternative_test_'
|
||||
|
||||
info = gr.Markdown('''
|
||||
* `CFG Scale` should be 2 or lower.
|
||||
|
@ -17,7 +17,7 @@ class Script(scripts.Script):
|
||||
return is_img2img
|
||||
|
||||
def ui(self, is_img2img):
|
||||
elem_prefix = ('i2i' if is_img2img else 't2i') + '_script_loopback_'
|
||||
elem_prefix = 'script_loopback_'
|
||||
|
||||
loops = gr.Slider(minimum=1, maximum=32, step=1, label='Loops', value=4, elem_id=elem_prefix + "loops")
|
||||
denoising_strength_change_factor = gr.Slider(minimum=0.9, maximum=1.1, step=0.01, label='Denoising strength change factor', value=1, elem_id=elem_prefix + "denoising_strength_change_factor")
|
||||
|
@ -129,7 +129,7 @@ class Script(scripts.Script):
|
||||
if not is_img2img:
|
||||
return None
|
||||
|
||||
elem_prefix = ('i2i' if is_img2img else 't2i') + '_script_outpainting_mk_2_'
|
||||
elem_prefix = 'script_outpainting_mk_2_'
|
||||
|
||||
info = gr.HTML("<p style=\"margin-bottom:0.75em\">Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>")
|
||||
|
||||
|
@ -21,7 +21,7 @@ class Script(scripts.Script):
|
||||
if not is_img2img:
|
||||
return None
|
||||
|
||||
elem_prefix = ('i2i' if is_img2img else 't2i') + '_script_poor_mans_outpainting_'
|
||||
elem_prefix = 'script_poor_mans_outpainting_'
|
||||
|
||||
pixels = gr.Slider(label="Pixels to expand", minimum=8, maximum=256, step=8, value=128, elem_id=elem_prefix + "pixels")
|
||||
mask_blur = gr.Slider(label='Mask blur', minimum=0, maximum=64, step=1, value=4, elem_id=elem_prefix + "mask_blur")
|
||||
|
@ -45,7 +45,7 @@ class Script(scripts.Script):
|
||||
return "Prompt matrix"
|
||||
|
||||
def ui(self, is_img2img):
|
||||
elem_prefix = ('i2i' if is_img2img else 't2i') + '_script_prompt_matrix_'
|
||||
elem_prefix = ('img2img' if is_img2img else 'txt2txt') + '_script_prompt_matrix_'
|
||||
|
||||
put_at_start = gr.Checkbox(label='Put variable parts at start of prompt', value=False, elem_id=elem_prefix + "put_at_start")
|
||||
different_seeds = gr.Checkbox(label='Use different seed for each picture', value=False, elem_id=elem_prefix + "different_seeds")
|
||||
|
@ -112,7 +112,7 @@ class Script(scripts.Script):
|
||||
return "Prompts from file or textbox"
|
||||
|
||||
def ui(self, is_img2img):
|
||||
elem_prefix = ('i2i' if is_img2img else 't2i') + '_script_prompt_from_file_'
|
||||
elem_prefix = ('img2img' if is_img2img else 'txt2txt') + '_script_prompt_from_file_'
|
||||
|
||||
checkbox_iterate = gr.Checkbox(label="Iterate seed every line", value=False, elem_id=elem_prefix + "checkbox_iterate")
|
||||
checkbox_iterate_batch = gr.Checkbox(label="Use same random seed for all lines", value=False, elem_id=elem_prefix + "checkbox_iterate_batch")
|
||||
|
@ -17,7 +17,7 @@ class Script(scripts.Script):
|
||||
return is_img2img
|
||||
|
||||
def ui(self, is_img2img):
|
||||
elem_prefix = ('i2i' if is_img2img else 't2i') + '_script_sd_upscale_'
|
||||
elem_prefix = 'script_sd_upscale_'
|
||||
|
||||
info = gr.HTML("<p style=\"margin-bottom:0.75em\">Will upscale the image by the selected scale factor; use width and height sliders to set tile size</p>")
|
||||
overlap = gr.Slider(minimum=0, maximum=256, step=16, label='Tile overlap', value=64, elem_id=elem_prefix + "overlap")
|
||||
|
@ -292,7 +292,7 @@ class Script(scripts.Script):
|
||||
|
||||
def ui(self, is_img2img):
|
||||
current_axis_options = [x for x in axis_options if type(x) == AxisOption or type(x) == AxisOptionImg2Img and is_img2img]
|
||||
elem_prefix = ('i2i' if is_img2img else 't2i') + '_script_xy_grid_'
|
||||
elem_prefix = ('img2img' if is_img2img else 'txt2txt') + '_script_xy_grid_'
|
||||
|
||||
with gr.Row():
|
||||
x_type = gr.Dropdown(label="X type", choices=[x.label for x in current_axis_options], value=current_axis_options[1].label, type="index", elem_id=elem_prefix + "x_type")
|
||||
|
Loading…
Reference in New Issue
Block a user