Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to show mask on the live preview window during processing? #8

Closed
blueball81 opened this issue Apr 24, 2023 · 4 comments

Comments

@blueball81
Copy link

Hi,

This extension looks fantastic to fix images automatically.
But, as you know, sometimes the detection/segmentation does not work properly, and gives unintended results.

Do you think this extension is able to show acquired masks/segmentation results on the live preview window during processing?
In this way, we don't need to go the image browser after image generation to check whether the mask was acquired properly or not. The result mask on the preview window doesn't need to be saved as a file, but to show only on the screen.

The original Detection Detailer by dustysys (https://github.com/dustysys/ddetailer) shows the acquired mask on the live preview as in the following screen captures.

Please, consider to implement this funtionality. Thanks,

Examples: dustysys/ddetailer#4 (comment)
image

@NeoGraph-K
Copy link
Owner

Several people have requested this feature and are checking it out. To create that feature, you need to check the preview process, so it will take some time.

@blueball81
Copy link
Author

blueball81 commented Apr 26, 2023

Thanks for considering this feature.

Just FYI, here I leave some codes that I found. I hope this would help for your work.

Looking at the codes of DDetailer, it seems that it is just handover the mask image to the variable, shared.state.current_image, as in the following.

ddetailer.py
image

Also, it is also possible to show/add mask images in the preview window after the processing as in the following code, using ‘processed.images.extend’ method in the postprocess method. In your code, it would be ‘res.images.extend’ method.

controlnet.py
image

@NeoGraph-K
Copy link
Owner

Thanks for pointing out that code. I checked that code and it doesn't seem difficult to create behavior with that function. Let's add that feature as an option.

@NeoGraph-K
Copy link
Owner

I think I've fixed that issue.
However, when I turn on the preview option in my current environment, an error that does not work occurs, making it impossible to check. Please test and give feedback on this issue if you have any problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants