-
-
Notifications
You must be signed in to change notification settings - Fork 326
Feature/model parameter overrides #1109
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
base: master
Are you sure you want to change the base?
Changes from all commits
16f9c61
7bfe77b
5d49112
6ad221e
c3a6074
a31e1e5
0835728
777a117
3fb64e0
8af0e19
5ba7dea
2c308a7
242f0b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -226,14 +226,29 @@ public static async Task<JObject> InstallConfirmWS(Session session, WebSocket so | |
| public static async Task<JObject> GetMyUserData(Session session) | ||
| { | ||
| Settings.User.AutoCompleteData settings = session.User.Settings.AutoComplete; | ||
| JObject itemPresetLinks = new JObject(); | ||
| try | ||
| { | ||
| string rawJson = session.User.GetGenericData("itempresetlinks", "data"); | ||
| if (!string.IsNullOrWhiteSpace(rawJson)) | ||
| { | ||
| itemPresetLinks = JObject.Parse(rawJson); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was trying to make more clear that the ability to set a preset applies to both models and lora. Happy to rename if you have a better idea.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Base Models and LoRAs are both types of model
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough. I was going by how the UI refers to them. Ran out of time tonight, will come back to this and remaining items as soon as I get a chance again. |
||
| } | ||
| } | ||
| catch | ||
| { | ||
| // If JSON parsing fails, just return empty object | ||
| itemPresetLinks = new JObject(); | ||
| } | ||
| return new JObject() | ||
| { | ||
| ["user_name"] = session.User.UserID, | ||
| ["presets"] = new JArray(session.User.GetAllPresets().Select(p => p.NetData()).ToArray()), | ||
| ["language"] = session.User.Settings.Language, | ||
| ["permissions"] = JArray.FromObject(session.User.GetPermissions()), | ||
| ["starred_models"] = JObject.Parse(session.User.GetGenericData("starred_models", "full") ?? "{}"), | ||
| ["autocompletions"] = string.IsNullOrWhiteSpace(settings.Source) ? null : new JArray(AutoCompleteListHelper.GetData(settings.Source, settings.EscapeParens, settings.Suffix, settings.SpacingMode)) | ||
| ["autocompletions"] = string.IsNullOrWhiteSpace(settings.Source) ? null : new JArray(AutoCompleteListHelper.GetData(settings.Source, settings.EscapeParens, settings.Suffix, settings.SpacingMode)), | ||
| ["item_preset_links"] = itemPresetLinks | ||
| }; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd probably make more sense for this to be a setting on each Preset rather than a global user setting. Some presets should autoapply, others shouldn't. The functionality would probably be beneficial for all presets rather than specific to model. This should aaalso probably be a separate PR.