stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[Bug]: ScuNET extensions "on" ScuNET button does not appear on the extra page
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
I checked the ScuNET option at extensions page
but when I restart webui, ScuNET does not appear on the extra page
Steps to reproduce the problem
- checked the ScuNET
- restart webui
- go to extra page
What should have happened?
ScuNET should appear at extra page
Commit where the problem happens
d97f467c0d27695d23edad5e4f8898a57e0ccb00
What platforms do you use to access UI ?
No response
What browsers do you use to access the UI ?
No response
Command Line Arguments
No response
Additional information, context and logs
No response
But how did it become unchecked in the first place? I unchecked it, scunet dissapeared from my upscalers list, then i checked it again and it appeared back. I cannot yet reproduce your issue.
I know what the cause of this is, I looked into it the other day. There were 2 things that need attention.
- scunet_model.py is missing from modules, this is where it's loaded from so if it's not there it's not loaded.
Copy extensions-builtin/ScuNET/scripts/scunet_model.py into modules.
- The cleanup_models() function in modules/modelloader.py does not handle the path for the ScuNET models. I'm not 100% sure if this is required because I did this before I found the model wasn't being loaded but might as well do it right.
Add this to the end of the cleanup_models() function of modules/modelloader.py (line 79)
dest_path = os.path.join(models_path, "ScuNET")
move_files(src_path, dest_path)
The rest of the upscaler stuff is dynamic so I'm pretty sure thats all that is required for it to work anywhere the other upscalers do.
scunet_model.py is missing from modules, this is where it's loaded from so if it's not there it's not loaded.
But that's not how it works. In webui.py scripts are intentionally loaded just before models
https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/ff6a5bcec1ce25aa8f08b157ea957d764be23d8d/webui.py#L66-L68
That's because every extension with upscaler creates a subclass via script https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/ff6a5bcec1ce25aa8f08b157ea957d764be23d8d/extensions-builtin/ScuNET/scripts/scunet_model.py#L15
And later they are all found here: https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/ff6a5bcec1ce25aa8f08b157ea957d764be23d8d/modules/modelloader.py#L160-L167
I'm pretty sure if auto had spare time he'd move all upscalers to extensions and removed parsing ./modules
files, as it looks way dirtier than subclasses.
I checked that it indeed creates subclass for me.
When extension is unchecked, script won't be executed therefore associated upscaler wont be a subclass.
Cleanup lines for upscalers that are extensions now look weird and scunet missing among them is a mystery to me.
It may not be how it supposed to work but can't argue with the results.....
Something is messed up with the friendly names, I don't think those work, but the full filename ones do.
I haven't had ScuNET for a long time and extension for me was ticked and the models were in the ScuNET folder. One day they just disappeared from the list and yesterday I did the above and they are back
I know what the cause of this is, I looked into it the other day. There were 2 things that need attention.
1. scunet_model.py is missing from modules, this is where it's loaded from so if it's not there it's not loaded.
Copy extensions-builtin/ScuNET/scripts/scunet_model.py into modules.
2. The cleanup_models() function in modules/modelloader.py does not handle the path for the ScuNET models. I'm not 100% sure if this is required because I did this before I found the model wasn't being loaded but might as well do it right.
Add this to the end of the cleanup_models() function of modules/modelloader.py (line 79)
dest_path = os.path.join(models_path, "ScuNET") move_files(src_path, dest_path)
The rest of the upscaler stuff is dynamic so I'm pretty sure thats all that is required for it to work anywhere the other upscalers do.
This method works for me,thx
worked for me too tyvm
ScuNET and SWINIR are indeed not appearing in the redraw/extra options
To solve this, you may need to start a new "webui" folder from scratch. This bug appears in my old project folder, but not in the new one. or an extension compatibility problem.
There's been a lot of rework to how the webui initializes over the last few months and I think this is resolved now. If not, feel free to re-open or open a new issue.