Skip to content

Test Pull for reload_model_on_generate option#393

Open
Arcayer wants to merge 4 commits into
Panchovix:mainfrom
Arcayer:main
Open

Test Pull for reload_model_on_generate option#393
Arcayer wants to merge 4 commits into
Panchovix:mainfrom
Arcayer:main

Conversation

@Arcayer

@Arcayer Arcayer commented Jul 28, 2025

Copy link
Copy Markdown

Description

This is test code in relation to #385, [Feature Request]: Don't Load Model on Generate Except When Neccessary

With this code operational, it places the user in control of when models are loaded, via an option in the settings menu under system. This prevents the UI from loading models when a model is already loaded, for instance, when using Hako-Mikan's supermerger.

I sort of think the proper behavior here is that there should be a flag set whenever the user selects a new model in the model dropdown menu, or when the UI is first loaded, and then unset whenever a model is loaded, but I'm not sure how to do that, so this is what I came up with.

Checklist:

Arcayer added 4 commits July 28, 2025 00:29
add the reload_model_on_generate option to processing.py
Update shared_options with reload_model_on_generate
@Panchovix

Copy link
Copy Markdown
Owner

Thanks for the PR. Gonna see if someone else can test it and see how it goes.

Default behavior after adding the option would be same as is at the moment?

@Panchovix Panchovix linked an issue Jul 29, 2025 that may be closed by this pull request
1 task
@Arcayer

Arcayer commented Jul 29, 2025

Copy link
Copy Markdown
Author

Yes. Default behavior shouldn't change anything.

I'm actually confused with how little problems turning this option on causes me. Turning on this option should cause errors when you try to generate without a model loaded, but that doesn't seem to happen. Reforge seems to load a model every time it's selected in the load model menu instead of waiting for the generate button to be pressed? So current behavior is: Load model, then check if model is loaded, and then on generate button press load the model if the chosen model isn't loaded. That's, wrong? It's supposed to be, choose model, then then on generate button press load it if it isn't loaded. Maybe I'm confused about what's supposed to happen here, or it's important to flux or something else that I'm not testing but it might be possible to just remove the model load on generate button press call altogether?

@Panchovix

Copy link
Copy Markdown
Owner

So now (without PR) it is:

Press generate -> if model loaded is used, and if not, it loads it.

With the PR: Basically the same but as an option? The first can happen if for example you use normal VRAM usage IIRC, or similar. With the PR how is VRAM usage when the model is not loaded? Also, what happens if you have the option of the PR enabled, then generate, does the model unloads after gen or it keeps it loaded?

@Arcayer

Arcayer commented Jul 29, 2025

Copy link
Copy Markdown
Author

Right now -> Generate is pressed. Check if the model loaded matches with the model selected, if not load model

With PR and reload_model_on_generate turned off -> Generate is pressed. Use whatever model happens to be loaded at the moment. This should produce an error if no model is loaded, and should also use the wrong model if the correct model hasn't been loaded. It has the advantage that if a model was loaded without switching which model was selected, for instance, via Hako Mikan's Supermerger, that won't be replaced when Generate is pressed. The model shouldn't unload after generation? Perhaps this could create issues if the model is unloaded manually, or because an outside program, for instance, Blender, stole the VRAM out from under Reforge?

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

Successfully merging this pull request may close these issues.

[Feature Request]: Don't Load Model on Generate Except When Neccessary

2 participants