Repository: AUTOMATIC1111/stable-diffusion-webui

Issue:
[Bug]: Deepdanbooru command line arg not fully deprecated
### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

It seems like the command line arg --deepdanbooru has some left effects on the webui pages. When the argument is absent, the button "Interrogate DeepBooru" is missing.

P.S. I am using a slightly personalized setup. Specifically, currently I am still keeping the original Deepdanbooru repo in my sd folder/forked branch. But AFAIK, it shouldn't result in something like this, because I had synced the branch and everything relevant should be up to date.

### Steps to reproduce the problem

1. Delete --deepdanbooru argument in webui-user.bat(as the commit c81d440d876dfd2ab3560410f37442ef56fc6632 suggests)
2. Run the bat
3. Go to img2img tab


### What should have happened?

There should be "Interrogate DeepBooru" button, even if argument --deepdanbooru is absent in webui-user.bat. Or there should be a setting to turn the deepdanbooru on or off.

P.S. This is with the expect of that the --deepdanbooru argument will be entirely deprecated. If this is not the case, then please inform me and I will close this issue.

### Commit where the problem happens

c81d440d876dfd2ab3560410f37442ef56fc6632

### What platforms do you use to access UI ?

Windows

### What browsers do you use to access the UI ?

Microsoft Edge

### Command Line Arguments

```Shell
--xformers --no-half-vae
```


### Additional information, context and logs

_No response_


Discussion:
Just came across this as well, saw that I didn't need --deepdanbooru anymore so I removed it, just went to pull tags for an image I just generated only to find the interrogate deepbooru button was missing.

I am not really doing anything custom and am not directly using the Deepdanbooru repo myself(Only whatever the webui itself downloads).

Using this in my webui-user.bat:
set COMMANDLINE_ARGS=--enable-console-prompts --api --no-half-vae
Same issue here

Resolving patch:
diff --git a/modules/ui.py b/modules/ui.py
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -478,9 +478,7 @@ def create_toprow(is_img2img):
         if is_img2img:
             with gr.Column(scale=1, elem_id="interrogate_col"):
                 button_interrogate = gr.Button('Interrogate\nCLIP', elem_id="interrogate")
-
-                if cmd_opts.deepdanbooru:
-                    button_deepbooru = gr.Button('Interrogate\nDeepBooru', elem_id="deepbooru")
+                button_deepbooru = gr.Button('Interrogate\nDeepBooru', elem_id="deepbooru")
 
         with gr.Column(scale=1):
             with gr.Row():
@@ -1004,11 +1002,10 @@ def create_ui(wrap_gradio_gpu_call):
                 outputs=[img2img_prompt],
             )
 
-            if cmd_opts.deepdanbooru:
-                img2img_deepbooru.click(
-                    fn=interrogate_deepbooru,
-                    inputs=[init_img],
-                    outputs=[img2img_prompt],
+            img2img_deepbooru.click(
+                fn=interrogate_deepbooru,
+                inputs=[init_img],
+                outputs=[img2img_prompt],
             )
 
 
@@ -1240,7 +1237,7 @@ def create_ui(wrap_gradio_gpu_call):
                         process_split = gr.Checkbox(label='Split oversized images')
                         process_focal_crop = gr.Checkbox(label='Auto focal point crop')
                         process_caption = gr.Checkbox(label='Use BLIP for caption')
-                        process_caption_deepbooru = gr.Checkbox(label='Use deepbooru for caption', visible=True if cmd_opts.deepdanbooru else False)
+                        process_caption_deepbooru = gr.Checkbox(label='Use deepbooru for caption', visible=True)
 
                     with gr.Row(visible=False) as process_split_extra_row:
                         process_split_threshold = gr.Slider(label='Split image threshold', value=0.5, minimum=0.0, maximum=1.0, step=0.05)


Test patch: