-
+
GPU usage:
@@ -1423,41 +1389,102 @@ export default {
return { 'status': false }
});
},
- onSettingsBinding() {
+ onSettingsBinding(bindingEntry) {
- const arr = '[{"name":"model_name","type":"str","value":"DreamShaper_5_beta2_noVae_half_pruned.ckpt", "help":"Name of the model to be loaded for stable diffusion generation"},{"name":"ddim_steps","type":"int","value":50, "min":10, "max":1024},{"name":"scale","type":"float","value":7.5, "min":0.1, "max":100.0},{"name":"W","type":"int","value":512, "min":10, "max":2048},{"name":"H","type":"int","value":512, "min":10, "max":2048},{"name":"skip_grid","type":"bool","value":true,"help":"Skip building a grid of generated images"},{"name":"batch_size","type":"int","value":1, "min":1, "max":100,"help":"Number of images per batch (requires more memory)"},{"name":"num_images","type":"int","value":1, "min":1, "max":100,"help":"Number of batch of images to generate (to speed up put a batch of n and a single num images, to save vram, put a batch of 1 and num_img of n)"},{"name":"seed","type":"int","value":-1}, {"name":"servers_addresses","type":"list","value":[], "help":"A list of server addresses for example [\'http://localhost:9601\', \'http://localhost:9602\']"},{"name":"keep_only_active_servers","type":"bool","value":true, "help":"If true, then only active servers will be kept in the loop"},{"name":"sampler_name","type":"str","value":"ddim","help":"Supported sampler names: ddim, dpms, plms", "options":["ddim","dpms","plms"]}]'
- const arr2 = JSON.parse(arr)
+ try {
+ this.isLoading = true
+ axios.get('/get_active_binding_settings').then(res => {
+ this.isLoading = false
+ if (res) {
- const newItem = { name: "babagaga", value: ['lol', 'asdasd', 'hhhhhh'], type: 'list', help: 'smelly ' }
- arr2.push(newItem)
- // this.$refs.universalForm.showForm(arr2, "Baba booey form", "Go for torps", "go home").then(res => {
- // console.log('finished', res)
- // }) // disabled to not break UI just add endpoint or anything
+ console.log('binding sett', res)
+
+ if (res.data && Object.keys(res.data).length > 0) {
+
+ // open form
+
+ this.$refs.universalForm.showForm(res.data, "Binding settings - " + bindingEntry.binding.name, "Save changes", "Cancel").then(res => {
+ // send new data
+ try {
+ axios.post('/set_active_binding_settings',
+ res).then(response => {
+
+ if (response && response.data) {
+ console.log('binding set with new settings', response.data)
+ this.$refs.toast.showToast("Binding settings updated successfully!", 4, true)
+
+ } else {
+ this.$refs.toast.showToast("Did not get binding settings responses.\n" + response, 4, false)
+ this.isLoading = false
+ }
+
+
+ })
+ } catch (error) {
+ this.$refs.toast.showToast("Did not get binding settings responses.\n Endpoint error: " + error.message, 4, false)
+ this.isLoading = false
+ }
+
+
+
+ })
+ } else {
+ this.$refs.toast.showToast("Binding has no settings", 4, false)
+ this.isLoading = false
+ }
+
+ }
+ })
+
+ } catch (error) {
+ this.isLoading = false
+ this.$refs.toast.showToast("Could not open binding settings. Endpoint error: " + error.message, 4, false)
+ }
},
onSettingsPersonality(persEntry) {
try {
- axios.post('/get_personality_settings',
- {
- language: persEntry.personality.language,
- category: persEntry.personality.category,
- folder: persEntry.personality.folder
- }).then(res => {
+ this.isLoading = true
+ axios.get('/get_active_personality_settings').then(res => {
+ this.isLoading = false
+ if (res) {
- if (res) {
+ console.log('pers sett', res)
+ if (res.data && Object.keys(res.data).length > 0) {
+
+ this.$refs.universalForm.showForm(res.data, "Personality settings - " + persEntry.personality.name, "Save changes", "Cancel").then(res => {
- console.log('pers sett', res)
- if (res.data) {
- this.$refs.universalForm.showForm(res.data, "Personality settings - " + persEntry.personality.name, "Save changes", "Cancel").then(res => {
- this.$refs.toast.showToast("Personality settings updated successfully!", 4, true)
+ // send new data
+ try {
+ axios.post('/set_active_personality_settings',
+ res).then(response => {
- //console.log('finished', res)
- })
- }
+ if (response && response.data) {
+ console.log('personality set with new settings', response.data)
+ this.$refs.toast.showToast("Personality settings updated successfully!", 4, true)
+ } else {
+ this.$refs.toast.showToast("Did not get Personality settings responses.\n" + response, 4, false)
+ this.isLoading = false
+ }
+
+
+ })
+ } catch (error) {
+ this.$refs.toast.showToast("Did not get Personality settings responses.\n Endpoint error: " + error.message, 4, false)
+ this.isLoading = false
+ }
+
+ })
+ } else {
+ this.$refs.toast.showToast("Personality has no settings", 4, false)
+ this.isLoading = false
}
- })
+
+ }
+ })
} catch (error) {
+ this.isLoading = false
this.$refs.toast.showToast("Could not open personality settings. Endpoint error: " + error.message, 4, false)
}