Rollback of UI Always Visible Overhaul
While the line `return scripts.AlwaysVisible if is_img2img else False` correctly makes the script always visible in the img2img tab, for some reason A1111 is not using the script. This requires further investigation and troubleshooting, however, the other features of this script patch is ready for use. So the AlwaysVisible feature is being rolled back while the other features are kept.pull/10/head
parent
6b1b47f392
commit
b7f1440367
|
|
@ -51,7 +51,8 @@ class Script(scripts.Script):
|
||||||
return NAME
|
return NAME
|
||||||
|
|
||||||
def show(self, is_img2img):
|
def show(self, is_img2img):
|
||||||
return scripts.AlwaysVisible if is_img2img else False
|
# return scripts.AlwaysVisible if is_img2img else False
|
||||||
|
return is_img2img
|
||||||
|
|
||||||
def b_clicked(o):
|
def b_clicked(o):
|
||||||
return gr.Button.update(interactive=True)
|
return gr.Button.update(interactive=True)
|
||||||
|
|
@ -100,7 +101,6 @@ class Script(scripts.Script):
|
||||||
|
|
||||||
def ui(self, is_img2img):
|
def ui(self, is_img2img):
|
||||||
with gr.Group():
|
with gr.Group():
|
||||||
with gr.Accordion(NAME, open=False):
|
|
||||||
model_options = ["CLIP (API)", "CLIP (Native)", "Deepbooru (Native)", "WD (API)"]
|
model_options = ["CLIP (API)", "CLIP (Native)", "Deepbooru (Native)", "WD (API)"]
|
||||||
model_selection = gr.Dropdown(choices=model_options, label="Select Interrogation Model(s)", multiselect=True, value=None)
|
model_selection = gr.Dropdown(choices=model_options, label="Select Interrogation Model(s)", multiselect=True, value=None)
|
||||||
|
|
||||||
|
|
@ -128,7 +128,7 @@ class Script(scripts.Script):
|
||||||
clip_api_accordion = gr.Accordion("CLIP API Options:", open=False, visible=False)
|
clip_api_accordion = gr.Accordion("CLIP API Options:", open=False, visible=False)
|
||||||
with clip_api_accordion:
|
with clip_api_accordion:
|
||||||
clip_api_model = gr.Dropdown(choices=[], value='ViT-L-14/openai', label="CLIP API Model")
|
clip_api_model = gr.Dropdown(choices=[], value='ViT-L-14/openai', label="CLIP API Model")
|
||||||
clip_api_mode = gr.Radio(choices=["best", "fast", "classic", "negative"], label="CLIP API Mode", value="best")
|
clip_api_mode = gr.Radio(choices=["best", "fast", "classic", "negative"], value='best', label="CLIP API Mode")
|
||||||
|
|
||||||
# WD API Options
|
# WD API Options
|
||||||
def update_wd_api_visibility(model_selection):
|
def update_wd_api_visibility(model_selection):
|
||||||
|
|
@ -219,8 +219,6 @@ class Script(scripts.Script):
|
||||||
raw_prompt = p.prompt
|
raw_prompt = p.prompt
|
||||||
interrogator = ""
|
interrogator = ""
|
||||||
|
|
||||||
# If no model selected or no image, interrogation should not run
|
|
||||||
if model_selection and not p.init_images[0]:
|
|
||||||
# fix alpha channel
|
# fix alpha channel
|
||||||
p.init_images[0] = p.init_images[0].convert("RGB")
|
p.init_images[0] = p.init_images[0].convert("RGB")
|
||||||
|
|
||||||
|
|
@ -280,7 +278,6 @@ class Script(scripts.Script):
|
||||||
|
|
||||||
return processed
|
return processed
|
||||||
|
|
||||||
|
|
||||||
# CLIP API Model Identification
|
# CLIP API Model Identification
|
||||||
def get_clip_API_models(self):
|
def get_clip_API_models(self):
|
||||||
# Ensure CLIP Interrogator is present and accessible
|
# Ensure CLIP Interrogator is present and accessible
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue