Closed player99963 closed 1 day ago
Hey @player99963, I'm here to help you with any bugs, questions, or contributions you have regarding the repository. Let me know how I can assist you!
To fix the issue of the web UI redirecting to an unknown page when using the AfterDetailer Model in version 1.10.0, you need to ensure that the on_after_component
function correctly identifies and sets the txt2img_submit_button
and img2img_submit_button
components. Here is the relevant code snippet:
def on_after_component(component, **_kwargs):
global txt2img_submit_button, img2img_submit_button
if getattr(component, "elem_id", None) == "txt2img_generate":
txt2img_submit_button = component
return
if getattr(component, "elem_id", None) == "img2img_generate":
img2img_submit_button = component
Make sure that the elem_id
values for the components are correctly set to "txt2img_generate"
and "img2img_generate"
. If these IDs are incorrect or not set, the buttons will not be properly identified, leading to potential issues with the UI redirection [1].
To continue talking to Dosu, mention @dosu.
@dosu Programming is not my specialty, so can you tell me exactly which file in which location to modify to solve this problem?
To solve the issue of the web UI redirecting to an unknown page when using the AfterDetailer Model, you need to modify the on_after_component
function in the scripts/!adetailer.py
file.
Here is the relevant code snippet:
def on_after_component(component, **_kwargs):
global txt2img_submit_button, img2img_submit_button
if getattr(component, "elem_id", None) == "txt2img_generate":
txt2img_submit_button = component
return
if getattr(component, "elem_id", None) == "img2img_generate":
img2img_submit_button = component
Ensure that the elem_id
values for the components are correctly set to "txt2img_generate"
and "img2img_generate"
. This file is located in the scripts
directory of the adetailer
repository [1].
To continue talking to Dosu, mention @dosu.
@dosu I checked and it doesn't look like there's anything wrong with it.
def on_after_component(component, **_kwargs): global txt2img_submit_button, img2img_submit_button if getattr(component, "elem_id", None) == "txt2img_generate": txt2img_submit_button = component return
if getattr(component, "elem_id", None) == "img2img_generate":
img2img_submit_button = component
If the on_after_component
function looks correct, the issue might be related to other parts of the code or configuration. Here are a few things to check:
Dependencies and External Libraries:
Ensure that the script_callbacks
module and its associated mechanisms are functioning correctly, as they can influence the behavior of the on_after_component
function and the web UI redirection [1].
Other Event Handlers or Callback Functions:
There are other event handlers or callback functions in the scripts/!adetailer.py
file that might interact with the web UI components or cause redirection issues. Specifically, check the following functions:
on_ui_settings
on_before_ui
add_api_endpoints
These functions are registered with the following lines of code:
script_callbacks.on_ui_settings(on_ui_settings)
script_callbacks.on_after_component(on_after_component)
script_callbacks.on_app_started(add_api_endpoints)
script_callbacks.on_before_ui(on_before_ui)
Ensure these functions are not causing any unintended behavior [1].
Configuration Files or Settings:
Check the configuration settings added by the on_ui_settings
function, as they might influence the behavior of the web UI. These settings include options like ad_max_models
, ad_extra_models_dir
, and others [1][2].
Model Initialization and Loading:
Verify that the models are being loaded and initialized correctly. The get_models
function is responsible for loading the models, and the get_ad_model
method retrieves a model based on its name. Ensure there is no code inadvertently setting a URL based on the model's name [1].
Explicit URL Modifications:
Check if there is any code explicitly setting or modifying URLs for the web UI components. The add_api_endpoints
function adds several API endpoints to the FastAPI app, but ensure there are no unintended URL modifications [1].
By checking these areas, you might be able to identify the root cause of the web UI redirection issue.
To continue talking to Dosu, mention @dosu.
Describe the bug
When selecting the AfterDetailer Model, the web UI often directly navigates to the model's name URL, for example: http://yolov8s-seg.pt/.
Steps to reproduce
I installed the web UI using stable matrix, and the web UI version is 1.10.0. This issue can occur when using any AfterDetailer Model in either t2i or i2i. A model might work fine this time, but the next time I start and use it, it may cause a page redirect.
Screenshots
Console logs, from start to end.
List of installed extensions