-
I would like to load my configuration differently instead of appsettings.json. I can supply the needed configuration like this
But these lines in Registration classes cause issues
If I comment the above lines, It loads the configuration from the data I give it but then I have to modify the source of the library, which is not a good solution. Looking for some guidance on the best way to supply the configuration without appsettings.json Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
The appsettings is also needed by .NET Core, logging etc, so the file will need to stay, but you can move the model stuff to another file or database. The
I will add some proper Registration overloads for the next version to make this a bit nicer to use |
Beta Was this translation helpful? Give feedback.
-
Ok, I added some convenience methods to registration so you can easily override the default config in a much nicer way Now you can override both configs like:
Note: you will need to call |
Beta Was this translation helpful? Give feedback.
-
I was thinking of submitting a PR around this also, as I think the fundamental design of having to register the This pain point was the second one I bumped up against after I solved the problem of how to actually get it running under Linux. When I was writing the tests for loading the model my initial assumption was that the programming model would be that the method to load the model would simply take some object that contained the necessary information required by the library to load it. I was a little confused to discover that the method to load the model instead took the name of the model, and the only way to pass the information required to load the model was to through I think the coupling to For instance think about how to handle something like what A1111's stable-diffusion-webui does where you finish training a dreambooth model or downloading a new model from Civit.ai into your models folder, you hit the 'refresh' button in the UI and it updates the list of available models, and you can then chose to load the new model. This all happens at runtime, and to support that via The reason I was thinking to submit a PR around it was the integration tests are currently forced to run on CUDA due to this coupling as it's defined in the Thoughts? |
Beta Was this translation helpful? Give feedback.
-
I can add some changes to improve runtime loading, make it a bit nicer to use At the moment you need to use the |
Beta Was this translation helpful? Give feedback.
Ok, I added some convenience methods to registration so you can easily override the default config in a much nicer way
Commit
Now you can override both configs like:
Note: you will need to call
AddOnnxStack()
explicitly beforeAddOnnxStackStableDiffusion
if you are using custom configs